[PR #22097] [CLOSED] fix: ensure RAG and specialized OpenAI configs inherit environment values #49528

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

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22097
Author: @VedantMadane
Created: 3/1/2026
Status: Closed

Base: mainHead: fix/config-openai-inheritance


📝 Commits (1)

  • d61912c fix: ensure RAG and other specialized OpenAI configs inherit INITIAL_OPENAI environment values

📊 Changes

1 file changed (+13 additions, -10 deletions)

View changed files

📝 backend/open_webui/config.py (+13 -10)

📄 Description

Fixes #22084.

Problem

Internal logic in config.py was resetting OPENAI_API_BASE_URL and OPENAI_API_KEY to hardcoded defaults mid-way through initialization. This caused specialized modules (RAG, Image Generation, Audio STT/TTS) to ignore user-provided environment variables and fallback to the hardcoded OpenAI defaults instead of the user's primary OpenAI configuration.

Solution

  • Introduced INITIAL_OPENAI_API_BASE_URL and INITIAL_OPENAI_API_KEY to capture environment values at the very start of initialization.
  • Updated all dependent PersistentConfig instances (RAG, IMAGES, AUDIO) to use these captured initial values as their defaults.
  • This ensures that if a user sets OPENAI_API_BASE_URL, it correctly flows down to RAG_OPENAI_API_BASE_URL if the latter is not explicitly set.

🔄 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/22097 **Author:** [@VedantMadane](https://github.com/VedantMadane) **Created:** 3/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/config-openai-inheritance` --- ### 📝 Commits (1) - [`d61912c`](https://github.com/open-webui/open-webui/commit/d61912c8bb7abe0bfa2efe1a0fc786bd32289bfc) fix: ensure RAG and other specialized OpenAI configs inherit INITIAL_OPENAI environment values ### 📊 Changes **1 file changed** (+13 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+13 -10) </details> ### 📄 Description Fixes #22084. ### Problem Internal logic in config.py was resetting OPENAI_API_BASE_URL and OPENAI_API_KEY to hardcoded defaults mid-way through initialization. This caused specialized modules (RAG, Image Generation, Audio STT/TTS) to ignore user-provided environment variables and fallback to the hardcoded OpenAI defaults instead of the user's primary OpenAI configuration. ### Solution - Introduced INITIAL_OPENAI_API_BASE_URL and INITIAL_OPENAI_API_KEY to capture environment values at the very start of initialization. - Updated all dependent PersistentConfig instances (RAG, IMAGES, AUDIO) to use these captured initial values as their defaults. - This ensures that if a user sets OPENAI_API_BASE_URL, it correctly flows down to RAG_OPENAI_API_BASE_URL if the latter is not explicitly set. --- <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-30 01:49:25 -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#49528