From ddae02976d8cfb9221a5b490d3897850670bd873 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Wed, 14 Oct 2026 00:24:04 +0800 Subject: [PATCH] sort models in returned list --- kcpp_agent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kcpp_agent.py b/kcpp_agent.py index 9fc32bd71..c5e2bb737 100644 --- a/kcpp_agent.py +++ b/kcpp_agent.py @@ -1810,6 +1810,7 @@ def probe_endpoint(base_url: str, api_key: str, timeout: int) -> tuple[bool, str model_id = entry.get("id") if isinstance(entry, dict) else None if isinstance(model_id, str) and model_id.strip() and model_id not in models: models.append(model_id) + models.sort(key=str.casefold) return True, detail, models except urllib.error.HTTPError as exc: # Authentication failures and servers without /models are still reachable.