mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 05:02:01 -06:00
[GH-ISSUE #6303] OpenAI API not considered enabled when there's only one API URL and an empty API key #68916
Reference in New Issue
Block a user
Originally created by @alev000 on GitHub (Oct 21, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/6303
From this discord thread
If a user has only one OpenAI API URL in the Admin "Connections" tab, and the corresponding API key is empty, the model connection can be verified, but it will not show up in model-selection menus elsewhere in the UI. (Note: this is a common scenario when running a local non-ollama model like vLLM or llama.cpp.)
I think I've tracked this down to the following backend code, in
is_openai_api_disabled, which gets called as part ofget_all_modelswhen handling/api/v1/models.https://github.com/open-webui/open-webui/blob/c2d1a3164e0a310f77a88ede2938c6adb58a334f/backend/open_webui/apps/openai/main.py#L239-L242
^ This code considers OpenAI API's to be disabled if there is only one empty key. I think it would be more correct to check for only one empty URL instead.
Potential short-term workarounds:
@tjbck commented on GitHub (Oct 21, 2024):
Removed the constraint in dev.