Skip to content

feat(models): default to Qwen3.8 Flash where it fits; TUI lists every Lemonade model - #4176

Closed
kovtcharov wants to merge 48 commits into
amd:mainfrom
kovtcharov:claude/qwen38-flash-default
Closed

kovtcharov wants to merge 48 commits into
amd:mainfrom
kovtcharov:claude/qwen38-flash-default

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

A 128 GB Strix Halo ran the same 4B Gemma as a 16 GB laptop, and the TUI could only pick models that were already downloaded. Now gaia init checks the PC's model memory and disk through Lemonade and adds Qwen3.8 Flash Next (125B MoE, 6B active, 82 GB) as the chat model where it fits, and keeps Gemma 4 E4B (still needed for vision) everywhere. The TUI's /provider picker lists every Lemonade model: a ★ Recommended group comes first, and each row shows its size, "downloaded", or why it won't fit. Models that fit download in the panel; models that don't fit can't be downloaded.

Stacked on #4169. Merge that first. Qwen3.8 Flash needs llama.cpp's qwen4exp support, first bundled in Lemonade v2026.39.1. The current pin, 11.8.1, can't load it.

  • Fireworks is unchanged. Qwen3.8 Flash isn't served per-token there (it needs a paid on-demand deployment), so this PR adds nothing for it; Fireworks still suggests Gemma 4 31B IT first.

  • Opting out: gaia config set default_model Gemma-4-E4B-it-GGUF keeps a big machine on Gemma. Picking Gemma with p at the TUI setup screen does the same for one session. A default_model the user set is never overwritten, and one that won't fit is refused with the command to change it.

  • Expect a reload after images on a big machine. Lemonade holds one model at a time, and vision and document-image extraction still load Gemma by name. On a PC running Qwen3.8 Flash, the first image in a session swaps out the 82 GB model, and the next chat turn reloads it. Routing vision to Qwen (which is vision-capable) is a follow-up that needs its own eval.

  • Merge gates: the two unchecked Strix Halo items below. Nothing here has run on the hardware this is for, and a default-model change needs an agent eval.

Test plan

  • Qwen3.8 Flash registration against the real Lemonade v2026.39.1: accepted, all 3 shards plus the vision projector resolved (77.2 GiB), and it refused this Mac's 17 GB free disk before downloading anything.
  • A user. model registered, loaded and chatted by its prefixed id on v2026.39.1 (HTTP 200).
  • Live TUI on this Mac (12 GB for models): Qwen3.8 Flash shown as won't fit and refused; Qwen3-0.6B downloaded through the panel and switched to in 3.7 s; a Fireworks turn still works through the new picker.
  • gaia init --check on this Mac still asks for Gemma (no default change for small machines).
  • Unit tests: fit rule, hardware default, init profiles, TUI drift guard, picker download/refusal/cancel. Full unit suite shows no new failures against the base commit.
  • python util/lint.py --all, go vet ./..., go test ./... pass.
  • Strix Halo 128 GB: gaia init picks Qwen3.8 Flash, downloads it, and records default_model. gaia tui then chats on it at the 64K window. On Linux, raise the GTT limit first: at the kernel default Lemonade reports ~63 GB and Gemma is kept, with the reason printed. Lemonade must be v2026.39.1+ (gaia init --force-reinstall upgrades an older one).
  • Strix Halo: gaia eval agent --category rag_quality --agent-type doc on Qwen3.8 Flash vs the Gemma baseline. Couldn't run here: the model doesn't fit this Mac, and Fireworks doesn't serve it.
🔍 Technical details
  • Fit rule (src/gaia/llm/model_fit.py, mirrored in tui/internal/lemonade/capacity.go): size × 1.05 + 1 GB must fit Lemonade's own llama.cpp memory pool. For an AMD iGPU that's vram_gb + virtual_mem_gb, matching select_gpu_memory_pool; otherwise dGPU VRAM, the Metal working set, or system RAM. The download must also fit model_storage.free_bytes. The constants and the Qwen registration live in recommended_models.json; tests/unit/test_model_fit.py fails if Python and Go drift.
  • resolve_default_chat_model() (config default_model, else Gemma) replaces the hard-coded fallback in the base Agent, ChatAgent, the flagship's /v1/gaia/init probe, LemonadeManager's idle-server preload, and the Agent UI's readiness banner. default_model is recorded only after the model is on disk. The minimal, vlm, email and sd profiles keep Gemma.
  • Lemonade lists user.X as X, so registry lookups now tolerate the prefix. Otherwise a picked listed id would load at the 32K floor instead of 64K.
  • The TUI setup gate's gaia init cap goes from 60 min to 5 h, enough for 82 GB at about 5 MB/s.
  • Known follow-ups, not in this PR:
    • The email agent still pins Gemma, so switching to it on a Strix Halo evicts Qwen. Its model is deliberately limited to two hard-coded ids and has its own accuracy baseline, so that change needs its own PR.
    • The Agent UI's first-run onboarding still recommends Gemma. It only runs on a PC gaia init hasn't set up.
    • Qwen3.8 Flash defaults to xhigh reasoning effort. If turns are slow on hardware, send chat_template_kwargs: {reasoning_effort: "medium"}, which also needs an eval.

@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes llm LLM backend changes tests Test changes performance Performance-critical changes cpp agents agent::email Email agent changes tui Go terminal UI (gaia-tui) labels Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Request changes

This makes the default chat model follow the machine — Qwen3.8 Flash Next on a 128 GB Strix Halo, Gemma 4 E4B everywhere else — and rebuilds the TUI's local model picker to list Lemonade's whole catalog with a fit check. The rule, the Go/Python drift test, and the CalVer parser coverage are well built. Three things should be fixed before merge, all in the "big machine" path that nothing here could exercise.

A PC with a graphics card whose memory Lemonade doesn't report gets judged on total system RAM. On a 128 GB workstation with a 24 GB Radeon card — a configuration GAIA still officially supports — the fit check concludes there is 128 GB available, decides the 82 GB model fits, and gaia init downloads it. It then cannot load. This is the "quiet wrong answer" the project's no-silent-fallbacks rule exists to prevent: when a graphics card is present but its memory is unknown, say so and refuse, rather than substituting the machine's total RAM.

A big machine now stops downloading Gemma, but Gemma is still what the vision and document-image features ask for. After a fresh setup on a Strix Halo, anything that reads an image or extracts from a scanned PDF requests a model that was never downloaded. Either keep Gemma in the download list for those profiles (as this PR already does for all), or point the vision and RAG paths at the machine's resolved model too.

gaia init --check can now end in a traceback instead of an answer. Reading the machine's memory happens inside the readiness check, and unlike every other probe in that function it isn't guarded. On a running Lemonade whose system report GAIA can't interpret, the user sees a stack trace and the terminal UI's setup gate records one in its log.

Smaller: the shipped agent package's integration guide now contradicts itself about which Lemonade version is required, and two SDK spec pages still describe the old fixed default.

Real-world evidence

