]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ui: Prioritize favorite models in model selection (#24766)
authorMahdiou Diallo <redacted>
Mon, 22 Jun 2026 19:00:21 +0000 (21:00 +0200)
committerGitHub <redacted>
Mon, 22 Jun 2026 19:00:21 +0000 (21:00 +0200)
Updated model selection prioritization to include favorite models.

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

index 2ce450d4233b1cb11528ffb84e4d8902fd405389..87fb172d07be80776ee21b7d943c89a4eb81987b 100644 (file)
@@ -545,7 +545,8 @@ class ModelsStore {
         * 1. Model from active conversation's last assistant response (if loaded)
         * 2. Model from active conversation's last assistant response (if not loaded)
         * 3. First loaded model (not from active conversation)
-        * 4. First available model
+        * 4. A favorite model
+        * 5. First available model
         */
        async ensureFirstModelSelected(): Promise<void> {
                if (this.selectedModelName) return;
@@ -574,6 +575,13 @@ class ModelsStore {
                        return;
                }
 
+               // Try loading a favorite model
+               const favorite = this.favoriteModelIds.values().next()?.value
+               if (favorite) {
+                       await this.selectModelById(favorite);
+                       return;
+               }
+
                // Fall back to the first available model
                await this.selectModelById(availableModels[0].id);
        }