From d569681daaa71e27def618f1bdb2ef813f78389d Mon Sep 17 00:00:00 2001 From: tesuri Date: Thu, 12 Mar 2026 23:49:34 +0900 Subject: [PATCH] Change model sorting to natural order (#582) Use natural sorting for model names. Previously the model list was sorted lexicographically, which resulted in unintuitive ordering when numbers were included in the name. Example: Before qwen3.5:2B qwen3.5:35B-3AB qwen3.5:9B After qwen3.5:2B qwen3.5:9B qwen3.5:35B-3AB This change sorts models using natural order so numeric parts are compared numerically. --- ui-svelte/src/stores/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-svelte/src/stores/api.ts b/ui-svelte/src/stores/api.ts index e64665fe..4835f166 100644 --- a/ui-svelte/src/stores/api.ts +++ b/ui-svelte/src/stores/api.ts @@ -62,7 +62,7 @@ export function enableAPIEvents(enabled: boolean): void { const newModels = JSON.parse(message.data) as Model[]; // Sort models by name and id newModels.sort((a, b) => { - return (a.name + a.id).localeCompare(b.name + b.id); + return (a.name + a.id).localeCompare(b.name + b.id, undefined, { numeric : true} ); }); models.set(newModels); break;