Repository navigation
fix(ui): list chat models that are also labeled audio in the model picker - #5140
Merged
Merged
Conversation
…cker FLM models on the NPU carry both the chat and audio labels, so the Agent UI's local model picker dropped them as non-chat models. A chat label now wins, matching the rule the flagship agent's /model switch already uses. Closes #5136
1 of 3 tasks
Contributor
This was referenced Oct 16, 2026
kovtcharov-amd
marked this pull request as ready for review
October 17, 2026 04:11
kovtcharov-amd
added a commit
to kovtcharov/gaia
that referenced
this pull request
Oct 19, 2026
The Agent UI's model picker offered a CPU/GPU/NPU switch no model can honour, went silently dead while GAIA was answering, named Gemma as the active model on PCs whose default is something else, and showed raw GGUF file names. Now each model shows where it really runs (Lemonade's report once loaded, with a plain warning if a GPU model fell back to the CPU), only models this PC can run are offered, a pick made mid-reply applies to the next message, and the chip names the model a new chat actually starts on. Settings › Model adds friendly names, a "Fits this PC" badge, download size and speed measured here, plus a Context size choice up to the most that fits. The sidebar's "Local · model" pill now opens a live status: loaded / warming / stopped, device, memory used vs free, context window, and Restart. Lands after v0.25.0. Closes amd#5214 Closes amd#5209 Closes amd#5213 Closes amd#4823 Closes amd#5253 - **Context size is saved per model** (`context_sizes` in `~/.gaia/config.json`) and used on every load, including the reload after an idle unload. A saved size that no longer fits is refused at load, with how to fix it (`GAIA_CTX_SIZE` still overrides it). Changing it, like Restart, reloads through GAIA's normal load path with its free-memory check, and never under a reply that is still running. It replaces the 4K–32K presets in Settings › Advanced. - **On a Lemonade you run yourself** ("Use mine"), Restart asks before reloading your model and never starts your server, and a context-size change never reloads there (amd#5253). The chip says Local as soon as setup finishes, and the popover's used + free memory adds up to the pool setup reports. - **Not in this PR:** the TUI doesn't expose the context-size setting yet (amd#5213 allows a follow-up issue for it), and the gateway is shown only once Lemonade has it registered, without probing whether the enterprise network can reach it. ## Screenshots From the running app on a Strix Halo (fresh GAIA home on an existing Lemonade, so no personal chats are shown). | Settings › Model | Composer model picker | |---|---| | <img src="https://raw.githubusercontent.com/kovtcharov/gaia/pr-5244-screenshots/settings-model.png" width="420"> | <img src="https://raw.githubusercontent.com/kovtcharov/gaia/pr-5244-screenshots/chip-picker.png" width="180"> | | Status popover: Restart on your own Lemonade | Status popover: server stopped | Chip before the first chat | |---|---|---| | <img src="https://raw.githubusercontent.com/kovtcharov/gaia/pr-5244-screenshots/restart-confirm-own-lemonade.png" width="220"> | <img src="https://raw.githubusercontent.com/kovtcharov/gaia/pr-5244-screenshots/status-popover-stopped.png" width="200"> | <img src="https://raw.githubusercontent.com/kovtcharov/gaia/pr-5244-screenshots/chip-local-before-first-chat.png" width="155"> | ## Test plan - [x] `python -m pytest tests/unit/test_model_device_and_context.py tests/unit/chat/ui/test_model_picker_routes.py tests/unit/chat/ui/test_providers_router.py` - [x] `python -m pytest tests/unit/` (full suite) - [x] `npx vitest run` and `npx tsc --noEmit` in `src/gaia/apps/webui` - [x] `python util/lint.py --all` - [x] Running app on a Strix Halo, with this branch's backend serving its own build: Settings › Model (device per model, fit, size, no device switch), the composer chip (friendly names, loaded dot / Ready / download, "Add your key" for Fireworks), and the sidebar popover loaded and stopped - [x] Fresh GAIA home on an already-running Lemonade ("Use mine"): the chip says Local before the first chat, Restart shows the confirmation and reloads nothing until confirmed, memory reads 8.3 GB used · 55.7 GB free of 64 GB - [ ] Restart confirmed against a live Lemonade (covered by unit tests; not pressed live because another session was using the shared server) - [ ] On a PC without an NPU, FLM models appear under "Not available on this PC" (needs a PC without an NPU; covered by pytest from recorded `/system-info` bodies and by vitest) - [ ] Pick a model while GAIA is answering; the next message runs on it (covered by vitest, queue then apply on reply end; not run live, since a live reply would hold the Lemonade other test sessions share) <details> <summary>🔍 Technical details</summary> - Device: `gaia.llm.model_device` reads `/health` `all_models_loaded[].device` plus the llama-server path for a loaded model, and the recipe (`llamacpp` → GPU via the default or chosen backend, `flm` → NPU) before load. `default_device` no longer comes from the UI; the NPU context cap already follows the model (`runs_on_npu`). - Availability: recipe backends with no usable state in `/system-info`, or `model_fit.check_fit` against the model's size at its floor window. A loaded model is never hidden. - Context: `gaia.llm.context_choice` builds options from `min_ctx_size` to `largest_context`; `resolve_ctx_size` takes a saved size through `_chosen_ctx_size` and skips the free-memory shrink for it (the load's own free-memory check still refuses). - Speed: each turn's stored `inference_stats` now carries `model`; the list reports the median tokens/s over that model's last 20 turns. - New routes: `GET/PUT /api/providers/local/context`, `GET /api/providers/local/status`, `POST /api/providers/local/restart`. Builds on amd#5140's `_is_chat_model` without touching it. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The Agent UI's local model picker hid installed FLM models, so NPU users couldn't select one. Lemonade labels these models both
chatandaudio, and the picker treated anyaudiolabel as "not a chat model." Now achatlabel wins, so FLM models appear; models labeled only audio, transcription, embeddings, or TTS stay hidden. The flagship agent's/modelswitch already used this rule. Fix suggested by @LcoGarcia in the issue.Closes #5136
Test plan
python -m pytest tests/unit/chat/ui/test_providers_router.pypasses; the new test fails on the old filter and also pins that pure audio, Whisper, embedding and TTS models stay outpython util/lint.py --black --isortpassesgemma4-it-e2b-FLM), the Agent UI model picker lists it and it can be selected🔍 Technical details
_is_chat_modelinsrc/gaia/ui/routers/providers.pynow matches_is_chat_targetinhub/agents/gaia/python/gaia_agent/stdio.py.