diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-17 10:59:22 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-17 10:59:28 +0200 |
| commit | 8e9d8b9ac1b593032dea9eca312fa1495c0c8858 (patch) | |
| tree | 9329824bc6a1d8e4f44da39e3722b4e2ea36c9f6 /desktop | |
| parent | ca3c66d882e60874b1cf4a1c5f9ea4232a593255 (diff) | |
| download | quickshell-8e9d8b9ac1b593032dea9eca312fa1495c0c8858.tar.gz quickshell-8e9d8b9ac1b593032dea9eca312fa1495c0c8858.zip | |
assistant: Load no longer changes the preferred model
Load set the preference as well as swapping the model in, so loading a
model from the settings page for any reason made it the assistant's
model too: after loading Qwen there, the canvas kept Qwen instead of
bringing the preferred Gemma back. Load and Prefer are now separate
buttons: Load swaps a model in now and leaves the preference alone, and
Prefer only records which model the canvas loads when it opens.
The canvas header also showed a stale model name after a swap; it now
takes the model from the daemon's ctx event, which carries it from
desktop-assistant f9d4644 on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop')
| -rw-r--r-- | desktop/assistant/Assistant.qml | 4 | ||||
| -rw-r--r-- | desktop/modules/assistant/AssistantModule.qml | 8 | ||||
| -rw-r--r-- | desktop/modules/assistant/AssistantPage.qml | 22 | ||||
| -rw-r--r-- | desktop/modules/assistant/README.md | 8 |
4 files changed, 27 insertions, 15 deletions
diff --git a/desktop/assistant/Assistant.qml b/desktop/assistant/Assistant.qml index 6692648..cc1d3d5 100644 --- a/desktop/assistant/Assistant.qml +++ b/desktop/assistant/Assistant.qml @@ -369,7 +369,9 @@ Scope { root.state = e.state; root.runningTool = e.state === "tool" ? e.tool : ""; break; - case "ctx": root.ctxUsed = e.used; root.ctxMax = e.max; break; + // ctx carries the model since the router can swap it after hello; an + // older daemon leaves it out, and the hello's name stands. + case "ctx": root.ctxUsed = e.used; root.ctxMax = e.max; if (e.model) root.model = e.model; break; case "conversations": root.convs = e.items; break; case "results": root.results = e.items; break; } diff --git a/desktop/modules/assistant/AssistantModule.qml b/desktop/modules/assistant/AssistantModule.qml index b53a33f..8253cc6 100644 --- a/desktop/modules/assistant/AssistantModule.qml +++ b/desktop/modules/assistant/AssistantModule.qml @@ -179,11 +179,11 @@ Module { } // The router keeps one model resident, so this swaps out whatever is - // loaded, for every client: it runs only on a click. The id becomes the - // preferred one, and the list is polled until the router reports it - // loaded, since the request may return before the load finishes. + // loaded, for every client. It does not touch the preferred model: a + // load from the page is for now, and the canvas brings the preferred one + // back when it opens. The list is polled until the router reports the + // model loaded, since the request may return before the load finishes. function loadModel(id) { - Prefs.setAssistantModel(id); am.modelError = ""; am.loading = id; am.run(["curl", "-s", "-m", "600", "-X", "POST", "-H", "Content-Type: application/json", diff --git a/desktop/modules/assistant/AssistantPage.qml b/desktop/modules/assistant/AssistantPage.qml index 2e40ed4..c6b63fc 100644 --- a/desktop/modules/assistant/AssistantPage.qml +++ b/desktop/modules/assistant/AssistantPage.qml @@ -165,8 +165,9 @@ Column { Small { width: page.width wrapMode: Text.Wrap - text: "The assistant answers with whichever model llama-server has loaded. Load makes one the " - + "preferred model and loads it now, which swaps out the loaded one for every client." + text: "The assistant answers with whichever model llama-server has loaded. Opening it loads " + + "the preferred model if another one is in. Load swaps a model in now, for every client, " + + "without changing the preference." } Small { @@ -211,13 +212,20 @@ Column { modelRow.preferred ? "preferred" : ""].filter(s => s).join(" · ") color: modelRow.preferred ? Theme.accent : Theme.subtext } + // Two separate choices: which model the assistant prefers, kept, + // and which one is loaded now, a swap for every client. Button { + id: loadBtn anchors { right: parent.right; rightMargin: 6; verticalCenter: parent.verticalCenter } - text: modelRow.loaded ? (modelRow.preferred ? "Loaded" : "Prefer") : "Load" - enabled: page.asst.loading === "" && !(modelRow.loaded && modelRow.preferred) - // A loaded model only becomes the preferred one: nothing to swap. - onClicked: modelRow.loaded ? Prefs.setAssistantModel(modelRow.modelData.id) - : page.asst.loadModel(modelRow.modelData.id) + text: "Load" + enabled: page.asst.loading === "" && !modelRow.loaded + onClicked: page.asst.loadModel(modelRow.modelData.id) + } + Button { + anchors { right: loadBtn.left; rightMargin: 6; verticalCenter: parent.verticalCenter } + text: modelRow.preferred ? "Preferred" : "Prefer" + enabled: !modelRow.preferred + onClicked: Prefs.setAssistantModel(modelRow.modelData.id) } } } diff --git a/desktop/modules/assistant/README.md b/desktop/modules/assistant/README.md index 93b8507..004ec05 100644 --- a/desktop/modules/assistant/README.md +++ b/desktop/modules/assistant/README.md @@ -15,9 +15,11 @@ to `<name>.toml.off`, which the daemon's `*.toml` glob skips. The page also lists llama-server's models with their state. The daemon always answers with whichever model is loaded and never asks for one, so it never swaps a model out from under another client. Load is the -deliberate swap: it saves that model as the preferred one (in `Prefs`) -and asks the router to load it now, polling `/v1/models` until it reports -`loaded`. Prefer marks the already-loaded model as preferred. +deliberate swap: it asks the router to load that model now, polling +`/v1/models` until it reports `loaded`, and leaves the preference alone. +Prefer is the other, separate choice: the model the assistant should use, +saved in `Prefs`. A first version made Load also set the preference, so a +model loaded for another client became the assistant's too. Opening the assistant canvas (SUPER+Home) loads the preferred model when another one is resident, and the canvas header reads "loading <model>…" |
