[PR #2336] [CLOSED] changed: auth ollama connection #36596

Closed
opened 2026-04-25 10:24:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/2336
Author: @ymerejeremy
Created: 5/17/2024
Status: Closed

Base: devHead: dev


📝 Commits (10+)

  • 7628498 Add auth token settings
  • 8a60724 Add headers to ollama's requests
  • ee14f11 Add OLLAMA_AUTH_KEYS env var
  • 012fe4d Keep essentials headers to avoid decoding error
  • b221c22 Normalize code
  • e3508bb Set OLLAMA_AUTH_KEY env. var. as optional
  • bb1086c Avoid OLLAMA connection failed python error to show javascript error message
  • 35ee9ba Add PersistentConfig support
  • 24a88b6 Fix rebase error
  • 0cdb767 Fix build_headers url compare

📊 Changes

4 files changed (+218 additions, -11 deletions)

View changed files

📝 backend/apps/ollama/main.py (+52 -8)
📝 backend/config.py (+12 -0)
📝 src/lib/apis/ollama/index.ts (+67 -0)
📝 src/lib/components/chat/Settings/Connections.svelte (+87 -3)

📄 Description

Pull Request Checklist

  • Target branch: Pull requests should target the dev branch.
  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for the changes?
  • Code Review: Have you self-reviewed your code and addressed any coding standard issues?

Description

Add support for ollama connection that require a token access. The token can be set with the environment variable OLLAMA_AUTH_KEY or in the connection settings.


Changelog Entry

Added

  • Optional environment variables OLLAMA_AUTH_KEY and OLLAMA_AUTH_KEYS to set access token
  • Option to set access token in connections settings

Fixed

  • In ollama router, improve ollama response checking for get_ollama_versions(...) (route /api/version) and get_all_models() methods to avoid errors

Changed

  • Use token access for ollama connection

Additional Information

video-haunui-ok

Issue : #2305


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/2336 **Author:** [@ymerejeremy](https://github.com/ymerejeremy) **Created:** 5/17/2024 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (10+) - [`7628498`](https://github.com/open-webui/open-webui/commit/7628498f85dad26c217e6b61ed1123b9cd1c1a90) Add auth token settings - [`8a60724`](https://github.com/open-webui/open-webui/commit/8a60724acd915f29de2b759d37e0de74cb935554) Add headers to ollama's requests - [`ee14f11`](https://github.com/open-webui/open-webui/commit/ee14f118663f4a559924cba10dfbaee7bb25210d) Add OLLAMA_AUTH_KEYS env var - [`012fe4d`](https://github.com/open-webui/open-webui/commit/012fe4d73caa509890fb91d603e6fbed7363a641) Keep essentials headers to avoid decoding error - [`b221c22`](https://github.com/open-webui/open-webui/commit/b221c22844e455c3892524c79e0ff2f2bfb4ce95) Normalize code - [`e3508bb`](https://github.com/open-webui/open-webui/commit/e3508bbd837330aeda34c9eb33b08c006265a8d4) Set OLLAMA_AUTH_KEY env. var. as optional - [`bb1086c`](https://github.com/open-webui/open-webui/commit/bb1086ca649c67b7a48cfb2876290c086f5909d6) Avoid OLLAMA connection failed python error to show javascript error message - [`35ee9ba`](https://github.com/open-webui/open-webui/commit/35ee9bacf906cfd002c928742d2658e80c2afbe8) Add PersistentConfig support - [`24a88b6`](https://github.com/open-webui/open-webui/commit/24a88b6bec69be8e195de2375db86c6e97f32326) Fix rebase error - [`0cdb767`](https://github.com/open-webui/open-webui/commit/0cdb767fa0269631b2229963f75a2e3d05aae64d) Fix build_headers url compare ### 📊 Changes **4 files changed** (+218 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/ollama/main.py` (+52 -8) 📝 `backend/config.py` (+12 -0) 📝 `src/lib/apis/ollama/index.ts` (+67 -0) 📝 `src/lib/components/chat/Settings/Connections.svelte` (+87 -3) </details> ### 📄 Description ## Pull Request Checklist - [x] **Target branch:** Pull requests should target the `dev` branch. - [x] **Description:** Briefly describe the changes in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for the changes? - [x] **Code Review:** Have you self-reviewed your code and addressed any coding standard issues? --- ## Description Add support for ollama connection that require a token access. The token can be set with the environment variable OLLAMA_AUTH_KEY or in the connection settings. --- ### Changelog Entry ### Added - Optional environment variables OLLAMA_AUTH_KEY and OLLAMA_AUTH_KEYS to set access token - Option to set access token in connections settings ### Fixed - In ollama router, improve ollama response checking for `get_ollama_versions(...)` (route `/api/version`) and `get_all_models()` methods to avoid errors ### Changed - Use token access for ollama connection --- ### Additional Information ![video-haunui-ok](https://github.com/open-webui/open-webui/assets/47544043/e21dac68-e753-4666-bb17-834cfe4b51eb) Issue : #2305 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 10:24:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#36596