Skip to content

fix(ui): list chat models that are also labeled audio in the model picker - #5140

Merged
kovtcharov-amd merged 3 commits into
mainfrom
autofix/issue-5136
Oct 17, 2026
Merged

kovtcharov-amd merged 3 commits into
mainfrom
autofix/issue-5136

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The Agent UI's local model picker hid installed FLM models, so NPU users couldn't select one. Lemonade labels these models both chat and audio, and the picker treated any audio label as "not a chat model." Now a chat label wins, so FLM models appear; models labeled only audio, transcription, embeddings, or TTS stay hidden. The flagship agent's /model switch 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.py passes; the new test fails on the old filter and also pins that pure audio, Whisper, embedding and TTS models stay out
  • python util/lint.py --black --isort passes
  • On a Ryzen AI machine with an FLM model downloaded (e.g. gemma4-it-e2b-FLM), the Agent UI model picker lists it and it can be selected
🔍 Technical details
  • _is_chat_model in src/gaia/ui/routers/providers.py now matches _is_chat_target in hub/agents/gaia/python/gaia_agent/stdio.py.
  • Filtering the picker by device (NPU vs GPU), raised in the issue thread, is a separate feature and not part of this fix.

…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
@LcoGarcia

Copy link
Copy Markdown
Contributor
image

Currently have the Gaia Desktop open, I can see the other models (I had implemented the suggested fix on my end too).

One thing I must add though:

image

Selecting where to run the model should filter the model options based on where they run.

For example, I have NPU selected in the image, so the GGUF options shouldn't show up at all. When I select GPU, the FLM options shouldn't show up at all either.

I don't have a suggested adjustment for this. One possible way could be to attach the respective backend of each model, and depending on the backend's capabilities (CPU, GPU, NPU), that could already act as some sort of filter to lower the amount of listed models when we have a specific hardware selected (I don't need GPU models listed when I want NPU).

If you can figure out a way to get even better filtering PER model rather than per backend, that'd be nice too.

I was on my way to do a PR, but you beat me to it. If you could mention me in the fixes so I may have the contribution, I'd be happy. If not, well, I'll be sad, but it is what it is. I'm only referring to the providers.py change, I can't really claim a contribution about the latter suggestion of CPU/GPU/NPU filtering because all I'm providing is the idea.

@kovtcharov-amd
kovtcharov-amd marked this pull request as ready for review October 17, 2026 04:11
@kovtcharov-amd
kovtcharov-amd self-requested a review as a code owner October 17, 2026 04:11
@github-actions github-actions Bot added the tests Test changes label Oct 17, 2026
@kovtcharov-amd
kovtcharov-amd merged commit a4c2e3e into main Oct 17, 2026
66 of 69 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the autofix/issue-5136 branch October 17, 2026 05:45
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][ImprovementSuggestion]: Local model picker hides chat-capable FLM models tagged with audio

2 participants