Skip to content

fix(tui): first-run setup as steps; "ready" only once the models load - #4459

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:kalin/first-run-steps
Sep 29, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:kalin/first-run-steps

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

A new user's first screen looked like an error, and setup said "everything checks out" while document search and memory were dead. Now first-run items are neutral numbered steps with one key (Enter). Setup shows plain progress on the row it's working on. "Ready" is only reported after the models have actually loaded once, and the ready screen names the chat model and its size.

The embedder failure had a real root cause, found on Strix Halo from a cold GAIA_HOME. GAIA's private Lemonade was started without GGML_VK_DISABLE_COOPMAT, so llama.cpp's Vulkan backend crashed on the first embedding. This hit EmbeddingGemma too, not just nomic. Every installer launch path already sets the variable; the embedded launcher now does as well. Separately, the GPU/CPU embedder default still named nomic, which gaia init never downloads.

  • Load check: gaia init --check --load loads each model once and exits 3 when a downloaded model won't load. A model that won't load is a red, named failure; if only the embedder fails, you can still press Enter to start without it.
  • Stopped server: the gate now recognises GAIA's own stopped server and auto-starts it, instead of calling it "not installed".
  • Download size: the gaia/chat/rag profiles download about 6 GB (measured), not 4 GB.

Test plan

  • go vet ./... && go test ./... in tui/ pass. The new rendered-frame tests cover neutral steps (no failure colour), Enter starting a step, progress on the row, log lines never shown, the header following the running step, the named chat model on the ready screen, and a load failure shown as a failure.
  • pytest tests/unit/test_init_command.py tests/unit/installer tests/unit/test_lemonade_embedded.py tests/unit/test_npu_flm_embedder.py: new tests pass. The failures in this run (install scripts under dash, uninstall on POSIX, and 11 in tests/test_lemonade_client.py that hit a live server) are identical on main.
  • python util/lint.py --all: black, isort and flake8 pass. The only pylint errors are two Windows-only false positives in untouched files.
  • Live drive on Strix Halo through the control API. Each run started from a separate fresh GAIA_HOME, GAIA_CONFIG_DIR and HF_HOME: install, a 6 GB download, the load check, a first chat turn. Frames are below.
  • Upgrade case: a server left running by main (no coopmat setting) makes the gate show "user.embeddinggemma-300m-GGUF will not load". Following the on-screen remedy (gaia lemonade embedded stop, then r) auto-restarts the server, the models load, and the gate hands off.
  • gaia eval agent --category rag_quality: not run. RAG now uses EmbeddingGemma on GPU/CPU, where it previously failed to load at all, and there is no flagship baseline to compare against yet.
Before / after frames (cold state, Strix Halo)

Before (main): first screen, then setup, then a false "ready"

  > [!]   Lemonade            not running
          GAIA needs Lemonade to run local models or route chat to your chosen provider.
          Press f and setup installs and starts it. Already have it? Install the local model server first —
          it is not on this machine. `gaia init` sets it up, then press r to re-check.
          f set it up now
          or run: gaia init
          look:   https://amd-gaia.ai/docs/guides/install

  ⣾  [2026-09-29 00:24:41] | INFO | gaia.llm.lemonade_embedded._download | lemonade_embedded.py:486 | Downl…
  Getting GAIA ready                                                                                   ready
    [ok]  Language model      downloaded
  Setup finished and everything checks out. Press enter to start GAIA.

The first turn ("Remember that my favorite color is teal.") had no memory tool: 125 s, nothing stored. The agent log:

