]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix model selector locked to first loaded model with multiple models (#20580)
authorPascal <redacted>
Mon, 16 Mar 2026 11:04:06 +0000 (12:04 +0100)
committerGitHub <redacted>
Mon, 16 Mar 2026 11:04:06 +0000 (12:04 +0100)
* webui: fix model selector being locked to first loaded model

When multiple models are loaded, the auto-select effect would re-fire
on every loadedModelIds change, overriding the user's manual model
selection. Guard with selectedModelId so auto-select only kicks in
when no model is chosen yet.

* chore: update webui build output

tools/server/public/index.html.gz
tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte

index 98e2e49431946d1ba182b0b8a619b8089f189ae1..0da8083b5039949833274c8bd4b729e59d33f529 100644 (file)
Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ
index 2ad830e18f8f04eb6ab83432d8d3455b74143107..b51dd682e053d283c6954437edc9d9b274b09722 100644 (file)
@@ -65,7 +65,8 @@
        $effect(() => {
                if (conversationModel) {
                        modelsStore.selectModelByName(conversationModel);
-               } else if (isRouter && modelsStore.loadedModelIds.length > 0) {
+               } else if (isRouter && !modelsStore.selectedModelId && modelsStore.loadedModelIds.length > 0) {
+                       // auto-select the first loaded model only when nothing is selected yet
                        const first = modelOptions().find((m) => modelsStore.loadedModelIds.includes(m.model));
                        if (first) modelsStore.selectModelById(first.id);
                }