diff options
Diffstat (limited to 'desktop/modules/assistant')
| -rw-r--r-- | desktop/modules/assistant/AssistantModule.qml | 13 | ||||
| -rw-r--r-- | desktop/modules/assistant/README.md | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/desktop/modules/assistant/AssistantModule.qml b/desktop/modules/assistant/AssistantModule.qml index a85b2b3..b53a33f 100644 --- a/desktop/modules/assistant/AssistantModule.qml +++ b/desktop/modules/assistant/AssistantModule.qml @@ -198,6 +198,19 @@ Module { else { poll.left = 300; poll.start(); } }); } + // Called when the assistant canvas opens: the preferred model, if one is + // set, still listed, and neither loaded nor loading, is loaded. One model + // and one client at a time is how this desktop runs, so opening the + // assistant is the moment to bring its model back. + function ensurePreferred() { + const id = Prefs.assistantModel; + if (id === "" || am.loading !== "") return; + am.listModels(() => { + const m = am.models.find(x => x.id === id); + if (m && m.status !== "loaded" && m.status !== "loading") am.loadModel(id); + }); + } + property Timer poll: Timer { property int left: 0 interval: 1000 diff --git a/desktop/modules/assistant/README.md b/desktop/modules/assistant/README.md index 07cc7ad..93b8507 100644 --- a/desktop/modules/assistant/README.md +++ b/desktop/modules/assistant/README.md @@ -19,6 +19,13 @@ 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. +Opening the assistant canvas (SUPER+Home) loads the preferred model when +another one is resident, and the canvas header reads "loading <model>…" +until it is in. This desktop runs one model and one client at a time, so +opening the assistant is when its model should come back; the daemon still +never asks for a model itself. With no preferred model set, nothing is +swapped. + The daemon reads all of this only at startup, so after a change the page says so and offers Restart, which runs `assistant.sh restart`; a daemon that does not come back shows the script's status, whose log tail says why. |
