浏览代码

refac: filter non chat completions models

Timothy J. Baek 7 月之前
父节点
当前提交
adf958559b
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      backend/open_webui/apps/openai/main.py

+ 13 - 0
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",
+                        ]
+                    )
                 ]
             )