What this gives you
GAIA normally runs models Lemonade loads on your own machine. The AMD LLM gateway hosts models too large for a laptop — a Gemma-4-31B-class on-prem model, and frontier models like Claude — behind one OpenAI-compatible endpoint. Connecting it means every GAIA agent can use those models with no code change: they appear in Lemonade’s model list alongside your local ones, andgaia chat,
gaia llm, and the TUI address them the same way. That also makes it possible to run
the same task through a GAIA agent and through another tool on the same model, and
compare the results directly.
Requires Lemonade Server 11.8.0 or newer, which added cloud offload. Run
gaia init to upgrade.Where your token is kept
You enter it once. GAIA remembers it in your OS credential store — DPAPI on Windows, Keychain on macOS, SecretService on Linux — so it is encrypted at rest and scoped to your user account. GAIA refuses to fall back to a plaintext keyring backend, so it cannot quietly become a readable file. It is never written to a GAIA file.~/.gaia/gateway.json records the base URL,
which models you enabled, and what GAIA learned about them, and has no field a secret could occupy.
Lemonade itself holds the token in memory only and forgets it on restart. GAIA notices
and restores it from the credential store, which is why you are not asked again.
LEMONADE_AMD_API_KEY in Lemonade’s environment still works and takes precedence.
If it is set and you supply a different token, Lemonade refuses with a clear error
rather than silently picking one.
Connect from the TUI
Type/gateway in chat (or pick it from the / command palette).
1
Confirm the gateway URL
The OpenAI-compatible base URL, e.g.
https://llm-api.amd.com/Unified/v1. GAIA tests it
before registering, so a wrong path fails immediately with the actual HTTP status
instead of showing up later as an empty model list.2
Paste your token
The field is masked. GAIA sends it to Lemonade and keeps no copy.
3
Done — a model is already selected
GAIA picks
DeepSeek-V4.1-Flash for you and makes it the default. GAIA’s
agent path streams, so the default has to be a model the gateway streams, and
this one does; it is also the fastest model on GAIA’s agent benchmark. If your
gateway doesn’t offer it, GAIA picks Gemma-4-31B, which streams too and is
on-prem, so it costs nothing per token.To use a different one: space enables a model, enter makes it
active. Preferred models are marked * and sorted first. A model whose last call
returned “not found” is marked (unavailable) and is never picked for you.Connect from the CLI
gaia gateway test names the model it is testing. If the gateway answers “not found”
(HTTP 404) for it, the test names the model and a few deployed ones to switch to with
gaia gateway use <id>.
gaia gateway status shows registration, auth state, discovered model count, your
current selection, and whether the active model’s last call failed.
When a model stops being served
Gateways retire and rename models. When a call to a gateway model returns HTTP 404, GAIA records it in~/.gaia/gateway.json with the time, and a later successful call
clears it. GAIA never switches to another model on its own; it tells you instead:
gaia chat,gaia llm, andgaia promptprint one warning line when your saved default model is the one that failed.gaia gateway statusandgaia gateway modelsmark it unavailable.- The TUI’s
/gatewayscreen marks it(unavailable), says so under the list when it is the active model, and never auto-selects it. - A chat turn in the Agent UI or the TUI ends with an error that names the model and
says retrying won’t help. The Agent UI points you to its model menu (or to
Settings > Advanced > Custom model ID if you typed the ID there); the TUI points
you to
/model.
Gateways with a different auth header
The default isOcp-Apim-Subscription-Key with no prefix, because AMD’s gateway
runs behind Azure API Management and that is the header it checks.
So a plain OpenAI-compatible endpoint expecting a bearer token is the case that needs
the override — not the other way round:
Using gateway models
Gateway models are namespacedamd.<model> and work anywhere a local model does:
Models that cannot stream
For some models the gateway accepts a streaming request and then sends no tokens, while the same prompt works non-streaming.DeepSeek-V4.1-Flash and
Gemma-4-31B stream. Nothing in the catalog advertises this, so GAIA learns it the
first time it happens: it tells you the gateway did not stream that model,
answers the turn without streaming, and remembers the model in
~/.gaia/gateway.json so later turns skip straight to the working path. You see
one delayed first answer per model, then normal speed.
This is why the default is a model that streams: DeepSeek-V4.1-Flash, or
Gemma-4-31B when the gateway doesn’t offer it.
Troubleshooting
What the gateway offers
76 models, verified live. Measured latency and throughput on a 120-word generation:Gemma-4-31B streams at 78 TPS with 1.8s to first token, and DeepSeek-V4.1-Flash
streams too. Streaming returns no tokens for some other models, while
non-streaming works for all of them — a gateway-side limitation, not a GAIA one.
Every chat model on this gateway — Claude included — is served over OpenAI Chat
Completions, not the Anthropic Messages format. That is why GAIA registers the
provider with wire_format: openai and why Claude models work through the ordinary
agent path with no special handling.
Disconnecting
logout does not unset LEMONADE_AMD_API_KEY — if that is set in Lemonade’s
environment, unset it there and restart Lemonade.