From 4cca1829c2f7012ab693976e9faadb481615078a Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 13 Aug 2025 17:49:57 +0400 Subject: [PATCH] refac --- backend/open_webui/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 076d4c486d..3a8c77100c 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1317,7 +1317,7 @@ async def get_models( model_order_dict = {model_id: i for i, model_id in enumerate(model_order_list)} # Sort models by order list priority, with fallback for those not in the list models.sort( - key=lambda x: (model_order_dict.get(x["id"], float("inf")), x["name"]) + key=lambda x: (model_order_dict.get(x["id"], float("inf")), x.get("name")) ) # Filter out models that the user does not have access to