N/A — no evidence-bundle.md was produced for this run, so the verdict rests on static review plus what the PR itself reports. The PR's own evidence is good for the surfaces it could reach (real Lemonade v2026.39.1 registration, a live TUI picker download and refusal on a 12 GB Mac, gaia init --check), and it honestly marks the Strix Halo items unchecked. I confirmed the Go tests pass locally (go test ./internal/lemonade/... ./internal/ui/providers/...); pytest isn't installed in this runner, so the Python tests were read, not run. Note that the one machine class this feature is for is the one with no evidence, and no quality measurement of the new default model exists anywhere yet — the deferred Strix Halo eval is the gate that matters most here.

🔍 Technical details

🔴 Critical

1. GPU present but VRAM unreported falls back to total system RAM (src/gaia/llm/model_fit.py:96-115, mirrored at tui/internal/lemonade/capacity.go:67-129)

_gpu_pool only returns a pool when some GPU entry carries a truthy vram_gb. Otherwise capacity_from_system_info falls through to Physical Memory and labels it "System RAM". Two reachable ways to hit that:

  • LEMONADE_MIN_VERSION = "10.2.0", and Lemonade 11.x /system-info entries do not all carry vram_gb/integrated — this repo's own fixture is the proof: tests/fixtures/.../lemonade11_amd_dgpu_windows.json lists amd_gpu entries with only available, family, name.
  • Older Lemonade reports the legacy amd_igpu / amd_dgpu keys, which model_fit.py does not read at all. src/gaia/llm/lemonade_manager.py:90-135 already handles both shapes and is the pattern to reuse (_iter_gpu_entries).

Failure: 128 GB RAM + 24 GB dGPU → MachineCapacity(memory_gb=128.0, memory_source="System RAM") → check_fit(81.96, …) needs 92.2 GB → fits → gaia init --profile gaia pulls 82 GB and default_model is recorded to a model llama.cpp cannot load.

The fix is a shape distinction, not a bigger margin: no GPU reported at all → system RAM is the right pool; a GPU reported with unknown VRAM → raise ModelFitError with the same actionable wording the no-memory branch already uses. Apply the same change to capacityFrom in capacity.go so the drift test keeps the two honest.

2. with_chat_model drops Gemma on a big machine, but Gemma is still the hard-coded VLM default (src/gaia/installer/init_command.py:256-274)

ids = [chat if m == DEFAULT_MODEL_NAME else m for m in ids]

For gaia / chat / rag / minimal, INIT_PROFILES[…]["models"] starts ["Gemma-4-E4B-it-GGUF", "user.embeddinggemma-300m-GGUF"], so on a Strix Halo Gemma is replaced, not added — tests/unit/test_init_command.py asserts exactly that (assertNotIn(DEFAULT_MODEL_NAME, calls)).

But Gemma remains pinned as the default at: src/gaia/vlm/mixin.py:55, src/gaia/llm/vlm_client.py:90, src/gaia/vlm/structured_extraction.py:67, src/gaia/rag/sdk.py:90, src/gaia/chat/sdk.py:26, src/gaia/ui/routers/system.py:54. resolve_default_chat_model() was threaded into the base Agent, ChatAgent and the flagship /v1/gaia/init probe, but not into these. So after a fresh gaia init --profile gaia on a 128 GB Strix Halo, the flagship's vlm tool and RAG's vision path request Gemma-4-E4B-it-GGUF, which was never pulled — and if it were pulled, loading it evicts Qwen, breaking the "one model everywhere" invariant resolve_default_chat_model's own docstring cites.

The all profile already handles this correctly (if profile != "all"). Simplest fix: append rather than replace for the profiles whose agents also use Gemma as a VLM, and pick up the remaining Gemma pins in a follow-up the PR description names.

🟡 Important

3. check_setup_status can raise instead of returning a SetupStatus (src/gaia/installer/init_command.py:338-341)

resolve_init_chat_model(client) calls client.get_system_info() and capacity_from_system_info, which raises ModelFitError (a RuntimeError). Both the health probe above it and the per-model probe below it are deliberately wrapped; this isn't. src/gaia/cli.py:4539 catches only ValueError, so gaia init --check prints a traceback, and tui/internal/gaiainit/gaiainit.go:142 reads the resulting exit 1 as the documented "not ready" with a stack trace in LastMeaningfulLine.

    if not skip_chat_model:

        def _chat() -> str:
            from gaia.llm.lemonade_client import DEFAULT_MODEL_NAME

            try:
                return resolve_init_chat_model(client).model_id
            except Exception as e:
                # A readiness check must answer, not raise; the floor model is
                # what every machine needs regardless.
                log.debug("check_setup_status: chat-model probe failed: %s", e)
                return DEFAULT_MODEL_NAME

        model_ids = with_chat_model(profile, model_ids, _chat)

4. Bundled docs contradict each other on the required Lemonade version (hub/agents/gaia/npm/SKILL.md:130)

Item 1 of the same list still reads “Lemonade 10.2.0 or newer, running (lemonade-server serve)” directly above the new item 2, which says gaia init may set up Qwen3.8 Flash Next — a model that needs v2026.39.1. Per CLAUDE.md's bundled-docs rule these must move together; lemonade-server serve is also a command CLAUDE.md forbids naming (removed in Lemonade 10.7 — use describe_start_hint()).

Also stale on the same claim:

  • docs/spec/agent-base.mdx:123 — “default: None — resolves to DEFAULT_MODEL_NAME, currently Gemma-4-E4B-it-GGUF”
  • docs/spec/chat-agent.mdx:99 — “None = use the default model (Gemma-4-E4B-it-GGUF)”
  • hub/agents/gaia/python/gaia-agent.yaml:35 — models: [Gemma-4-E4B-it-GGUF]

