Skip to content

docs(models): point consolidated-agent defaults at Gemma-4-E4B - #2279

Closed
kovtcharov wants to merge 1 commit into
mainfrom
claudia/task-d1b7ddeb
Closed

kovtcharov wants to merge 1 commit into
mainfrom
claudia/task-d1b7ddeb

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Docs currently tell users the Docker, Jira, Routing, Blender and Code agents run on Qwen3.5-35B-A3B-GGUF, and walk them through downloading a 17 GB model — on Jira, with a note that it's "best run on a Strix Halo (or similar high-memory) device" — before those agents will work. Under the model consolidation those agents fall back to Gemma-4-E4B-it-GGUF at ~3 GB, which drops that prerequisite entirely. This updates the setup steps, --model defaults, spec headers and download-size guidance so a user following the guides installs the model the agent actually loads.

⚠️ Blocked — do not merge yet

The code change these docs describe has not landed. src/gaia/agents/base/agent.py:516 is still model_id or "Qwen3.5-35B-A3B-GGUF", and 28 non-test files across src/ and hub/ still hardcode the 35B model. I could not find a PR or issue for the consolidation.

Also worth a maintainer's eye: #1810 ("correct stale default-model comment (Gemma → Qwen3.5-35B-A3B)", merged 2026-06-22) deliberately moved this the other way, and lemonade_client.py:116 still carries # Do NOT change this to 35B — it would break CI tests and force large downloads in minimal setups. So the current Qwen default appears load-bearing and recently reaffirmed, not drift.

Merging this before the code change would make the docs contradict both the runtime and #1810. Draft until the consolidation lands; it should probably go in as part of that PR rather than ahead of it.

Test plan

  • Confirm the consolidation is actually intended, given fix(agent): correct stale default-model comment (Gemma → Qwen3.5-35B-A3B) #1810
  • Land the src//hub/ default change first, then rebase this
  • gaia docker "containerize this app" — loads Gemma-4-E4B, no 35B download prompt
  • gaia jira "show my open issues" — same
  • AGENT_ROUTING_MODEL unset → routing uses Gemma-4-E4B
  • Mintlify docs build passes and no navigation entries broke

Known-remaining (deliberately not in this PR)

  • docs/guides/docker.mdx:35,150 still recommend --ctx-size 8192 and call it "required". Against Gemma-4-E4B's min_ctx_size=65536 that reads as wrong, but fixing it means picking a value across ~10 sites (Code and Routing guides say 32768) — wanted a decision before sweeping it.
  • docs/sdk/sdks/agent-ui.mdx:1247,1388 document the sessions-table default as the 35B model; source is SESSION_DEFAULT_MODEL = "Gemma-4-E4B-it-GGUF". Wrong today, independent of this change.
  • docs/spec/rag-sdk.mdx:43 mirrors RAGConfig.model, still Qwen in source. Needs updating only if the consolidation also flips that default.

Docs still told users the Docker, Jira, Routing, Blender and Code agents
default to Qwen3.5-35B-A3B-GGUF, and instructed them to download a 17 GB
model before those agents would run. Under the model consolidation those
agents fall back to Gemma-4-E4B-it-GGUF (~3 GB), so the setup steps, the
--model defaults, the spec headers and the download-size guidance are all
updated to match. The stale "over 17 GB / best on a Strix Halo" prerequisites
in the Docker and Jira guides are corrected too, since leaving them next to
a 3 GB model would misstate the hardware bar for those agents.

Out of scope and left alone: Summarizer (Qwen3-4B-Instruct-2507), SD
(SDXL-Turbo), the VLM (Qwen3-VL-4B-Instruct), eval baselines, docs/plans,
tested-hardware statements, and examples that pin a model explicitly rather
than state a default.
@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes agent::blender Blender agent changes agent::docker Docker agent changes agent::routing Routing agent changes agent::jira Jira agent changes labels Jul 18, 2026
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Closing — superseded. This docs-only change is being folded into the branch that carries the actual code consolidation (base agent default, per-profile context constants, hub agent manifests), so the docs land together with the behavior they describe rather than ahead of it.

@kovtcharov kovtcharov closed this Jul 18, 2026
@kovtcharov
kovtcharov deleted the claudia/task-d1b7ddeb branch July 18, 2026 22:39
@kovtcharov
kovtcharov restored the claudia/task-d1b7ddeb branch July 18, 2026 22:40
@kovtcharov kovtcharov reopened this Jul 18, 2026
@kovtcharov
kovtcharov marked this pull request as ready for review July 18, 2026 22:58
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes — do not merge yet (which matches your own "Blocked" note on the PR).

