From 1efae95a36e070e47c01761c497dda1fe4142a14 Mon Sep 17 00:00:00 2001 From: Ho Kim Date: Mon, 7 Apr 2025 06:48:39 +0000 Subject: [PATCH] fix: internal server error when calling completions API with non-existent model names Signed-off-by: Ho Kim --- backend/open_webui/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 8e7d6a8be..54cab47f1 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1053,6 +1053,9 @@ async def chat_completion( model_item = form_data.pop("model_item", {}) tasks = form_data.pop("background_tasks", None) + # placeholder + metadata = {} + try: if not model_item.get("direct", False): model_id = form_data.get("model", None)