Skip to content

Fix model selector locked to first loaded model with multiple models#20580

Merged
allozaur merged 2 commits intoggml-org:masterfrom
ServeurpersoCom:webui/autoselect-model-new-conv-fix
Mar 16, 2026
Merged

Fix model selector locked to first loaded model with multiple models#20580
allozaur merged 2 commits intoggml-org:masterfrom
ServeurpersoCom:webui/autoselect-model-new-conv-fix

Conversation

@ServeurpersoCom
Copy link
Contributor

@ServeurpersoCom ServeurpersoCom commented Mar 15, 2026

Make sure to read the contributing guidelines before submitting a PR

Fix model selector locked to first loaded model with multiple models

auto-select

Fixes a regression from #20403 where, with multiple models loaded in
router mode, the user could not switch to any model other than the first
one.

The auto-select $effect in ChatFormActions was re-firing on every
loadedModelIds change (e.g. after fetchRouterModels completes),
overriding whatever the user had manually picked.

Fix: guard the else-if branch with !modelsStore.selectedModelId so
auto-select only kicks in when no model is chosen yet.

Close #20488

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.
@allozaur allozaur force-pushed the webui/autoselect-model-new-conv-fix branch from 0e63be4 to 7d755aa Compare March 16, 2026 11:02
@allozaur allozaur requested a review from a team as a code owner March 16, 2026 11:02
@allozaur allozaur merged commit d65c4f2 into ggml-org:master Mar 16, 2026
6 checks passed
Ethan-a2 pushed a commit to Ethan-a2/llama.cpp that referenced this pull request Mar 20, 2026
…gml-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: Server/WebUI: Model selector does not allow switching models

2 participants