Repository navigation
fix(ui): warm the model the user set as Custom model ID - #7271
Conversation
A custom model typed in Settings > Advanced was never seen by the flagship's start-up warm-up, which loaded the remembered model instead: the local Gemma on a cloud-only setup with no remembered model, or an older cloud pick when one was saved. The next launch then also restored that older pick over the custom model. Saving a custom model now makes it the remembered model, so start-up warms and restores the model chats run on. The sidecar warms resolve_chat_model() (last_model, then default_model, then Gemma) from config.json, while the custom model lived only in the Agent UI's database. PUT /api/settings now writes custom_model to last_model and last_provider the way the model menu does, clears both with it, and fails the save when config.json can't be written. Closes amd#7217
|
Verdict: Approve with suggestions Saving a model in Settings > Advanced > Custom model ID now also makes it the remembered model. Start-up warms that model, and the next launch restores it instead of an older pick. The fix is small, follows what the model menu already does, and fails the save with an error if the config file can't be written. The unit tests cover set, clear, omit and the write failure.
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on reading the code and the PR's unit tests. The settings save and the start-up warm-up were not run here. 🔍 Technical detailsIssues 🟡 No real-world evidence for a changed HTTP route ( 🟢 The settings path skips two things the model menu does ( 🟢 The PR body says Checked, no issue
Strengths
|
…estore notice Saving the Custom model ID now remembers it across launches, so it has to follow the model menu's rules: a cloud model is refused while Local only is on, and a pick made now clears a stale "couldn't restore" notice. Both routes share one helper for each.
|
Saving a Custom model ID now follows the same rules as the model menu: a cloud model is refused while Local only is on, and saving a model clears a stale "Couldn't restore your last model" notice. Both routes share one helper for each rule, so they can't drift apart.
Merged current |
A cloud model from a provider GAIA has no tab for, saved as Custom model ID, showed "Couldn't restore your last model ... no longer listed" at every start although the chip was right and the model answered. It now restores silently, and stays off with the Local only reason when Local only is on. The restore check looked for it in the local list, which leaves cloud entries out. A miss there now asks the model server's own list whether the id is a cloud model, through the same record the rest of the UI classifies by.
|
Round 2 of the release test found a regression from this fix: a cloud model from another cloud provider (one GAIA has no tab for), saved as Custom model ID, showed "Couldn't restore your last model … no longer listed" at every start, although the chip was right and the model answered. The new commit makes the start-up check ask the model server's own list before giving up, so that model restores silently. With Local only on it stays off, with the Local only reason. |
…d#7331) In rc18 a cloud-only user had a 5 GB local model downloaded and loaded without being asked: by the start-up warm-up, by Memory > Run Inference, and by a scheduled run. Each bug fired only from one starting state, and every existing test started from a PC that was already set up, with the client mocked. This adds a matrix that crosses five starting states with three entry points, runs each against the installer journeys' stand-in Lemonade over real HTTP, and asserts what actually reached that server. A new starting state or entry point is one row; every combination is then covered, and a combination with no rule is an error. | | start-up warm-up | Memory > Run Inference | scheduled run | |---|---|---|---| | cloud model as `default_model` | ✅ | ✅ | ✅ | | cloud model picked in the app | ✅ | ✅ (amd#7270) | ❌ **new: amd#7329** | | cloud model as Custom model ID | ✅ (amd#7271) | ✅ | ❌ **new: amd#7329** | | empty cache | ✅ | ✅ (amd#7270) | not asserted | | local model on disk (control) | ✅ | ✅ | ✅ | The two ❌ cells are strict expected failures naming the issue, so the fix has to delete its line. Three more cells failed when this PR opened (amd#7217, amd#7218); their fixes, amd#7270 and amd#7271, merged since, the strict markers tripped as designed, and those lines are gone. **New bug it found:** amd#7184 made `gaia schedule run` honour `default_model`, but a cloud model picked in the desktop app is saved elsewhere, so a scheduled run for that user still loads (and downloads) local Gemma. Filed as amd#7329. ## Test plan - [ ] `python -m pytest tests/unit/test_starting_state_matrix.py -q` reports 14 passed, 2 xfailed - [ ] Delete a line from `KNOWN_BUGS` and the failure prints the requests the server saw, ending in `POST /api/v1/load Gemma-4-E4B-it-GGUF` - [ ] Runs in the unit job; the warm-up column needs the flagship package, so it skips there and runs in `test_gaia_agent.yml`, which now names this file <details> <summary>🔍 Technical details</summary> - `tests/fixtures/fake_lemonade.py` starts `installer/headless/fake_model_server.py` (the server the setup and installer journeys already use) and reads its request log into `pulls`, `loads`, `chats` and `downloads`. No second fake server. A load or chat asked of a model that is not downloaded counts as a download, because real Lemonade fetches it by itself. - The matrix pins installed memory to 128 GB, because the warm-up is skipped on a small PC and a CI runner would hide the bug, and stubs the PC scan so profile inference never reads the machine it runs on. - Not covered here: what the setup and model screens *say* from these states (F1, F6, F43). Those are assertions on API payloads, not on server requests. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
A custom model typed in Settings > Advanced was never seen by the flagship's
start-up warm-up, which loaded the remembered model instead: the local Gemma
on a cloud-only setup with no remembered model, or an older cloud pick when
one was saved. The next launch then also restored that older pick over the
custom model. Saving a custom model now makes it the remembered model, so
start-up warms and restores the model chats run on.
The sidecar warms resolve_chat_model() (last_model, then default_model, then
Gemma) from config.json, while the custom model lived only in the Agent UI's
database. PUT /api/settings now writes custom_model to last_model and
last_provider the way the model menu does, clears both with it, and fails the
save when config.json can't be written.
Closes #7217
Test plan
python -m pytest tests/unit/chat/ui(3534 pass; 2 new tests fail on main) and the flagship warm-up tests