From 3ba7b6f0e56173b9e750a80d5e7cf9213e4c1aba Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 11 Nov 2024 21:52:39 -0800 Subject: [PATCH] fix --- backend/open_webui/apps/openai/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/openai/main.py b/backend/open_webui/apps/openai/main.py index ef79c205b..5a78cd52b 100644 --- a/backend/open_webui/apps/openai/main.py +++ b/backend/open_webui/apps/openai/main.py @@ -288,7 +288,7 @@ async def get_all_models_raw() -> list: aiohttp_get(f"{url}/models", app.state.config.OPENAI_API_KEYS[idx]) ) else: - api_config = app.state.config.OPENAI_API_CONFIGS[url] + api_config = app.state.config.OPENAI_API_CONFIGS.get(url, {}) enabled = api_config.get("enabled", True) model_ids = api_config.get("model_ids", []) @@ -322,7 +322,7 @@ async def get_all_models_raw() -> list: for idx, response in enumerate(responses): if response: url = app.state.config.OPENAI_API_BASE_URLS[idx] - api_config = app.state.config.OPENAI_API_CONFIGS[url] + api_config = app.state.config.OPENAI_API_CONFIGS.get(url, {}) prefix_id = api_config.get("prefix_id", None)