Repository navigation
fix(npu): make FastFlowLM models reachable on Ryzen AI PCs - #6341
Merged
Merged
Conversation
Ryzen AI users could not run FLM models from the Agent UI or TUI: the model lists offered none, and pasting a FastFlowLM Hugging Face link failed with "no GGUF files". Until its flm:npu backend is installed, Lemonade lists no FLM model and refuses to pull one by name, and only `gaia init --profile npu` installed it. A download of an FLM model now installs the backend first. Both lists offer Gemma 4 E4B and E2B on a PC with an NPU they fit, and a pasted FastFlowLM link resolves through that FastFlowLM release's model list to the Lemonade built-in. FLM models are judged against system RAM rather than the GPU pool, and capped at the NPU window, so a GPU profile no longer reloads one at 64K on every start.
A real agent turn on E2B shows its reply as raw JSON, because E2B still uses the embedded-JSON tool path, so the lists offer E4B alone. E2B's registry entry is unchanged, so the email agent keeps its behaviour, and its link can still be added. The backend install now sits in pull_model and pull_model_stream, so every pull path gets it and a failure reaches the progress stream. The TUI install is bound by ctx rather than the 45 second client, gaia init and setup judge an FLM model on system RAM, a failed Settings download can be retried, and an added FLM row stays removable on a PC without an NPU.
FLM models are judged on the NPU's system RAM now, so a fake PC that picks one has to report an NPU.
kovtcharov
marked this pull request as ready for review
November 1, 2026 19:13
Brings amd#5892 in and keeps what it does not cover: a pasted FastFlowLM link resolves to its built-in, and a download installs the NPU backend for anyone who has not re-run setup. FLM models no longer stop at a fixed 32K. E4B gets the smaller of its 128K maximum and what memory holds; on a real NPU it read a 79,233-token prompt at 128K. E2B stays at FastFlowLM's default on Automatic because it has no size on record, and offers up to 128K by hand. A size picked in Settings or set with GAIA_CTX_SIZE is no longer shrunk. Startup now asks an FLM chat model for its own window instead of the device profile's, which is what reloaded it on every start. The outgoing model is not reloaded at the incoming model's window.
Contributor
|
Verdict: Approve with suggestions I found no blocking problems. The FastFlowLM link lookup refuses loudly at every step. It checks for an NPU before fetching anything, validates the release tag before it goes into a URL, and drops model-list entries it can't trust. The backend install runs before both Python pull paths, the Settings download, and the TUI Three small suggestions:
🔍 Technical details
|
A first FLM download can spend minutes installing Lemonade's NPU backend, and the row sat at 0% with no explanation. Settings and the connection banner now show what it is waiting on.
3 of 4 tasks
2 of 4 tasks
kovtcharov-amd
added a commit
to huong8373tt-beep/gaia
that referenced
this pull request
Nov 3, 2026
Running Gemma-4-E4B on the Ryzen AI NPU through the agent evals turned up bugs that ended turns badly. Asked to total eight short regional reports, the agent summed only five, because search returned at most five chunks even when the whole index was smaller than that. A model reply with zero tokens ended the turn on "I received an empty response, please try again". This happens on about 1 in 250 NPU calls after a long prompt. Told to "Index <folder>", the model asked "Should I index it?". It also treated an instruction planted in a PDF as a possibly valid override, and gave in when pushed on a correct fact. Each case now recovers: a small index comes back whole, an empty reply or a needless permission question costs one bounded re-prompt, and the prompt names injection and fact-holding rules. Follows amd#6341, which made the FastFlowLM models reachable. - **Prompt changes reach every model, not just the NPU.** Duplicate rules were merged to pay for the new ones. The full profile is 11,925 chars on Linux, under its 12K budget (11,844 before). The GPU eval on the next RC covers `gaia_core`, `gaia_rag` and `tool_selection`. - **Results on the NPU (Gemma-4-E4B FLM, 128K window):** document Q&A went from 14/19 to 17/19 and core from 10/15 to 11/15 before the last round of fixes. The rerun on this branch is still going; results will be added here. ## Test plan - [x] `python -m pytest tests/unit hub/agents/gaia/python/tests` — passes, except three tests that need Playwright, which isn't installed on the test machine - [x] Prompt goldens recaptured against an empty `GAIA_CONFIG_FILE` (no local default model) - [ ] `gaia_rag` and `gaia_core` evals on the NPU on this branch's final commit - [ ] GPU eval on the next RC: `gaia_core`, `gaia_rag`, `tool_selection` --------- 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.
Pasting a FastFlowLM link failed with "has no GGUF files", a Download of an FLM model failed on any PC that had not run setup since #5892, and FLM models were stuck at a fixed context size. Now a pasted link resolves to the matching model or says where it already is, Download installs the NPU backend first, and an FLM model's window is the smaller of what the model supports and what memory holds, with a manual override that is no longer shrunk.
Measured on the NPU: Gemma 4 E4B read a 79,233-token prompt at a 128K window and answered from its first line. With 13.8 GB free it loaded at 96K on its own; with plenty free, at 128K.
Builds on #5892 and keeps its model list, feature tiers and native tool calls. Refs #5519, #5215.
🔍 Technical details
resolve_ctx_sizeand the FLM cap are gone;npu_ctx_ceilingis nownpu_default_ctx.size_gbon record because a size would add memory refusals for the email agent, so Automatic stays at FastFlowLM's 32K default. Settings offers it up to 128K, marked as unchecked against memory.ensure_readycompared a resident FLM model to the device profile's window. It now asks the model for its own window, and does not reload an outgoing model at the incoming model's window.src/model_list.jsonfrom the exact FastFlowLM release Lemonade reports, cached per release.Gemma4-E4B-IT-NPU2backs bothgemma4-it:e4band the single-turngemma4e-flash:e4b; single-turn, embedding and transcription builds are not chat models.pull_model,pull_model_stream, the Settings download and the TUI'sPull. The TUI row is now downloadable rather than a "rungaia init" dead end.custom_modelsentries may be a built-in*-FLMid as well asuser.*. An older build reading such a config rejects it until the entry is removed.is_tool_calling_modelreads an added model's saved flag, so a tool-less added GGUF model leaves the native tools path.tool_selectionandgaia_coreon the NPU when that baseline exists (feat(models): validate every model GAIA offers, then add NPU (FLM) builds like Gemma 4 E4B #5519).Test plan
python -m pytest tests/unit: 34,036 passed before the last 3 expectation fixes, which then pass. Remaining failures are not from this change: 10 needpypdfium2, missing here;test_chat_system_prompt_budgetfails on the base commit; onetest_lemonade_embeddedarchive test fails under parallel load and skips alone. 20 more failed only in the parallel run on a shared machine and pass when run alonecd tui && go test ./internal/...python util/lint.py --black --isort --flake8, and pylint on the changed Python files