This swaps every doc reference for the Docker/Jira/Routing/Blender/Code agents from the 17 GB Qwen3.5-35B-A3B-GGUF to the ~3 GB Gemma-4-E4B-it-GGUF, and rewrites the download-size guidance to match. The problem is the code consolidation these docs describe hasn't landed: in the PR-head tree, all five agents still default to the 35B model, so merging this would ship docs that tell users to install a model the agent won't actually load. A user following the Jira guide would download Gemma-4-E4B, then have the agent pull 35B on first run anyway.

The safe path is the one you already outlined: land the src//hub/ default flip first (or bundle these docs into that PR), then rebase. Also worth settling before merge whether the consolidation is even intended — #1810 recently moved this the other way and the code carries a "Do NOT change this to 35B" comment, so the current default looks deliberate, not drift.

🔍 Technical details

🔴 Docs would contradict runtime — every described default still resolves to 35B

Confirmed against the checked-out PR head, not just the description:

  • Base agent default: src/gaia/agents/base/agent.py:516 → model=model_id or "Qwen3.5-35B-A3B-GGUF", with a comment at :512-514 explicitly warning that small models are too weak for agent tasks.
  • docs/spec/docker-agent.mdx:71 sets DEFAULT_MODEL = "Gemma-4-E4B-it-GGUF", but hub/agents/python/docker/gaia_agent_docker/agent.py:25 is still DEFAULT_MODEL = "Qwen3.5-35B-A3B-GGUF".
  • docs/spec/jira-agent.mdx:73 sets model_id: str = "Gemma-4-E4B-it-GGUF", but hub/agents/python/jira/gaia_agent_jira/agent.py:128 still defaults to "Qwen3.5-35B-A3B-GGUF".
  • docs/guides/routing.mdx:108-111 says AGENT_ROUTING_MODEL defaults to Gemma-4-E4B, but hub/agents/python/routing/gaia_agent_routing/agent.py:68 reads os.getenv("AGENT_ROUTING_MODEL", "Qwen3.5-35B-A3B-GGUF").
  • Blender: hub/agents/python/blender/gaia_agent_blender/__init__.py:50 → models=["Qwen3.5-35B-A3B-GGUF"].
  • CLAUDE.md:9 (this diff) now claims the base default is model_id or "Gemma-4-E4B-it-GGUF" — directly contradicted by agent.py:516 above.

