mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #22125] [CLOSED] fix: ensure RAG and specialized OpenAI configs inherit environment values #49552
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22125
Author: @VedantMadane
Created: 3/2/2026
Status: ❌ Closed
Base:
dev← Head:fix/config-openai-inheritance📝 Commits (1)
cc527d7fix: 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
Testing Confirmation
I have personally tested these changes by setting the \OPENAI_API_BASE_URL\ and \OPENAI_API_KEY\ environment variables and verifying that the RAG, Image Generation, and Audio modules correctly inherit these values during initialization. I also verified that explicit overrides (e.g. setting \RAG_OPENAI_API_BASE_URL) still work as expected.
I agree to the contributor license agreement.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.