Repository navigation
fix(llm): run local Qwen models with their model card's sampling - #4655
Conversation
Qwen3 30B looped on repeated tool calls under the near-greedy sampling GAIA forced on every local model (temperature 0.1 plus frequency and repeat penalties); its card warns against exactly that. A model whose card publishes sampling now runs with it, picked per thinking mode from the request's enable_thinking switch, so the two cannot disagree. - Qwen3-30B-A3B-Instruct-2507-GGUF: temperature 0.7, top_p 0.8, top_k 20, min_p 0, presence_penalty 1.0. - Qwen3.6-35B-A3B-GGUF (and -MTP): thinks by default, so it gets the card's thinking coding/precise profile; instruct when thinking is off. - Every other local model, Gemma included, keeps the old profile; the request body is asserted unchanged. Explicit caller kwargs still win.
|
Verdict: Approve with suggestions. Merge only after the two eval runs in the test plan are done. Local Qwen models now run with the sampling settings their model cards publish, replacing the near-greedy profile that made Qwen3-30B repeat the same tool calls. Gemma and every other local model still get exactly the same settings as before, and a test checks the full request body. The change is small, every value traces to a source, and anything the caller passes still overrides the defaults.
Real-world evidenceN/A: no evidence bundle was produced. This change sits inside the LLM client and has no CLI, REST or UI surface to call on a runner without inference. The verdict rests on static review. The proof that matters is the 🔍 Technical detailsIssues
Strengths
|
…s it (amd#4479) **Contains amd#4655 — merge that first, or merge this one alone with it.** Its per-model card sampling is what Qwen3.6 runs with here. On a PC whose GPU holds it, GAIA's local default was Qwen3 30B A3B Instruct 2507. On our CI task suite it looped and reported tests passing when it had not run them: on the 2026-10-03 nightly, everyday 7/14, therock 0/4, and 4 false "tests pass" claims. This makes **Qwen3.6 35B A3B** the default instead. It is the newest ~30B-class MoE Lemonade ships built in (3B active, vision), scoring 73.4 on SWE-bench Verified and 51.5 on Terminal-Bench 2.0. Who gets it is unchanged: a 64 GB+ Strix Halo or a 32 GB GPU. A 24 GB card or a CPU-only PC keeps Gemma 4 E4B. **Merge is gated on evals, not on this description:** - A `eval_flagship.yml` dispatch with `task_suite: everyday therock` on this branch must beat the 2026-10-03 nightly above, with fewer false "tests pass" claims. The PR-triggered outcomes job skips fork PRs, so the branch has to be dispatched from `amd/gaia`. - The scenario lanes must show no regression on a qualifying (128 GB Strix Halo) runner, where the default actually changes. No flagship baseline is committed yet, so compare against a `main` run on the same pool under the same agent. Don't use an estimated number. - **Thinking is on, and GAIA sets it explicitly.** Every request sends `chat_template_kwargs.enable_thinking`, and amd#4655's sampling reads the same resolver, so the mode and the sampling can't drift apart. The published benchmark scores are thinking-mode scores, and quality is what failed. The cost is latency: each agent step spends reasoning tokens first, at roughly 53 tok/s decode on Strix Halo (ROCm figure; GAIA's Vulkan build is unmeasured). The tab-title call turns thinking off, so its 24 tokens aren't spent reasoning. If the eval shows steps are too slow, the fix is one field (`thinking=False`). - **Plain GGUF, not the `-MTP` build.** Lemonade's `mtp` label turns on llama.cpp MTP drafting by itself, but the only Strix Halo measurement is ROCm on a pre-merge llama.cpp build (53 to 69 tok/s, 1.4x). GAIA runs Lemonade's Vulkan llama.cpp, where it is unproven. `python util/compare_local_models.py --models Qwen3.6-35B-A3B-GGUF Qwen3.6-35B-A3B-MTP-GGUF` measures it on the box. - **Gemma is still downloaded for vision.** Qwen3.6 has vision too, but the VLM and document-image extraction paths load Gemma by name and haven't been evaluated on Qwen3.6. Routing them to the resident model would save a ~6 GB download and a model swap; that belongs in a follow-up with its own eval. <details> <summary>🔍 Technical details</summary> - **Fit:** `23.3 × 1.05 + 1.0 + 1.3 ≈ 26.8 GB`. KV is 10 full-attention layers × 2 KV heads × 256 dims × K+V × f16 = 20 KiB/token, which is 1.34 GB at 65,536 tokens. The 30 Gated DeltaNet layers hold a fixed ~60 MB state that the shared margin covers. - **Built-in, so it's pulled by name only (amd#1655).** It has been in Lemonade's catalog since v11.7.0, which is now its `min_lemonade_version`; an older or unknown server keeps Gemma and is told to upgrade. GAIA pins 2026.40.0, so no version bump. - `TASK_MODEL` in `eval_flagship.yml` now names Qwen3.6. No expectations are committed for any model, so the outcomes gate still only reports. - Earlier review points are already addressed on this branch: KV charged in the fit rule, `user.` models registered on any pull, the config-table row, and the docstrings. </details> ## Test plan - [x] `pytest tests/unit/test_model_fit.py tests/unit/test_lemonade_cloud_models.py tests/unit/test_init_command.py tests/unit/chat/ui/test_chat_helpers.py tests/test_lemonade_client.py` (+ preflight, warm-up, embedder, compare, hub stdio): 576 passed. Six `test_lemonade_client` mock tests fail identically without this change (an unmocked `/load`), and the integration tests need a live Lemonade. - [x] Fit tiers: 128 GB and 64 GB Strix Halo and a 32 GB GPU get Qwen3.6; a 24 GB GPU and CPU-only get Gemma. Lemonade 11.6.0 or an unknown version keeps Gemma. - [x] Pull is exactly `{"model_name": "Qwen3.6-35B-A3B-GGUF", "stream": true}`, with no recipe or checkpoint. - [x] The thinking switch and amd#4655's sampling are asserted on the wire together, streaming and not, including when the default is flipped to non-thinking. - [x] `go test ./...` and `go vet ./...` in `tui/`, including the new fit-tier test; black, isort and flake8 are clean on the changed files. - [ ] `eval_flagship.yml` dispatch, `task_suite: everyday therock`, beats the 2026-10-03 nightly (7/14, 0/4, 4 false claims). - [ ] Scenario lanes on a 128 GB Strix Halo runner: no regression against a same-pool `main` run. - [ ] Cold `gaia init --profile gaia` on a 128 GB Strix Halo downloads Qwen3.6 and records it as `default_model`. --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
# GAIA v0.25.0 Release Notes ## Breaking Changes - **`gaia chat` runs the flagship GAIA agent**, the same agent as the TUI and Agent UI, instead of the retired ChatAgent. `gaia chat -q "…"` queries it once. (PR [amd#4520](amd#4520)) - **`gaia talk` transcribes and speaks through Lemonade** — it uses Lemonade's Whisper and `kokoro-v1`, and stops with the reason if Lemonade is down. The `[audio]` extra is gone; `pip install amd-gaia[audio]` only warns. (PR [amd#4665](amd#4665)) - **The Agent UI runs only the GAIA agent** — the Agent Hub home, agent picker, and custom-agent export/import are removed from the UI. The CLI and eval harness can still run other agents. (PR [amd#4509](amd#4509)) - **The retired nomic embedder is removed** — memory saved with it is re-embedded on first start. (PR [amd#4489](amd#4489)) - **Indexed documents are re-indexed once** — the document cache is now keyed on chunking settings, so the first query after upgrading rebuilds it. (PR [amd#4624](amd#4624)) - **A skill that asks for more than its tier allows no longer loads** — the permission ceiling is checked at every load, so a skill already on disk that exceeds it is refused with the reason. (PR [amd#4849](amd#4849)) ## What's New - **A larger local model where the GPU holds it** — `gaia init` picks Qwen3.6-35B-A3B on a 64 GB+ Strix Halo or a 32 GB GPU and keeps Gemma-4-E4B elsewhere, with each context window sized to available memory. Qwen3.8 Flash Next is opt-in on 128 GB Strix Halo. (PRs [amd#4479](amd#4479), [amd#4670](amd#4670), [amd#4671](amd#4671), [amd#4658](amd#4658), [amd#4655](amd#4655)) - **The Agent UI opens straight to a chat and sets itself up** — a fresh install runs the same setup steps as the TUI in the window, with provider, key and model settings, permission modes, and revocable "always allow" grants. (PR [amd#4509](amd#4509)) - **A much smaller install** — PyTorch, transformers and accelerate are gone from the core, `[ui]` and `[talk]` installs; the desktop app's Python environment drops from ~0.9 GB to ~0.1 GB on Windows. (PRs [amd#4666](amd#4666), [amd#4621](amd#4621), [amd#4665](amd#4665)) - **One Windows installer for the desktop app and the terminal**, with a GAIA Windows Terminal profile. (PRs [amd#4720](amd#4720), [amd#4707](amd#4707)) - **A "no" holds** — a declined action isn't retried through another tool; the agent asks again with the exact command. The TUI gains Shift+Tab permission modes. (PRs [amd#4460](amd#4460), [amd#4461](amd#4461)) - **Answers are checked against what the tools actually did** — the agent looks at files you name before answering about them, and a short plain-English note appears only when work isn't confirmed. (PRs [amd#4532](amd#4532), [amd#4501](amd#4501), [amd#4508](amd#4508)) - **One shell session** — commands share a persistent shell, risky ones ask instead of being refused, and "full access" is one setting everywhere. (PR [amd#4408](amd#4408)) - **Memory surfaces what's relevant to each request, with its age**, keeps what fixed a failure as a lesson for that workspace, and extracts after the answer instead of before it. (PRs [amd#4061](amd#4061), [amd#4066](amd#4066), [amd#4406](amd#4406)) - **`gaia.log` stays bounded** — it rotates at 10 MB with three backups (`GAIA_LOG_MAX_MB`, `GAIA_LOG_BACKUPS`). (PRs [amd#4668](amd#4668), [amd#4760](amd#4760)) - **Child processes get a trimmed environment** — shell, MCP and skill children no longer inherit GAIA's internal credentials; `GAIA_NO_DOTENV` skips loading `.env`. (PRs [amd#4635](amd#4635), [amd#4659](amd#4659)) - **Every file tool checks the allowed-folders rule**, and paths inside an inline shell script are checked one by one. (PRs [amd#4656](amd#4656), [amd#4758](amd#4758)) ## Bug Fixes A selection of the user-visible fixes; the full list is in the changelog below. - **Local Qwen models no longer loop on repeated tool calls** — they run with their model card's sampling instead of near-greedy settings. (PR [amd#4655](amd#4655)) - **Qwen3.6 runs on a Strix Halo with an older AMD driver** — it used to crash on its first token, so `gaia init` failed; GAIA now turns off the Vulkan path that crashes on those drivers only, and newer drivers keep the faster path. (PR [amd#4674](amd#4674)) - **A long PDF no longer hangs or times out while indexing** — big documents index in the background, and PDFs that only carry owner-password restrictions now index. (PRs [amd#4754](amd#4754), [amd#4679](amd#4679), [amd#4734](amd#4734)) - **Document answers cite the right document and page**, and every chunk is embedded whole instead of its first 1,200 characters. (PRs [amd#4688](amd#4688), [amd#4723](amd#4723)) - **`gaia init` fails when model verification fails**, shows downloads live, and no longer hangs while Lemonade hashes a large model. (PRs [amd#4620](amd#4620), [amd#4564](amd#4564), [amd#4673](amd#4673)) - **`gaia init` adds a profile's extras without reinstalling GAIA**, which failed on Windows while `gaia.exe` was running. (PR [amd#4672](amd#4672)) - **Every SDK and CLI entry point starts GAIA's own Lemonade**, and every call goes to the resolved URL with its API key. (PRs [amd#4657](amd#4657), [amd#4627](amd#4627)) - **Local chat stays cached across turns** — the system prompt is fixed and side requests no longer evict the conversation. (PRs [amd#4698](amd#4698), [amd#4543](amd#4543)) - **A cloud model selection never preloads a local model**, and cloud models no longer get llama.cpp-only fields. (PRs [amd#4757](amd#4757), [amd#4709](amd#4709)) - **The Agent UI stops claiming "100% local" while chat goes to a cloud model**, and the chat header names the session's real model. (PRs [amd#4711](amd#4711), [amd#4550](amd#4550)) - **Enter can't approve a permission prompt**, and prompts wait 10 minutes before timing out. (PRs [amd#4700](amd#4700), [amd#4699](amd#4699)) - **Stopping a run keeps the turn and its steps visible.** (PR [amd#4743](amd#4743)) - **A file edit keeps the file's line endings** — a one-line edit on Windows used to rewrite every line ending, so a small change showed up as the whole file changed. (PR [amd#4864](amd#4864)) - **A broken agent install is reported as broken, not as missing** — the error names both package versions and the real import error, and suggests a reinstall that works. (PR [amd#4588](amd#4588)) - **A meeting or document summary is never cut off mid-sentence** — a thinking model used to spend the summary's output budget reasoning, so a long meeting lost its second half. (PR [amd#4827](amd#4827)) - **"What can you do?" gets an answer** instead of an attempt to generate an image of the question. (PR [amd#4809](amd#4809)) - **Writes and approved edits can't reach credential folders** (`~/.ssh`, `~/.aws`, `~/.kube` and others), and shell option values and script arguments get the same path check as plain paths. (PRs [amd#4848](amd#4848), [amd#4847](amd#4847)) - **`gaia connectors connect google --grant-agent installed:gaia` works** — it used to fail with no sign-in link for the shipped agent; it now asks for read-only Gmail and grants exactly that. (PR [amd#4859](amd#4859)) - **A "no" to creating a folder also covers writing into it** — GAIA no longer asks again to create the same folder a different way. (PR [amd#4857](amd#4857)) - **`gaia skill import` runs the same checks as a hub install** — https only, the audit, the permission ceiling, and an explicit opt-in for skills that ship code. (PR [amd#4849](amd#4849)) - **Memory off and private chats apply to scheduled and background runs too.** (PRs [amd#4842](amd#4842), [amd#4821](amd#4821)) - **Memory stops false apologies and reusing deleted values**, saves "remember this" requests, and skips loading the embedder when memory is off. (PRs [amd#4708](amd#4708), [amd#4756](amd#4756)) - **A reply cut off by the token limit is continued** instead of ending mid-sentence, and a tool call cut off at the output cap is retried shorter. (PRs [amd#4054](amd#4054), [amd#4556](amd#4556)) - **The TUI remembers the chosen model** across restarts and agent-process restarts. (PRs [amd#4497](amd#4497), [amd#4710](amd#4710)) - **`gaia uninstall --purge` removes installer binaries, PATH edits and daemon state.** (PR [amd#4413](amd#4413)) ## Contributors Thanks to the community members who contributed to this release: - [@itomek](https://github.com/itomek) — the flagship's browser and tool picker, one shell session, memory extraction off the answer path, stale tool-result eviction, the TUI's sourced Fireworks rankings, and `--purge` cleanup (PRs [amd#4407](amd#4407), [amd#4408](amd#4408), [amd#4406](amd#4406), [amd#4465](amd#4465), [amd#4414](amd#4414), [amd#4413](amd#4413)) - [@mikemikimike](https://github.com/mikemikimike) — chained shell command timeouts, bundled skills in frozen builds, and sidecar cleanup reporting (PRs [amd#4463](amd#4463), [amd#4467](amd#4467), [amd#4419](amd#4419)) - [@Hashim1999164](https://github.com/Hashim1999164) — honoring `GAIA_HOME` for cache, chat and index paths (PR [amd#4381](amd#4381)) - [@krtadev](https://github.com/krtadev) — `~` expansion in file and document tool paths (PR [amd#4576](amd#4576)) - [@aksh8b](https://github.com/aksh8b) — telling a broken agent install apart from a missing one, with a reinstall hint that works (PR [amd#4588](amd#4588)) - [@Dev-next-gen](https://github.com/Dev-next-gen) — numeric prerelease ordering in the hub (PR [amd#4517](amd#4517)) - [@vianmangal](https://github.com/vianmangal) — recording denied tool calls as unsuccessful in memory (PR [amd#4412](amd#4412)) - [@GaetanVDB07](https://github.com/GaetanVDB07) — links to upstream credential setup guides for connectors (PR [amd#4669](amd#4669)) - [@rradjabi](https://github.com/rradjabi) — moving self-hosted CI jobs to the xsj-dispatch runner pool (PR [amd#4534](amd#4534)) ## Also in this PR - **Hub floors raised to core 0.25.0** — the chat agent imports the allowed-folders check that only 0.25.0 ships (amd#4656), so `gaia-agent-chat` goes to 0.2.0 with `amd-gaia>=0.25.0`, and the flagship requires `amd-gaia>=0.25.0` and `gaia-agent-chat>=0.2.0`. - **Two follow-ups held back until that floor could rise** — `~/.gaia/logs/gaia-agent.log` now rotates like `gaia.log` (amd#4668), and the chat agent's Python runners and Windows notification start their children without GAIA's internal credentials (amd#4659). The full changelog (300 commits) is in `docs/releases/v0.25.0.mdx`. ## Test plan - [x] `util/validate_release_notes.py docs/releases/v0.25.0.mdx --tag v0.25.0` passes; narrative is 590 words (cap 600) - [x] `util/check_component_core_api.py --release-version 0.25.0` passes - [x] `pytest tests/unit/test_docs_json_release.py tests/unit/test_check_component_core_api.py hub/agents/chat/python/tests/test_chat_dependency_floor.py hub/agents/chat/python/tests/test_dependency_floor.py hub/agents/gaia/python/tests/test_gen_binaries_lock.py` (72 passed) - [x] `pytest hub/agents/gaia/python/tests/test_stdio.py` (91 passed, incl. the new rotation test); `pytest tests/unit/test_execute_python_file_cwd.py tests/unit/test_run_python_tool.py` (42 passed) - [ ] `mintlify validate` (docs CI job) — timed out locally, relying on CI - [x] Full flagship eval on main 9ce6598 (https://github.com/amd/gaia/actions/runs/37436249503): 181/308 scenarios pass vs 100/183 for the same categories in the baseline, 39 FAIL→PASS, 13 PASS→FAIL (two fixed in amd#4878, held until after rc1); retrieval lane still finishing at merge time - [ ] CI green ## Release checklist - [ ] Publish `gaia-agent-chat` 0.2.0 only after core 0.25.0 is on PyPI — it fails at import on an older core - [ ] Build Installers on the merged SHA (pre-tag verification) before pushing `v0.25.0` - [ ] terminal-hub 0.25.0 published before the flagship npm release consumes `binaries.lock.json` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
Qwen3 30B looped on repeated tool calls in the CI outcomes suite: the same search and file read 15 times until timeout, runs that stalled without edits, and runs that ended in prose. GAIA was forcing near-greedy sampling (temperature 0.1 plus frequency and repeat penalties) on every local model. Qwen's own card warns against greedy decoding because it causes endless repetition. Qwen models now run with the settings Qwen publishes for them. Gemma and every other local model keep the old profile byte for byte, so the committed baseline still holds.
enable_thinkingswitch, so a caller that turns thinking off gets the card's instruct profile instead. Sampling and mode cannot disagree.🔍 Technical details
MODEL_SAMPLING_PROFILES(lemonade_client.py), keyed by model id. They are kept apart fromMODELS, because an entry there also pinsmin_ctx_size. A registered profile replacesLOCAL_SAMPLING_DEFAULTS; it is not merged with it.LemonadeProvider.chatstill applies it withsetdefault, so explicit caller kwargs win.top_k,min_pandrepeat_penaltyare not OpenAI-standard. When streaming they go throughextra_body. The tests assert the full wire body for both paths.Test plan
pytest tests/unit/test_lemonade_cloud_models.py tests/unit/test_llamacpp_backend.py: the full request body is asserted, streaming and non-streaming, for Gemma (unchanged), Qwen3-30B, and Qwen3.6 in each thinking mode. Explicit kwargs still win.eval_flagship.ymlon this branch withtask_suite=everyday therock(TASK_MODEL Qwen3-30B-A3B-Instruct-2507-GGUF). Compare against the 2026-10-03 nightly: everyday 7/14, therock 0/4, 4 tasks falsely claimed tests pass. Check the transcripts for repeated identical tool calls.everyday therockdispatch with TASK_MODEL = Qwen3.6-35B-A3B-GGUF, once the default-model branch switches it.