ERROR | gaia.llm.lemonade_client | Error generating embeddings: Request failed with status 500: {"error":{"code":"model_load_error","message":"Failed to load model 'nomic-embed-text-v2-moe-GGUF': llama-server failed to start"

After: first screen

  Setting up GAIA                                                                      step 1 of 2
  ────────────────────────────────────────────────────────────────────────────────────────────────
    [ok]  GAIA agent          C:\Users\Kalin\Work\gaia\.venv\Scripts\gaia-agent.exe
  > [ ]   Lemonade            Step 1 of 2 — install the local model server (~1 min)
          Lemonade runs AI models on this machine and routes chat to the provider you pick. Setup
          installs it privately for GAIA — nothing system-wide.
          enter start step 1
    [ ]   Language model      Step 2 of 2 — download the models (~6 GB)
  ────────────────────────────────────────────────────────────────────────────────────────────────
  enter start step 1 · p AI provider · r re-check · d details · esc back

After: during setup

    [..]  Lemonade            ⣯  downloading the local model server…
    [ ]   Language model      Step 2 of 2 — download the models (~4 GB)

  ⣯  Step 1 of 2 — downloading the local model server · 1% · 0:01
  Setting up GAIA                                                                      step 2 of 2
    [ok]  Lemonade            done
    [..]  Language model      ⣟  downloading Gemma-4-E4B-it-GGUF…

  ⣟  Step 2 of 2 — downloading Gemma-4-E4B-it-GGUF · 0:00

(The "~4 GB" is from the build before the size correction.)

After: ready

    [ok]  Language model      Gemma-4-E4B-it-GGUF (5.6 GB) and the embedder load
  Setup finished and the models load. Chat runs on Gemma-4-E4B-it-GGUF (5.6 GB, on this machine).
  Press enter to start GAIA.

The same first turn: "Got it. Teal noted down in your preferences." in 34 s. The memory DB holds the fact with an embedder_id of user.embeddinggemma-300m-GGUF, and the agent log has no errors.

After: a server left running by the old build

  > [!]   Language model      user.embeddinggemma-300m-GGUF will not load
          It is downloaded, but the model server could not start it, so document search and memory
          will not work. Chat still does.
          Stop GAIA's model server, then press r — it starts again with current settings. If it
          still fails, attach the output of `gaia diagnostics` to a bug report.
          run:    gaia lemonade embedded stop
          look:   https://github.com/amd/gaia/issues

  Waiting — Language model is not working (user.embeddinggemma-300m-GGUF will not load). Press
  enter to start without it, or fix it first.

After following the remedy:

    [ok]  Lemonade            started for you, running at http://localhost:57062/api/v1
    [ok]  Language model      Gemma-4-E4B-it-GGUF (5.6 GB) and the embedder load

  Starting GAIA — chat runs on Gemma-4-E4B-it-GGUF (5.6 GB, on this machine)…

@github-actions github-actions Bot added documentation Documentation changes llm LLM backend changes cli CLI changes tests Test changes performance Performance-critical changes agents agent::email Email agent changes tui Go terminal UI (gaia-tui) labels Sep 29, 2026
On Strix Halo, every GAIA-owned Lemonade started without
GGML_VK_DISABLE_COOPMAT, so llama.cpp's Vulkan backend crashed on the first
embedding ("llama-server failed to start"). Document search and memory were
dead on every fresh install, while chat worked. Every installer launch path
already sets the variable; the embedded launcher now does too.

The per-device embedder table also still named nomic-embed-text-v2-moe-GGUF
for GPU/CPU, a model `gaia init` never downloads, so RAG asked for it on the
first turn. It now uses the embedder setup actually installs.
…load

A new machine's first screen read as an error: red [!] rows, copy that said
both "setup installs it" and "it is not on this machine", three routes for one
action, and raw Python log lines scrolling through the status line while setup
ran. It then said "everything checks out" even when the embedding model could
not load.

- First-run items are neutral, numbered steps with one way forward (Enter);
  red is kept for real failures.
- While setup runs, the row it is working on shows it, and one plain line
  says which step, what it is doing, percent and elapsed time. Log output is
  kept for `d` only.
- `gaia init --check --load` loads each model once (chat at its context,
  embedder with a one-word embedding) and exits 3 when a downloaded model will
  not load. The gate uses it, reports a model that will not load as a real
  failure, and names the chat model and its size on the ready screen.
- The gate now recognises and auto-starts GAIA's own stopped server instead
  of calling it "not installed".
- The gaia/chat/rag profiles download ~6 GB, not ~4 GB.

Closes amd#4449
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 29, 2026
Merged via the queue into amd:main with commit 06a7d7c Sep 29, 2026
72 of 75 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/first-run-steps branch September 29, 2026 17:33
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
…emory (amd#4489)

Stale `nomic-embed-text` references outlived the switch to
EmbeddingGemma (amd#1952), and nomic crashes llama.cpp on Vulkan (amd#1831).
This removes them everywhere except where there's a reason to keep them
(listed below), and closes a gap where memory from before July 2026 kept
its nomic vectors and mixed them with EmbeddingGemma queries, quietly
degrading recall.

- **Legacy memory is now re-embedded.** Memory written before the
embedder was stamped holds nomic vectors with no marker, and startup
kept them. A missing marker now counts as an embedder change: vectors
are cleared with a logged warning and backfill re-embeds them. The
dashboard's rebuild button goes through the same path.
- **One live test was always skipping.** The code-index eviction test
loaded nomic as the competing embedder, which current Lemonade can't do.
It now evicts by unloading, so it actually runs.
- **Pairs with amd#4459**, which fixes the agent-registry default (the
fresh-install bug itself). The registry, the chat/email agent comments
and the registry tests are left to that PR to avoid conflicts. Once both
merge, the only nomic references left are the ones below.

**Kept on purpose:**
- `docs/releases/*`: release notes record what shipped.
- Migration notes in the memory SDK doc, memory spec and code-index
guide, plus the tests that seed a nomic-stamped store: they describe and
pin the upgrade path for existing users.
- `eval/results/phase2/scorecard.json` and
`eval/scenarios/memory/memory_journaling_report.py`: captured outputs of
past runs. Editing them would misstate what ran.
- `docs/plans/gaia-agent-latency.md` (captured `lemonade` output) and
`docs/plans/tool-loader.mdx` ("τ was calibrated against live nomic
embeddings"): they record past measurements. The second is also a real
caveat, because τ hasn't been re-checked against EmbeddingGemma.

RAG and code-index needed no migration. The RAG disk cache stores only
text and chunks, and a code index built with nomic already fails loudly
with a model-mismatch error. Retrieval for fresh installs is unchanged
(same default embedder), so no `rag_quality` eval was run.

## Test plan
- [x] `pytest` on the memory, memory-router, embedder, RAG-cache,
broker, stdio and email-wiring suites: 1422 passed. The one failure
(`test_memory_discovery` Outlook registry) fails identically on
`origin/main` on this machine.
- [x] `python util/lint.py --all`: black, isort, flake8 and bandit pass.
The two pylint errors (`os.getuid`, `signal.SIGKILL`) are Windows-only
and pre-existing.
- [ ] `build_cpp.yml` CI: the C++ vector-index tests only swap a string
literal, and there is no C++ toolchain on the machine this was written
on.
- [ ] Upgrade path: start the agent against a `memory.db` from before
July 2026 (no `embedder_id` in `meta`). Expect one `embedder changed
(unrecorded, pre-2026-07 memory -> user.embeddinggemma-300m-GGUF)`
warning and full embedding coverage afterwards.

Co-authored-by: Claude Opus 5.5 <[email protected]>
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
…say why memory failed (amd#4487)

On a Strix Halo (Radeon 8060S) the embedding model crashed Lemonade's
llama.cpp every time it loaded, so memory and document search were dead,
and GAIA said only that the service was unreachable. The cause is a
llama.cpp Vulkan cooperative-matrix bug on this GPU. Every Lemonade GAIA
starts now sets `GGML_VK_DISABLE_COOPMAT=1`, and when a model is
downloaded but won't load, GAIA says exactly that and how to fix it.

Refs amd#1831, amd#2831

- **The workaround:** `GGML_VK_DISABLE_COOPMAT=1` goes into the
environment of every Lemonade GAIA starts (embedded, modern install,
systemd hint for self-run servers). Skipped on macOS, which runs Metal.
- **Loud, specific failures:** memory distinguishes "Lemonade down",
"model not pulled" and now "model pulled but won't load", each with its
own fix. A load failure that outlives retries names the likely cause and
the remedy.
- The default embedder is EmbeddingGemma, and amd#4459 fixes the agent
registry that still pointed at `nomic`. Removing the remaining `nomic`
references is a separate task.

## Test plan
- [x] Verified live on the Strix Halo: `nomic-embed-text-v2-moe-GGUF`
failed to load on every attempt without the flag (0 successes in two
Lemonade instances), and with `GGML_VK_DISABLE_COOPMAT=1` returns a
768-dimension embedding.
- [x] `pytest tests/unit/test_lemonade_launcher.py
tests/unit/test_memory_mixin.py tests/unit/test_ui_gpu_detection.py
tests/test_lemonade_client.py`: no failures beyond those already on
`main` (integration tests that need a live Lemonade on :13305).
- [x] `go test ./internal/ui/preflight/`; `python util/lint.py --black
--isort`.
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 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.

2 participants