diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-17 10:50:09 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-17 10:50:09 +0200 |
| commit | 885d65a2bbcde0e8e5094ae4589647875ee5838d (patch) | |
| tree | ca0397836bdc61085641410eebdb166b97d0999e /desktop/Prefs.qml | |
| parent | 166d638bce081631705687501020725045920e50 (diff) | |
| download | quickshell-885d65a2bbcde0e8e5094ae4589647875ee5838d.tar.gz quickshell-885d65a2bbcde0e8e5094ae4589647875ee5838d.zip | |
assistant: pick the preferred model, loaded on demand
The daemon answers with whichever model llama-server has loaded and
never asks for one, so it never evicts a model another client is using.
The Assistant settings page now lists the router's models with their
state. Load saves one as the preferred model, in Prefs, and asks the
router to load it now, polling /v1/models until it reports loaded;
Prefer marks the loaded model as preferred without swapping. The swap
happens only on that click, so the daemon's rule holds.
AGENTS.md records the router's load endpoint and its two refusals, both
measured: it lives on the server root, not under /v1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Prefs.qml')
| -rw-r--r-- | desktop/Prefs.qml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml index 9f89a7f..ba567c4 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -35,6 +35,16 @@ Singleton { // (assistant/Presets.js, which also validates what is read here). property var presets: null + // The router model preferred for the assistant, "" for none. The daemon + // still uses whatever is loaded; the settings page loads this on demand. + property string assistantModel: "" + function setAssistantModel(id) { + if (id === root.assistantModel) return; + root.assistantModel = id; + const a = Object.assign({}, root.doc.assistant, { model: id }); + root.write(Object.assign({}, root.doc, { assistant: a })); + } + // The settings window's sidebar width, dragged by its edge. readonly property int sidebarMin: 160 readonly property int sidebarMax: 420 @@ -88,6 +98,8 @@ Singleton { if (pin !== root.pinnedIp) root.pinnedIp = pin; root.presets = parsed.assistant && parsed.assistant.presets !== undefined ? parsed.assistant.presets : null; + root.assistantModel = parsed.assistant && typeof parsed.assistant.model === "string" + ? parsed.assistant.model : ""; const w = parsed.settings ? parsed.settings.sidebar : undefined; root.settingsSidebar = typeof w === "number" && w >= root.sidebarMin && w <= root.sidebarMax ? Math.round(w) : 200; @@ -105,6 +117,6 @@ Singleton { onFileChanged: reload() onLoaded: root.reparse() // Missing file: the defaults, and nothing written. - onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; } + onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; } } } |
