Browse Source

fix: internal server error when calling completions API with non-existent model names

Signed-off-by: Ho Kim <ho.kim@ulagbulag.io>
Ho Kim 1 month ago
parent
commit
1efae95a36
1 changed files with 3 additions and 0 deletions
  1. 3 0
      backend/open_webui/main.py

+ 3 - 0
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)