From 4a2792b4dacaac7457fca2c736bc74b44a236771 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 22 Jan 2025 19:00:46 -0800 Subject: [PATCH] fix: model ids not being applied --- backend/open_webui/routers/ollama.py | 2 +- backend/open_webui/routers/openai.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/ollama.py b/backend/open_webui/routers/ollama.py index 4a6456590..370e9ecec 100644 --- a/backend/open_webui/routers/ollama.py +++ b/backend/open_webui/routers/ollama.py @@ -261,7 +261,7 @@ async def get_all_models(request: Request): if request.app.state.config.ENABLE_OLLAMA_API: request_tasks = [] for idx, url in enumerate(request.app.state.config.OLLAMA_BASE_URLS): - if (str(idx) not in request.app.state.config.OLLAMA_API_CONFIGS) or ( + if (str(idx) not in request.app.state.config.OLLAMA_API_CONFIGS) and ( url not in request.app.state.config.OLLAMA_API_CONFIGS # Legacy support ): request_tasks.append(send_get_request(f"{url}/api/tags")) diff --git a/backend/open_webui/routers/openai.py b/backend/open_webui/routers/openai.py index 6f570368d..f7d7fd294 100644 --- a/backend/open_webui/routers/openai.py +++ b/backend/open_webui/routers/openai.py @@ -266,7 +266,7 @@ async def get_all_models_responses(request: Request) -> list: request_tasks = [] for idx, url in enumerate(request.app.state.config.OPENAI_API_BASE_URLS): - if (str(idx) not in request.app.state.config.OPENAI_API_CONFIGS) or ( + if (str(idx) not in request.app.state.config.OPENAI_API_CONFIGS) and ( url not in request.app.state.config.OPENAI_API_CONFIGS # Legacy support ): request_tasks.append(