Skip to content

Commit d65c4f2

Browse files
Fix model selector locked to first loaded model with multiple models (ggml-org#20580)
* 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
1 parent d8c331c commit d65c4f2

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

tools/server/public/index.html.gz

3 Bytes
Binary file not shown.

tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
$effect(() => {
6666
if (conversationModel) {
6767
modelsStore.selectModelByName(conversationModel);
68-
} else if (isRouter && modelsStore.loadedModelIds.length > 0) {
68+
} else if (isRouter && !modelsStore.selectedModelId && modelsStore.loadedModelIds.length > 0) {
69+
// auto-select the first loaded model only when nothing is selected yet
6970
const first = modelOptions().find((m) => modelsStore.loadedModelIds.includes(m.model));
7071
if (first) modelsStore.selectModelById(first.id);
7172
}

0 commit comments

Comments
 (0)