mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #1111] bug: Model connection to api.openai.com timeout blocks page load #51008
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 @ghost on GitHub (Mar 9, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1111
Bug Report
Description
Bug Summary:
Steps to Reproduce:
Block outbound network access to api.openai.com.
Expected Behavior:
Connections shouldn't be made to openai.com if OPENAI_API_KEYS is unset or empty; perhaps this should also be an async call?
Actual Behavior:
Upon login, the page doesn't load for 5.2 minutes as demonstrated in the screenshot.
Environment
Reproduction Details
Confirmation:
Logs and Screenshots
Browser Console Logs:
Stack:
Docker Container Logs:
Screenshots (if applicable):

Installation Method
Podman systemd service using docker image.
Additional Information
I've no interest in using OpenAI nor permitting Open WebUI unnecessary network access.
@justinh-rahb commented on GitHub (Mar 9, 2024):
Set your key to "None", try again.
@ghost commented on GitHub (Mar 11, 2024):
No change with
--env OPENAI_API_KEY=None. Any value set for this variable doesn't seem to matter. Note that /backend/config.py already setsnonewhen the the value is""(although lower case):8ed5759d0e/backend/config.py (L237-L238)The default for
OPENAI_API_BASE_URLis here:8ed5759d0e/backend/config.py (L240-L241)The only way I can get the main post-login page to load in a timely fashion is to set an invalid hostname like
--env OPENAI_API_BASE_URL=Nonewhich results in this behavior:Here's what appears to be occuring:
8ed5759d0e/backend/main.py (L108)onMount()which contains a call togetModels()at:8ed5759d0e/src/routes/(app)/%2Blayout.svelte#L109getModels()function then executes a request to the backend APIgetOpenAIModels():8ed5759d0e/src/routes/(app)/%2Blayout.svelte#L47-L68get_models()orget_all_models()or both:8ed5759d0e/backend/apps/openai/main.py (L171-L186)8ed5759d0e/backend/apps/openai/main.py (L192-L222)@tjbck commented on GitHub (Mar 11, 2024):
Just added a fix to our 'dev' branch, let me know if the issue persists!
@ghost commented on GitHub (Mar 11, 2024):
Thank you very much, fix confirmed.