From baaf2f7bf0c16aa61c175a990e618be7acb45186 Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Wed, 16 Sep 2026 12:48:23 +0200 Subject: [PATCH] ui : always store the model selection backend-qualified Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash --- tools/ui/src/lib/stores/models/index.svelte.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/ui/src/lib/stores/models/index.svelte.ts b/tools/ui/src/lib/stores/models/index.svelte.ts index db7cd4320e..1e41e39267 100644 --- a/tools/ui/src/lib/stores/models/index.svelte.ts +++ b/tools/ui/src/lib/stores/models/index.svelte.ts @@ -339,6 +339,9 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost { const backendId = backendIdFromModelId(modelId) ?? backendsStore.active.id; const rawId = rawModelId(modelId); + // the selection is stored backend-qualified, matching the aggregated + // model list, no matter which form the caller passed + const qualifiedId = qualifyModelId(backendId, rawId); // a model from another backend makes that backend active first if (backendId !== backendsStore.active.id) { @@ -347,7 +350,7 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost { await this.switchBackend(); } - if (this.selectedModelId === modelId) return; + if (this.selectedModelId === qualifiedId) return; const option = this.activeModels.find((model) => model.id === rawId); @@ -357,7 +360,7 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost { this.error = null; try { - this.selectedModelId = modelId; + this.selectedModelId = qualifiedId; this.selectedModelName = option.model; } finally { this.updating = false;