The spec-doc changes are the sharpest problem: docs/spec/*.mdx present these as verbatim class attributes, so they're not "guidance drift" — they're a code snippet that no longer matches the class it quotes. git grep -n "Qwen3.5-35B-A3B-GGUF" src hub -- '*.py' returns 37 non-test hits, and src/gaia/llm/lemonade_client.py:116-118 reaffirms the 35B agent default with a "Do NOT change this" comment.

🟡 docker.mdx internal inconsistency introduced by this diff

docs/guides/docker.mdx:39 still instructs lemonade-server serve --ctx-size 8192 and :47 calls 8192 "required," now under a Gemma-4-E4B-it-GGUF heading — and Gemma-4-E4B's min_ctx_size is 65536, so 8192 reads as wrong the moment the model name changes. You flagged this as known-remaining; noting it only because it's in a section this PR touches, so the guide ships self-inconsistent if merged as-is. Fine to defer with the rest of the ctx-size sweep.

Strengths

  • Self-flagging the PR as blocked with the exact source lines and the fix(agent): correct stale default-model comment (Gemma → Qwen3.5-35B-A3B) #1810 counter-history is exactly right — this caught the contradiction before it shipped.
  • The prose rewrites (17 GB / "Strix Halo required" → ~3 GB / "quick on most connections") are accurate for Gemma-4-E4B and well-targeted; they'll be correct verbatim once the code lands.
  • Scope is clean: pure doc/string changes, no drive-by edits.

@kovtcharov kovtcharov closed this Jul 18, 2026
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 19, 2026
… size (amd#2284)

Switching agents used to evict and cold-reload the model. Agents that
left `model_id` unset fell back to `Qwen3.5-35B-A3B-GGUF` while chat and
email used `Gemma-4-E4B-it-GGUF`, so moving between them forced a full
unload/reload — **7.9s measured** on a warm Lemonade. Every agent now
shares one model id and one context window per device profile, so the
resident model is reused: **three consecutive agent switches cost 0.00s
each with the llama-server pid unchanged**.

> [!IMPORTANT]
> **Depends on amd#2283, and the eval gate is not green yet.** The eval
workflow now lives in amd#2283 (this branch previously added the same path
— that copy was dropped to avoid a hard conflict). **amd#2283 must merge
first**, then dispatch `Agent Eval — Gemma-4-E4B consolidation` against
this branch as the merge gate. CLAUDE.md requires that run for
LLM-affecting changes. Partial results so far: `budget_query` **baseline
9.95 → 9.90** (flat). No full category has completed.

### What was checked empirically, not assumed

`max_loaded_models` was going to be added to keep the LLM and embedder
co-resident. Measuring `/api/v1/health` on Lemonade 10.10.0 showed it is
unnecessary:

```
"max_models":    {"llm": 1, "embedding": 1, "reranking": 1, ...}   <- PER TYPE
"pinned_models": {"llm": 0, "embedding": 0, ...}
```

Capacity is accounted per model *type*, so an LLM and an embedder are
already co-resident at default config; setting the knob to 2 would
license a second *LLM*, not the pair. Forcing an LLM swap confirmed it —
the LLM pid turned over while the embedder held the same pid throughout.
**So the knob was not added**, and the behaviour is pinned by tests
instead.

Related: Lemonade runs one `llama-server` subprocess per model on its
own port (8001/8002 observed), so there is no single global "slot" to
raise.

### Notes for review

- **A flat `rag_quality` will not mean "no impact."** Most of its
scenarios run the `doc` agent, which comes from `hub/agents/python/chat`
and was *already* on Gemma. The scenarios that actually exercise this
change are `csv_analysis` (the `data`/Analyst agent, previously Qwen
35B) and the `tool_selection` set. Regressions there are the accepted
35B→4B tradeoff.
- **Context is per device profile, not one global number.**
`GPU_CTX_SIZE` (65536) and `NPU_CTX_SIZE` (32768) — the NPU's FLM build
cannot load above 32768, so collapsing them would either break NPU or
cap GPU doc-Q&A at 32K and reopen amd#1030. Measured no latency cost from
the larger window: median 1.4s @65536 vs 1.5s @32768 on an identical
1631-token prompt.
- **The amd#1744 NPU backend-matching is preserved** — the NPU device
config keeps `embed-gemma-300m-FLM` so chat and embeddings stay on the
same backend.
- **Out of scope, unchanged:** Summarizer's
`Qwen3-4B-Instruct-2507-GGUF`, SD's `SDXL-Turbo`, voice models,
`Qwen3-VL-4B`. The two legacy Qwen entries in the `MODELS` registry stay
so existing pinned sessions keep resolving.

### Two findings from the first runner execution

Worth carrying into amd#2283, since they are properties of the eval, not of
one workflow file:

1. **The eval needs the `chat` and `analyst` hub agents installed.**
Scenarios select their agent via `agent_type` — 15 request `doc`, one
requests `data`. `doc`/`chat`/`file` come from the **chat** package's
entry points, *not* from `docqa` (which registers as `docqa` and no
scenario requests). Without them every scenario fails to resolve an
agent and the run reports a catastrophic regression that never happened.
A pre-flight assertion that `doc` and `data` are registered turns that
into a 60-second loud failure.
2. **Windows PowerShell 5.1 chokes on non-ASCII in inline `run:`
blocks** — em dashes produced `The string is missing the terminator`.
Keep inline PowerShell ASCII-only.

### Follow-up (not in this PR)

- amd#2279's branch held a further docs pass — measured download sizes
(Gemma is **5.56 GB**: 4.64 GB weights + 0.92 GB vision projector;
`nomic-embed` 0.48 GB), correcting stale `~3 GB`/`18.6 GB`/`25 GB`
claims across the EMR guide, profile tables and hardware-advisor
playbook. That PR is now closed, so **this work is stranded on a closed
branch and should be re-landed.**
- **`device.py`'s `_MIN_GPU_VRAM_GB = 24.0`** is deliberately untouched.
Its rationale — "24 GB to fit Qwen3.5-35B (~17 GB)" — is now obsolete:
Gemma-4-E4B measures 5.56 GB, and `LITE_MIN_MEMORY_GB = 5.0` is
precedent for a lower bar. Lowering it changes the hardware support
matrix, which is a product call rather than a side effect of a model
swap.

## Test plan

- [ ] Merge amd#2283 first, then dispatch its `Agent Eval — Gemma-4-E4B
consolidation` workflow against this branch. **This is the merge gate.**
- [ ] In that run, confirm the log shows `doc` and `data` registered
before any scenario executes.
- [ ] Review the per-category diff, focusing on `csv_analysis` and
`tool_selection` for the expected 35B→4B regression; decide whether to
refresh baselines with `--save-baseline` and re-dispatch with `enforce:
true`.
- [ ] `python -m pytest tests/unit/ -q` — 6786 passed post-rebase; 5
failures are pre-existing on a clean `main`
(`test_file_write_guardrails`, 3x `test_init_command`,
`test_memory_router`).
- [ ] `python util/lint.py --all` — passes.
- [ ] On a machine with Lemonade: `python -m pytest
tests/integration/test_lemonade_model_residency.py -v` — 4 passed
against live Lemonade 10.10.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::blender Blender agent changes agent::docker Docker agent changes agent::jira Jira agent changes agent::routing Routing agent changes devops DevOps/infrastructure changes documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant