From adf958559bd15af35b984902eb4dafaa0003f980 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 13 Sep 2024 14:20:27 -0400 Subject: [PATCH] refac: filter non chat completions models --- backend/open_webui/apps/openai/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/open_webui/apps/openai/main.py b/backend/open_webui/apps/openai/main.py index 19719d234..6aa7dd2fe 100644 --- a/backend/open_webui/apps/openai/main.py +++ b/backend/open_webui/apps/openai/main.py @@ -218,6 +218,19 @@ def merge_models_lists(model_lists): "urlIdx": idx, } for model in models + if "api.openai.com" + not in app.state.config.OPENAI_API_BASE_URLS[idx] + or not any( + name in model["id"] + for name in [ + "babbage", + "dall-e", + "davinci", + "embedding", + "tts", + "whisper", + ] + ) ] )