Skip to content

Commit 9c0ac88

Browse files
authored
ui: Prioritize favorite models in model selection (ggml-org#24766)
Updated model selection prioritization to include favorite models.
1 parent 721354f commit 9c0ac88

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tools/ui/src/lib/stores/models.svelte.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ class ModelsStore {
545545
* 1. Model from active conversation's last assistant response (if loaded)
546546
* 2. Model from active conversation's last assistant response (if not loaded)
547547
* 3. First loaded model (not from active conversation)
548-
* 4. First available model
548+
* 4. A favorite model
549+
* 5. First available model
549550
*/
550551
async ensureFirstModelSelected(): Promise<void> {
551552
if (this.selectedModelName) return;
@@ -574,6 +575,13 @@ class ModelsStore {
574575
return;
575576
}
576577

578+
// Try loading a favorite model
579+
const favorite = this.favoriteModelIds.values().next()?.value
580+
if (favorite) {
581+
await this.selectModelById(favorite);
582+
return;
583+
}
584+
577585
// Fall back to the first available model
578586
await this.selectModelById(availableModels[0].id);
579587
}

0 commit comments

Comments
 (0)