mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #22084] issue: RAG_OPENAI_ env vars do not inherit OPENAI_API_ values
#35164
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?
Originally created by @kirill-sch on GitHub (Mar 1, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22084
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.5
Ollama Version (if applicable)
No response
Operating System
Windows 11
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
If
RAG_OPENAI_API_BASE_URLandRAG_OPENAI_API_KEYare not explicitly set, the app should automatically fall back toOPENAI_API_BASE_URLandOPENAI_API_KEY, as described in the environment variable configuration.Actual Behavior
When
RAG_OPENAI_API_BASE_URLandRAG_OPENAI_API_KEYare not set, the application does not correctly inherit the explicitly configuredOPENAI_API_BASE_URLandOPENAI_API_KEYvalues. Instead, it falls back to the default (https://api.openai.com/v1) for OPENAI_API_BASE_URL, even if a different value was provided. SinceOPENAI_API_KEYdoes not have a default value, it falls back to an empty string.As a result, the explicitly configured OpenAI endpoint and API key are not reused for RAG operations. Users are therefore required to define both
RAG_OPENAI_API_BASE_URLandRAG_OPENAI_API_KEY, even when they intend to use the same OpenAI compatible configuration for both general LLM usage and RAG.Steps to Reproduce
Under the Embedding Model Engine settings we can see that it doesn't use the two configured
OPENAIenvs.It will return with an
IndexError: list index out of rangeerror and in the logs we can confirm that it's calling the same OpenAI endpoint observed in step 2.You will see that it now uses the configured environment variables, and the document upload will be successful.
Logs & Screenshots
Additional Information
No response
@tjbck commented on GitHub (Mar 6, 2026):
They do inherit but they're PersistentConfigs
@kirill-sch commented on GitHub (Mar 6, 2026):
Sorry, I left it out of the config part, but what is shown above was done with PersistentConfig turned off. Even with that turned off, they do not inherit.
If I hadn’t set
ENABLE_PERSISTENT_CONFIG: "False", then it wouldn’t have mattered whether I set the two env variables in step 4 or not, since it wouldn’t have changed anything.