5. No eval for a default-model change — CLAUDE.md requires gaia eval agent against the relevant category when the default LLM changes, and there is no scorecard or baseline for Qwen3.8 Flash Next anywhere in the tree. The PR marks this unrunnable here with a real reason (doesn't fit the dev Mac, not served by Fireworks), which is the honest answer — but a whole hardware class gets a new default with zero measured quality. Worth blocking the Strix Halo lane on it rather than a post-merge follow-up.

🟢 Minor

  • entryStatus labels a row won't fit · N GB when the actual reason is "cannot check this PC's memory: …" (tui/internal/ui/providers/model.go:177). The details line is right; the row lies. A capErr-aware branch returning something like "fit unknown" would match.
  • Size threshold inconsistent between docs: docs/reference/cli.mdx says “about 92 GB for models”, tui/internal/lemonade/recommended_models.json says “~96 GB for models”. 92 matches required_memory_gb(81.96).
  • Re-running gaia init reads back the value it recorded itself and prints Chat model: … (your default_model setting) (src/gaia/installer/init_command.py:1748-1762), misattributing GAIA's own pick to the user.
  • count := max(1, m.height-16) (tui/internal/ui/providers/model.go, View) doesn't account for the two group headers the list now inserts, so a full list can overflow its box by up to two lines.

Strengths

  • tests/unit/test_model_fit.py::TestTuiDrift pins the Go picker's constants and custom registrations to the Python registry — a shared rule in two languages usually drifts silently, and this makes that a test failure.
  • tests/unit/test_lemonade_calver.py covers all seven independent version parsers, including compiling the two hub agents' private copies out of source rather than importorskip-ing them. The docstring's reasoning about why a skip would defeat the test's purpose is exactly right.
  • Client.Pull refuses a non-fitting entry at the client boundary, with a test proving the HTTP call never happens — belt-and-braces behind the picker's own gate.
  • Capacity is read from the server that will actually load the model rather than probed locally, so GAIA and llama.cpp can't disagree about the pool.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 The version-bump workflow's new SHA-pinning step will produce broken embeddable installs the next time it runs.

The workflow's Claude prompt (step 3) tells the bot to extract digests with "\(.name) \(.digest)" and use them "exactly as published." The GitHub API returns digests as sha256:<hex> — so the bot would write values like "sha256:235c2361…" into EMBEDDABLE_SHA256. But _verify() computes hashlib.sha256().hexdigest() (bare hex) and compares directly against the stored value, so every embeddable install would fail its checksum check until a human noticed the mismatch. tests/integration/test_lemonade_embeddable_assets.py would also fail in CI. The current dict values are correct bare hex — this only affects the next automated bump.

🔍 Technical details

Where the mismatch lives: .github/workflows/lemonade-version-bump.yml lines 210-216 (Claude step 3), versus src/gaia/llm/lemonade_embedded.py:589-590.

The jq query produces output like:

lemonade-embeddable-2026.39.1-windows-x64.zip sha256:235c2361be3a...

"Use the digests exactly as published" means the bot writes "sha256:235c2361be3a..." into the dict. But _verify does:

actual = digest.hexdigest()      # → "235c2361be3a..."
if actual != expected_sha256:    # → "sha256:235c..." != "235c..." → always fails

Fix: strip the prefix in the jq query —

--jq '.assets[] | select(.name|test("embeddable")) | "\(.name) \(.digest | ltrimstr("sha256:"))"'

— or add an explicit sentence to the prompt: "Strip the leading sha256: prefix before writing — _verify expects a bare hex string."

Guard 2b correctly checks that the API field starts with sha256:, so the guard passes while the stored value would be wrong. The current dict values (235c..., etc.) were presumably hand-computed and are correct; this only affects the automated path.

kovtcharov pushed a commit to kovtcharov/gaia that referenced this pull request Sep 24, 2026
Addresses review on amd#4176.

- A GPU Lemonade reports without its memory (Lemonade 11's Radeon dGPU
  entries, or the legacy amd_igpu/amd_dgpu keys) was judged on total RAM, so
  a 128 GB workstation with a 24 GB card would have downloaded the 82 GB
  model. Such a report now means "can't tell": gaia init keeps Gemma and
  says why, and the TUI blocks downloads with "fit unknown". Both languages
  read the legacy keys; tests run against the captured Lemonade 11 reports.
- A big machine now downloads its chat model alongside Gemma instead of in
  place of it: vision and document-image extraction still load Gemma by
  name.
- gaia init --check answers exit 2 with a one-line reason for a corrupt
  config, a default_model that won't fit, or a Lemonade error, instead of a
  traceback read as "needs setup" (exit 1). get_system_info takes a
  timeout; the fit probes use 15 s instead of the 900 s default.
- An already-downloaded default_model skips the fit check (nothing to
  download), and init no longer calls its own recorded pick "your setting".
- The Agent UI status resolves the default once, before the probe whose
  catch-all would report a corrupt config as "Lemonade not running".
- SKILL.md no longer names the removed `lemonade-server serve` and states
  the v2026.39.1 floor for Qwen3.8 Flash; the SDK specs describe the
  resolved default.
@kovtcharov

Copy link
Copy Markdown
Contributor Author

All three blockers are fixed in 553a942. Most of the smaller items are fixed too; the eval stays a Strix Halo gate.

  • A GPU with unreported memory is no longer judged on system RAM. It now means "can't tell": gaia init keeps Gemma and prints why, and the TUI marks rows "fit unknown" and won't download them. Both sides also read the legacy amd_igpu/amd_dgpu keys. Tests run against the captured Lemonade 11 reports, including the Radeon dGPU one.
  • Gemma is kept for vision. A big machine now downloads its chat model alongside Gemma, not in place of it. Pointing the vision and RAG paths at the resolved model is a separate, eval-gated change.
  • gaia init --check answers instead of crashing. A corrupt config, a default_model that won't fit, or a Lemonade error now exits 2 with a one-line reason, which the TUI shows as "could not be checked". It deliberately doesn't fall back to Gemma: a bad config isn't something setup can fix. The fit probe also uses a 15 s timeout instead of 900 s.
  • Docs: SKILL.md no longer names lemonade-server serve and states the v2026.39.1 floor. Both SDK specs now describe the resolved default. gaia-agent.yaml keeps models: [Gemma-4-E4B-it-GGUF], since Gemma is still required everywhere.
  • Eval: agreed it's the gate that matters. It stays an unchecked, merge-blocking Strix Halo item, because the model fits neither the dev Mac nor Fireworks' per-token tier.

One thing the fixtures showed for whoever tests this: on Linux, the Strix Halo fixture reports 0.5 GB VRAM + 62.5 GB GTT (the kernel's default of half of RAM). By Lemonade's own rule that's ~63 GB for models, so Qwen3.8 Flash isn't picked there until the GTT limit is raised. Windows with a 96 GB carve-out reports ~112 GB.

🔍 Technical details
  • model_fit._gpu_pool / capacity.go:capacityFrom: an AMD iGPU with memory is vram + virtual; failing that, any GPU with vram_gb is used. Available GPUs with no memory raise ModelFitError; no GPUs at all falls through to system RAM. recommend_default_chat_model catches ModelFitError and picks the floor with the reason attached.
  • with_chat_model appends and never replaces; test_download_registers_qwen_with_a_size_scaled_timeout now asserts Gemma is pulled too.
  • cli.py --check: catches GaiaConfigError, ModelFitError and LemonadeClientError and exits 2; covered by test_an_unanswerable_check_is_not_reported_as_needs_setup.
  • Minor items: "fit unknown" row status, list height now accounts for the two group headers, an already-downloaded default_model skips the fit check, and the self-recorded pick is no longer called "your setting". The 92/96 GB text and minimal pulling 82 GB were already fixed in b0792de (margin is now ×1.05 + 1 GB, ~87 GB for Qwen).

@github-actions github-actions Bot added the cli CLI changes label Sep 24, 2026
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Fixed in 1afdf6a. The bump workflow's query now strips the sha256: prefix and tells the bot to write bare hex, matching what the installer compares against. A unit test fails if any pinned digest isn't 64 lowercase hex characters, so a prefixed value can't land silently. The same workflow step also lives in #4169, which this PR stacks on.

kovtcharov pushed a commit to kovtcharov/gaia that referenced this pull request Sep 24, 2026
Addresses review on amd#4176.

- A GPU Lemonade reports without its memory (Lemonade 11's Radeon dGPU
  entries, or the legacy amd_igpu/amd_dgpu keys) was judged on total RAM, so
  a 128 GB workstation with a 24 GB card would have downloaded the 82 GB
  model. Such a report now means "can't tell": gaia init keeps Gemma and
  says why, and the TUI blocks downloads with "fit unknown". Both languages
  read the legacy keys; tests run against the captured Lemonade 11 reports.
- A big machine now downloads its chat model alongside Gemma instead of in
  place of it: vision and document-image extraction still load Gemma by
  name.
- gaia init --check answers exit 2 with a one-line reason for a corrupt
  config, a default_model that won't fit, or a Lemonade error, instead of a
  traceback read as "needs setup" (exit 1). get_system_info takes a
  timeout; the fit probes use 15 s instead of the 900 s default.
- An already-downloaded default_model skips the fit check (nothing to
  download), and init no longer calls its own recorded pick "your setting".
- The Agent UI status resolves the default once, before the probe whose
  catch-all would report a corrupt config as "Lemonade not running".
- SKILL.md no longer names the removed `lemonade-server serve` and states
  the v2026.39.1 floor for Qwen3.8 Flash; the SDK specs describe the
  resolved default.
@kovtcharov
kovtcharov force-pushed the claude/qwen38-flash-default branch from 1afdf6a to 74a6a6e Compare September 24, 2026 17:34
kovtcharov pushed a commit to kovtcharov/gaia that referenced this pull request Sep 24, 2026
Addresses review on amd#4176.

- A GPU Lemonade reports without its memory (Lemonade 11's Radeon dGPU
  entries, or the legacy amd_igpu/amd_dgpu keys) was judged on total RAM, so
  a 128 GB workstation with a 24 GB card would have downloaded the 82 GB
  model. Such a report now means "can't tell": gaia init keeps Gemma and
  says why, and the TUI blocks downloads with "fit unknown". Both languages
  read the legacy keys; tests run against the captured Lemonade 11 reports.
- A big machine now downloads its chat model alongside Gemma instead of in
  place of it: vision and document-image extraction still load Gemma by
  name.
- gaia init --check answers exit 2 with a one-line reason for a corrupt
  config, a default_model that won't fit, or a Lemonade error, instead of a
  traceback read as "needs setup" (exit 1). get_system_info takes a
  timeout; the fit probes use 15 s instead of the 900 s default.
- An already-downloaded default_model skips the fit check (nothing to
  download), and init no longer calls its own recorded pick "your setting".
- The Agent UI status resolves the default once, before the probe whose
  catch-all would report a corrupt config as "Lemonade not running".
- SKILL.md no longer names the removed `lemonade-server serve` and states
  the v2026.39.1 floor for Qwen3.8 Flash; the SDK specs describe the
  resolved default.
@kovtcharov
kovtcharov force-pushed the claude/qwen38-flash-default branch from 464bc5f to e3d415e Compare September 24, 2026 17:48
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Closing: we're going with the Qwen 3.8 models Fireworks serves instead of running Qwen3.8 Flash locally.

@kovtcharov kovtcharov closed this Sep 24, 2026
@kovtcharov kovtcharov reopened this Sep 24, 2026
Kalin Ovtcharov and others added 7 commits September 24, 2026 13:56
Lemonade switched from semver to CalVer in this release (11.9.0 ->
2026.39.1) and called out that anything parsing or comparing version
strings has to be updated.

Release CalVer already compared correctly by luck — 2026 > 11 — but
development builds are shaped 2026.39.0~12.abc1234, and int("0~12")
raises. All five of GAIA's version parsers swallowed that and returned
None, which every caller reads as "can't tell" and deliberately does
not block on. The gate would have been silently off for every candidate
build rather than failing loudly. Each parser now keeps its components'
leading digits.

Also refreshes the embeddable SHA-256 pins, which are keyed by a
filename containing the version and so go stale on every bump.

The auto-bump workflow never refreshed those digests, so the next
scheduled bump would have shipped stale pins and a red PR. It now
rewrites them from the release API's digest field, and the cheap shell
gate checks the four embeddable assets and their digests before paying
for the LLM step.

Verified against a real v2026.39.1: cold embedded install (download,
checksum, unpack), server start, and a chat completion through
LemonadeClient on Gemma-4-E4B-it-GGUF.

Co-Authored-By: Claude Opus 5 <[email protected]>
Adding the module-level `import re` for CalVer parsing turned the
function-local `import re as _re` into a reimport, which pylint treats
as a critical error. The label-stripping call now uses the module
import.

Co-Authored-By: Claude Opus 5 <[email protected]>
The flagship agent keeps its own copy of the version comparison, and the
first pass of this change missed it. It reads /api/v1/health's version
verbatim — nothing normalizes the CalVer dev suffix away first — so on a
development build it returned None and the readiness row rendered
"unknown", leaving the check off on the agent most people run. That is
the exact failure this change exists to remove.

LemonadeInfo.version_tuple gets the same treatment. It is shielded today
because check_installation fills version from get_installed_version,
which already strips the suffix, but that invariant lives two files away
and callers build LemonadeInfo directly.

test_lemonade_calver.py now parametrizes every copy, so fixing only some
of them fails there — it could not have caught this miss before.

Also refreshes three version references the docs checker cannot see: it
only scans docs/ and cpp/. The macOS uninstall provenance is updated
after verifying against the real v2026.39.1 .pkg that every path and
pkgutil identifier it names is unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
The flagship tests added with the last commit imported gaia_agent, which
is absent in the unit-test CI job: the root conftest puts a hub agent on
sys.path only when its package already resolves somewhere, and that job
installs nothing but gaia[api]. It passed locally because a sibling
worktree had the agent editable-installed. Five failures on py3.10 and
py3.12, one on the macOS smoke job, which stops at the first.

conftest's stated answer is importorskip, but a skip would switch this
file off in CI — the failure it exists to catch. Both hub-agent parsers
are small and pure, so compile them out of their source with ast
instead: no package import, no skip, still reading the real code.

Also covers the Lemonade client's gate, which is a closure and was the
last copy not exercised directly. Doing so turned up a second bug in the
pre-fix code: an unparseable version fell into an except-branch that
returns "compatible", so an OLD dev build like 9.1.0~4.deadbee was waved
through rather than merely reported unknown.

Verified in a venv built to match the CI job, with neither hub agent
importable: 35 pass there, and 8 still fail against the unfixed tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
A 128 GB Strix Halo ran the same 4B Gemma as a 16 GB laptop. `gaia init` now
reads the machine's model memory and free disk from Lemonade's /system-info
and sets up Qwen3.8-Flash-Next (125B MoE, 6B active; UD-IQ3_XXS, 82 GB) where
it fits, Gemma 4 E4B everywhere else. The pick is recorded as default_model,
which every agent now resolves through instead of a hard-coded Gemma; a
default_model the user set always wins.

- model_fit: one fit rule (size x1.1 + 2 GB against the llama.cpp memory
  pool, download against free disk), mirrored by the TUI and pinned by a
  drift test against tui/internal/lemonade/recommended_models.json.
- Qwen3.8 Flash is a custom user. model: registration now carries mmproj,
  vision and reasoning. Needs llama.cpp qwen4exp support, first bundled in
  Lemonade v2026.39.1 (amd#4169).
- Registry lookups tolerate the user. prefix Lemonade strips when listing,
  so a picked listed id still loads at the 64K window.
- Init profiles whose agents follow default_model swap Gemma for the
  machine's pick; vlm, email and sd keep Gemma.
The local picker only showed models already downloaded, so there was no way
to discover or fetch anything else from the TUI. It now lists every chat
model Lemonade offers, with a starred Recommended group first (Qwen3.8
Flash, Gemma 4 E4B, the Qwen3 Coder models; tested Fireworks models for that
provider). Each local row says whether it is downloaded, how big it is, or
why it won't fit this PC. Selecting a model that fits downloads it in the
panel with progress, then switches to it; a model that doesn't fit cannot be
downloaded, and if Lemonade can't report the PC's memory no download is
allowed at all.

Fireworks lists Qwen3.8 Flash as unavailable until the account has a
deployment for it, since Fireworks does not serve it per-token.

The setup gate's gaia init timeout grows from 60 min to 5 h so the 82 GB
first download on a Strix Halo is not killed mid-way.
A 128 GB Strix Halo could still end up downloading and loading Gemma, or
with a default that was never downloaded; this makes every path agree.

- The idle-server preload loaded Gemma with auto_download, so gaia init's
  verify step and Agent UI startup pulled a model nobody used. It now seeds
  the machine's default (Gemma only when that default is a cloud model).
- default_model is recorded only once the picked model is on disk, so a
  declined download or --skip-models no longer leaves agents pointed at a
  missing model.
- A local model picked in the TUI replaces the hardware default in the
  setup gate: setup downloads embedders only, and the gate checks the pick
  is downloaded. Picking Gemma on a big PC no longer forces 82 GB.
- A Claude or cloud default_model is not a local download; the local chat
  model follows the hardware instead. A user default_model that will not
  fit is refused with the command to change it. --check raises on a corrupt
  config instead of treating it as unset.
- The minimal profile keeps Gemma; it promises a ~3 GB setup.
- The Agent UI's readiness banner, download progress and startup preload
  follow the machine default and match user. models by their listed id.
- Fit margin is now size x1.05 + 1 GB: x1.1 + 2 GB marked Gemma 4 E4B as
  not fitting a 16 GB iGPU laptop whose Lemonade pool is ~8 GB, where it
  runs today. Qwen keeps ~5 GB over its weights for the 64K window.
Kalin Ovtcharov added 4 commits September 25, 2026 20:03
With the system installer gone nothing imports gaia.llm.lemonade_embedded at
collection time, so pyfakefs unloaded it after the first purge-guard case and
the second case patched an orphaned class.
The expected substrings use "/" but Windows prints "\", so the dry-run
test could never pass there.
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 26, 2026
On a first run, callers that start at the same moment (Agent UI boot
plus the first chat, or several sidecars) each saw an idle Lemonade
server and sent their own `/load` — up to two parallel multi-GB
downloads and two cold loads of the same model. Now the first caller
loads the model and the rest wait for it, then pick up the result; if
that load fails, each waiter retries and reports its own error instead
of hanging.

The existing concurrency test couldn't catch this because its mock
returned "loaded" on the second status read; it now blocks in
`load_model` and keeps the server idle until the load finishes, so it
fails on `main` (2 loads) and passes here.

<details>
<summary>🔍 Technical details</summary>

- `LemonadeManager._preload_in_flight` (a `threading.Event`) is set
before `_try_preload_with_ctx` releases the lock and cleared in its
`finally` after re-acquiring. `ensure_ready` waits on it, with the lock
released, at the top of its locked block.
- Overlap with open PRs: amd#4176 renames `DEFAULT_MODEL_NAME` → `model`
inside `_try_preload_with_ctx` and amd#4193 adds a daemon start call after
the "Initializing Lemonade" log in `ensure_ready`. Neither changes the
lock handling, so they shouldn't conflict beyond possible adjacent-line
rebases.
</details>

## Test plan
- [x] `pytest tests/unit/test_lemonade_manager_preload.py -k
concurrent`: fails on `origin/main` (`load_model` called 2 times),
passes with the fix (5/5 repeated runs)
- [x] `pytest tests/unit/test_lemonade_manager_preload.py`: 23 passed,
including the new `test_failed_preload_releases_waiting_callers`
- [x] Neighbouring `LemonadeManager` suites (`test_chat_preflight`,
`test_hardware_selection`, `test_llm`, `test_multi_device_wiring`,
`test_npu_device_support`, `test_base_agent_lemonade_api_key`,
`test_init_verify_ctx_display`, `chat/ui/test_server`,
`chat/ui/test_chat_helpers`): 333 passed
- [x] black / isort / pylint clean on the changed files

Fixes amd#4212

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
Kalin Ovtcharov added 3 commits September 25, 2026 20:52
# Conflicts:
#	hub/agents/gaia/npm/SKILL.md
#	hub/agents/gaia/python/gaia_agent/server.py
#	src/gaia/installer/init_command.py
#	src/gaia/llm/lemonade_manager.py
#	tests/unit/test_init_command.py
# Conflicts:
#	hub/agents/gaia/npm/SKILL.md
Main ranked the benchmark's best Fireworks models in the TUI picker while this
branch moved the picker onto recommended_models.json. The ranking now lives in
that file as the Fireworks recommendations, so RecommendedModels, Rank and the
picker's ★ group read one list; cloud recommendations also match their
account-path ids.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

I read this end to end rather than deferring it as "too large", and size turns out not to be the issue at all. It merges cleanly into main and the model-selection tests are 265/265 on the merged tree. Two things block it, and neither is mechanical.

You reversed direction on this yourself and never said what changed back. On 24 Sep you closed it with "we're going with the Qwen 3.8 models Fireworks serves instead of running Qwen3.8 Flash locally", then reopened it four minutes later with no note. That is the whole premise of the PR — whether GAIA runs an 82 GB model locally on a big machine at all. Nobody else can settle it, and everything below is moot if the answer is Fireworks.

A default-model change needs an agent eval, and there is none. CLAUDE.md names the default LLM explicitly in the list of changes that require gaia eval agent before merge. Your own checklist leaves the rag_quality run against the Gemma baseline unchecked with an honest reason — the model fits neither your Mac nor Fireworks' per-token tier. That reason is real, and it is also exactly why this needs Strix Halo hardware and a human, not another review pass. A whole hardware class would get a new default with zero measured quality.

One piece of good news: your "merge #4169 first" instruction is stale. #4169 was closed unmerged, but the Lemonade bump landed anyway — main is on LEMONADE_VERSION = "2026.39.1" with the embeddable digests already pinned. The version blocker you wrote into the description is gone. Worth editing so the next reader doesn't chase a closed PR.

🔍 Technical details

Merge and tests. Clean merge onto 8e012edad, no conflicts. On the merged tree: tests/unit/test_model_fit.py test_init_command.py test_compare_local_models.py test_lemonade_calver.py → 265 passed, 9 subtests passed. The two red CI checks are the continue-on-error: true macOS/Windows smoke lanes, so they are advisory, not gates.

Still open from the 26 Sep review: the download-cancel race in tui/internal/ui/providers/model.go. pullDoneMsg is still {ch, id, err} at :41 with no generation counter, and :151 still sends pullDoneMsg{ch: ch, ...}, so a cancelled pull's late message can still kill a freshly started one inside the v.source == m.client && m.stage == "download" window. 🟡, not a gate.

A decomposition that would unblock most of this without the eval. model_fit.py (the fit rule, the Go mirror, the drift test) and the TUI picker rebuild are independent of DEFAULT_MODEL_LADDER / recommend_default_chat_model. The picker, the capacity read, the honest "won't fit" / "fit unknown" refusals and Client.Pull's boundary check change no default and need no eval — they are pure improvements over "you can only pick what you already downloaded". Splitting those out would let the well-evidenced 90% land now and leave only the ladder flip waiting on Strix Halo. That is a real option, not a consolation prize: the small-machine and picker paths are the parts your evidence actually covers.

Relationship to #4265: git merge-base --is-ancestor confirms #4265 strictly contains this branch — it is a stack, not a duplicate. See my note there.

What I need from you: the direction call first (local Qwen3.8 Flash, or Fireworks-served), then either a Strix Halo eval or the split above. I am not merging a default-model change on unmeasured quality.

_gaia_home() resolves the override, which on Windows adds a drive letter, so a
rootless /srv/gaia-alt never compared equal there.
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 26, 2026
amd#4325)

Agent UI Settings showed a red "Processor: darwin" on every Mac and
flagged Linux machines and most Ryzen AI laptops as unsupported. The
check still required a Ryzen AI Max or a 24 GB Radeon, the bar for the
old Qwen3.5-35B default, but the default model is now the 4B Gemma.
Nothing acts on that verdict, and memory fit is already covered by the
Memory row and the per-agent memory warning. So the verdict is removed,
and the Processor row now just names the real CPU (e.g. "Apple M4"
instead of "darwin"). The silent `except Exception: pass` around the
check is gone too.

Overlap: amd#4176, amd#4265 and amd#4309 also edit
`src/gaia/ui/routers/system.py`, but not the device block, so any
conflict is textual only.

## Test plan
- [x] Backend tests fail before the fix and pass after: all 7 new
`tests/unit/test_device_check.py` tests and the new
`test_system_status_names_the_processor_without_a_support_verdict`
failed on `main`, and all pass with the fix.
- [x] `GAIA_HOME=<tmp> GAIA_DAEMON_HOME=<tmp> python -m pytest
tests/unit/chat/ui/ tests/unit/test_device_check.py -q`: 1038 passed.
- [x] Agent UI, run with Node 22 from `src/gaia/apps/webui`: `npx tsc
--noEmit -p .` is clean and `npx vitest run` passes 398/398.
- [x] On a Mac, `GET /api/system/status` against a real `create_app()`
returns `processor_name: "Apple M4"` and no `device_supported` field. On
`main` it returned `"darwin"` / `false`.
- [x] black, isort, and pylint (errors-only config) pass on the changed
Python files.
- [ ] Open Settings in the Agent UI on Windows and Linux and confirm the
Processor row shows the CPU name without the warning colour.

Fixes amd#4230

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
Kalin Ovtcharov added 10 commits September 25, 2026 23:14
pyfakefs' teardown calls os.getuid() while the test's faked "linux" platform
is still active, which raises on Windows; the tests only read one file, so a
real tmp dir covers them without the fake filesystem.
The fake-spawn helper let shutdown reach the real tree-kill: on Windows its
taskkill went through the patched Popen and crashed, and on POSIX it sent
SIGTERM to process group 4242, whatever that is on the machine. Stub the
tree-kill and the group probe in the helper.
A second test patches Popen itself rather than using the fake-spawn helper, so
its shutdown still ran taskkill (Windows) or killpg (POSIX) against the fake
pid. An autouse fixture now passes only real Popen children to the tree-kill.
Windows' os has neither, so monkeypatch.setattr raised before the test ran;
raising=False creates the stand-in instead.
The stripped env set only HOME, but Windows resolves the home dir from
USERPROFILE, so the child crashed at import before printing the refusal.
The refusal prints an emoji; on Windows the parent decoded the pipe as cp1252
and got None for stdout. Pin the child's and the reader's encoding to UTF-8.
reap_stale deliberately leaves a dead leader's survivors alone on Windows (a
documented gap: no process group to kill), so asserting a group kill there
can only fail.
…them

The fake daemon replied with a POSIX string while the resolver returned a Path,
which Windows renders with backslashes, so the CLI saw a mismatch that no real
daemon would report.
# Conflicts:
#	hub/agents/gaia/npm/SKILL.md
@itomek

itomek commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Triaged this alongside #4265 rather than separately, and the short version is that #4265 already contains every commit on this branch — so the two are one decision, not two, and keeping both open is part of why they kept getting deferred together.

The decision itself is untouched and still open: does GAIA run Qwen3.8 Flash Next locally on a big machine, or take the Fireworks-served route you named when you closed this on 24 Sep? That reversal is still the premise and still unexplained.

One thing worth separating out — the picker half does not depend on that answer. Roughly 1,900 of the 2,993 added lines are the picker rebuild, the capacity read, the honest "won't fit" / "fit unknown" refusals and the Python↔Go drift test. None of it changes a default, none of it needs an eval, and it is a strict improvement over main's "you can only pick what you already downloaded". That half could land while the model question stays open.

🔍 Technical details

Containment:

$ git merge-base --is-ancestor v4176 v4265 && echo YES
YES
$ git rev-list --count v4265..v4176      # commits here that #4265 lacks
0
$ git rev-list --count v4176..v4265      # commits #4265 adds
34

34 on top, 5 of them non-merge:

011ef9e48 test(cli): give the refusal-exit subprocess a Windows home
4907c7df1 test(daemon): tree-kill only real children in every sidecar test
a22195117 docs(cli): hedge the 30B speed claim as reported, not measured
728085e7b fix(models): hedge the 30B speed claim; make the comparison script stricter
f8a71ea3c feat(models): support Qwen3 30B A3B and compare it with Qwen3.8 Flash

Two corrections to the review record, both in your favour:

  1. The download-cancel race from the 2026-09-26 bot review is already fixed, by 7f1b40515 ("fix(tui): a cancelled model download can no longer end the next one"), which is on this head. It read as live only because it was searched for by field name (a generation counter) rather than by behaviour.

  2. The body is stale in a way that will mislead the next reader: it still says "Stacked on chore(deps): bump Lemonade Server to v2026.39.1 #4169. Merge that first." chore(deps): bump Lemonade Server to v2026.39.1 #4169 was closed unmerged on 2026-09-25, and main already pins LEMONADE_VERSION = "2026.39.1".

A collision nobody has flagged — #4385 (open) touches the same three files:

$ git merge-tree --write-tree --name-only <this> <4385>
tui/internal/lemonade/cloud.go
tui/internal/ui/providers/model.go
tui/internal/ui/providers/model_test.go

Two of those are the literal core of the picker half. #4385 adds an Evidence field to Recommendation; this branch rewrites RecommendedModels into a registry-populated slice whose population line copies only ID and Note. Whichever lands second has to carry the other's field through by hand — it is a real conflict, not a silent drop, so the compiler will catch it either way.

kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
…pick (amd#4414)

Picking a Fireworks model in the TUI showed a rank and a three-word
label — "best overall, cheapest" — with nothing to say what that was
measured on or what a run costs. Focusing a ranked model now shows the
measurement behind its label: tasks solved, judged quality, and the
dollar cost of one pass. Every figure on that line is the model's own
row in the benchmark table published in amd#4335, and a test fails if the
two ever drift apart.

This replaces amd#4385 (@kovtcharov's
`feat/tui-benchmarked-fireworks-models`). All three of its commits are
ancestors here, authorship intact; the difference is that the TheRock
half of each line is gone. Neither TheRock quality score — 3.69/5 for
GLM, 4.44/5 for DeepSeek — is published anywhere a reader can reach, and
amd#4335 says so itself: "TheRock tier results will be added once its
reruns complete." A line labelled `Measured:` that a user cannot trace
is the thing this repo's evidence rule exists to prevent, so the
untraceable half was removed rather than sourced. The everyday-suite
figures stay, because they match amd#4335's table cell for cell.

## Test plan

- [x] `go build ./...` and `go vet` clean on the whole `tui` module (Go
1.26.3, Strix Halo)
- [x] `go test ./...` — 21 of 23 packages pass; the two that don't are
`internal/ui/chat` and `internal/ui/preflight`, which fail identically
on plain `main` (a headless clipboard read and a Lemonade autostart,
both hanging until the timeout, neither touched by this change)
- [x] Drift guard proven by breaking it: changing `4.89` to `4.95` fails
`TestEvidenceIsTranscribed` with the published cell named
- [x] Rendered panel captured: rank 1 and 2 show their `Measured:` line,
rank 3 (no published figures) and an unranked model show none
- [x] `python util/check_doc_links.py --internal-only` — 1042 links, 0
broken
- [ ] With a Fireworks key: `/provider` → Fireworks AI → focus
`glm-5p3-flash` against a live account

<details>
<summary>🔍 Provenance check: which figures have a source</summary>

Every figure in amd#4385 was searched for across the whole tree, every PR
body in the repo's last 120 PRs, and every issue comment on the last 60.

| Figure | Model | Source | |
|---|---|---|---|
| 14/14, 4.89, $0.09, 7:04 | GLM-5.3 Flash, everyday | amd#4335 merged
body, GAIA row | traceable |
| 14/14, 4.92, $0.10, 5:39 | DeepSeek V4.1 Flash, everyday | amd#4335
merged body, GAIA row | traceable |
| 4/4, 3.69, $0.42 | GLM-5.3 Flash, TheRock | only amd#4397, still open |
not citable |
| 4/4, 4.44, $0.47 | DeepSeek V4.1 Flash, TheRock | cost only —
`docs/plans/nightly-benchmarks.mdx` puts DeepSeek's `therock` pass at
`~$0.47`; the 4.44 quality score nowhere | not citable |

`14/14` and `4/4` denominators are independently checkable:
`eval/tasks/tasks.json` defines `everyday` as 14 tasks and `therock` as
4.

```
$ rg -n --fixed-strings 4.89 .
./tui/internal/lemonade/cloud.go:39:  Evidence: "14/14 tasks · quality 4.89/5 · $0.09 per 14-task run · TheRock 4/4, 3.69/5, $0.42",
./docs/guides/ai-providers.mdx:55:| GLM-5.3 Flash | `fireworks.glm-5p3-flash` | 14/14 solved, quality 4.89/5, $0.09 per run, 7:04 | 4/4, quality 3.69/5, $0.42 |

$ gh pr list -R amd/gaia --state all --limit 120 --json number,title,body | python -c "<scan for 3.69 / 4.44 / \$0.42 / \$0.47>"
scanned 120 PRs
4397 feat(agent): evict stale tool results from the sent context, ['3.69', '$0.42']
4385 feat(tui): show the measurement behind each ranked Fireworks   ['3.69', '$0.42']

$ <same scan over issue comments on the 60 most recent PRs>
no comment on the last 60 PRs contains 4.44 / $0.47 / 3.69 / $0.42
```

Corrected after review: an earlier version of this table said `$0.47`
was sourced nowhere. It is in `docs/plans/nightly-benchmarks.mdx` on
`main` (line 37 and the `therock` row), attributed to DeepSeek V4.1
Flash under a column headed "Cost per pass (measured)". That is a
planning estimate for the suite rather than a published per-model cell,
and the `4.44/5` quality score in the same trailer still has no source,
so the trailer still cannot ship — but the claim as written was wrong.
`$0.42` does have zero occurrences anywhere.

amd#4397 is open, and carries the GLM row only, as an aside: "the earlier
GLM TheRock row without eviction: 3.69, $0.42". The DeepSeek TheRock
figures have no public source at all.

</details>

<details>
<summary>🔍 Ancestry, build, tests, and the rendered panel</summary>

Every commit of amd#4385 is an ancestor of this branch:

```
$ git merge-base --is-ancestor e472abc HEAD; echo $?
0
$ git merge-base --is-ancestor 56eadd4 HEAD; echo $?
0
$ git merge-base --is-ancestor bfa1070 HEAD; echo $?
0
```

Build and vet, on Strix Halo (no Go toolchain on the authoring machine):

```
$ go version
go version go1.26.3 linux/amd64
$ gofmt -l internal/lemonade internal/ui/providers
$ go build ./... ; echo BUILD_EXIT=$?
BUILD_EXIT=0
$ go vet ./internal/lemonade/... ./internal/ui/providers/...
VET_OK
```

Full module, this branch:

```
$ go test -timeout 150s ./...
ok   github.com/amd/gaia/tui/internal/catalog          0.004s
ok   github.com/amd/gaia/tui/internal/cli              0.012s
ok   github.com/amd/gaia/tui/internal/client           9.834s
ok   github.com/amd/gaia/tui/internal/control          0.859s
ok   github.com/amd/gaia/tui/internal/daemon           0.325s
ok   github.com/amd/gaia/tui/internal/event            0.011s
ok   github.com/amd/gaia/tui/internal/gaiainit         0.007s
ok   github.com/amd/gaia/tui/internal/gaiaslack        0.018s
ok   github.com/amd/gaia/tui/internal/lemonade         0.014s
ok   github.com/amd/gaia/tui/internal/ui               0.169s
ok   github.com/amd/gaia/tui/internal/ui/agents        0.009s
ok   github.com/amd/gaia/tui/internal/ui/brand         0.010s
ok   github.com/amd/gaia/tui/internal/ui/cards         0.040s
FAIL github.com/amd/gaia/tui/internal/ui/chat        150.015s
ok   github.com/amd/gaia/tui/internal/ui/components    1.096s
ok   github.com/amd/gaia/tui/internal/ui/gateway       0.005s
FAIL github.com/amd/gaia/tui/internal/ui/preflight   150.007s
ok   github.com/amd/gaia/tui/internal/ui/providers     0.003s
ok   github.com/amd/gaia/tui/internal/ui/root          0.015s
ok   github.com/amd/gaia/tui/internal/ui/status        0.001s
ok   github.com/amd/gaia/tui/internal/ui/theme         0.104s
ok   github.com/amd/gaia/tui/test                    112.666s
ok   github.com/amd/gaia/tui/test/mockagent            0.001s
```

Same two packages, same two tests, on plain `origin/main` — pre-existing
and environmental, not from this change:

```
this branch:                          origin/main:
  running tests:                        running tests:
    TestCtrlVReadsTheClipboard (2m30s)    TestCtrlVReadsTheClipboard (2m30s)
  running tests:                        running tests:
    TestADownLemonadeOffersTheOneKeySetup   TestADownLemonadeOffersTheOneKeySetup
FAIL .../internal/ui/chat      150.015s  FAIL .../internal/ui/chat      150.016s
FAIL .../internal/ui/preflight 150.007s  FAIL .../internal/ui/preflight 150.008s
```

The drift guard, proven by breaking it:

```
$ sed -i 's|quality 4.89/5|quality 4.95/5|' internal/lemonade/cloud.go
$ go test -run TestEvidenceIsTranscribed ./internal/lemonade/...
--- FAIL: TestEvidenceIsTranscribed (0.00s)
    cloud_test.go:210: fireworks.glm-5p3-flash: evidence "14/14 tasks · quality 4.95/5 · $0.09 per 14-task run" dropped published cell "4.89"
FAIL
$ <restore>
ok   github.com/amd/gaia/tui/internal/lemonade  0.002s
```

The panel as rendered, walking focus down the list:

```
  › glm-5p3-flash · #1 best overall, cheapest
    deepseek-v4p1-flash · #2 fastest
    deepseek-v4-pro-0813 · #3 most truthful
    plain-model
  1 of 4
  Measured: 14/14 tasks · quality 4.89/5 · $0.09 per 14-task run

    glm-5p3-flash · #1 best overall, cheapest
  › deepseek-v4p1-flash · #2 fastest
    deepseek-v4-pro-0813 · #3 most truthful
    plain-model
  2 of 4
  Measured: 14/14 tasks · quality 4.92/5 · $0.10 per 14-task run

    glm-5p3-flash · #1 best overall, cheapest
    deepseek-v4p1-flash · #2 fastest
  › deepseek-v4-pro-0813 · #3 most truthful
    plain-model
  3 of 4
                              ← no published figures, so no line
```

</details>

<details>
<summary>🔍 Merge-order note for amd#4176 and amd#4265</summary>

Both rewrite `RecommendedModels` into a registry-populated slice whose
populating line copies only two fields
(`tui/internal/lemonade/recommended.go:70` — `Recommendation{ID: r.ID,
Note: r.Note}`) and drop `Evidence` from the struct entirely. Landing
this first does **not** silently drop the evidence: it produces a hard
conflict a human has to resolve.

```
$ git merge-tree --write-tree itomek/tui-measured-evidence pr4176
CONFLICT (content): Merge conflict in tui/internal/lemonade/cloud.go
CONFLICT (content): Merge conflict in tui/internal/ui/providers/model.go

$ git merge-tree --write-tree itomek/tui-measured-evidence pr4265
CONFLICT (content): Merge conflict in tui/internal/lemonade/cloud.go
CONFLICT (content): Merge conflict in tui/internal/ui/providers/model.go
CONFLICT (content): Merge conflict in tui/internal/ui/providers/model_test.go
```

Stages 1, 2 and 3 are all present, so it is an ordinary content conflict
with a shared base, not an add/add. Whoever resolves it needs to carry
`Evidence` and `EvidenceSource` into the registry shape, or
`TestEvidenceIsTranscribed` and the `Measured:` line go with it. Both
PRs already conflict with `main` on `hub/agents/gaia/npm/CHANGELOG.md`
independently of this.

</details>

Replaces amd#4385 — leave that one open for @kovtcharov to close or keep.

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
@itomek

itomek commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Closing as contained in #4265 — every commit here is already an ancestor of that branch, so nothing is lost and this reopens in one click if the Qwen question resolves the other way.

@itomek itomek closed this Sep 29, 2026
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Direct product decision: Qwen3 30B A3B Instruct 2507 is now the local default (not Qwen3.8 Flash) — Flash stays a supported, switchable option.

Updated this branch accordingly:

  • LARGE_DEFAULT_MODEL_NAME now points at Qwen3-30B-A3B-Instruct-2507-GGUF (17.4 GB, a Lemonade built-in, no Lemonade-version floor of its own). FLASH_OPTION_MODEL_NAME (new) is user.Qwen3.8-Flash-Next-GGUF — registered and switchable via gaia config set default_model, no longer auto-selected.
  • Folded in feat(models): support Qwen3 30B A3B and compare it with Qwen3.8 Flash #4265's model registration and util/compare_local_models.py (closed as superseded — its "decide the default from measured data" premise is moot now that the default is a direct decision).
  • Worth flagging explicitly: because the new default is ~5x smaller than Flash, the hardware-fit check now also qualifies 24 GB dGPUs and 32 GB CPU-only boxes, not just 128 GB-class Strix Halo machines — confirmed and intended, not an accident of the swap.
  • Synced every doc that described the old default: CLAUDE.md, docs/guides/ai-providers.mdx, docs/reference/cli.mdx, the npm package's CHANGELOG.md/SKILL.md, and the TUI's recommended_models.json.
  • Fixed test_model_fit.py, test_compare_local_models.py, and test_init_command.py assertions that assumed Flash-specific behavior (version gate, registration kwargs, the narrower fit boundary) now belongs to whichever model is actually configured.

Still outstanding, unchanged from the original PR: the gaia eval agent run on real Strix Halo hardware (rag_quality vs. the Gemma baseline) — this default-model change still needs it before merge, and it needs the actual hardware to run.

Local verification: full test_model_fit.py + test_compare_local_models.py + test_init_command.py (203 passed), go build/go vet/go test ./... in tui/ (all green), python util/lint.py --all clean, python util/check_doc_links.py passed (2518 links, 0 broken).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::email Email agent changes agents cli CLI changes cpp devops DevOps/infrastructure changes documentation Documentation changes llm LLM backend changes performance Performance-critical changes tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants