5. Models, agents and routing

The Models page on the demo machine, where the agents are stand-ins: on your machine the two coding agents show as installed.
Agents#
Agent steps run on one of two command-line agents:
- Claude Code — uses your Claude login (or an API key).
- Codex — OpenAI's Codex CLI with your ChatGPT login. Install it with
npm i -g @openai/codex(or use the one inside the ChatGPT desktop app) and runcodex login.
The Coding agents panel shows whether each is installed and logged in.
Model specs#
Wherever you can pick a model — a step, a flow's defaults, a routing rule, an eval — you write a model spec:
| Spec | Runs on |
|---|---|
sonnet, opus, haiku | Claude Code, Anthropic |
codex | Codex, its default OpenAI model |
codex:gpt-5 | Codex with a specific model |
ollama:qwen3-coder:30b | Claude Code on a local Ollama model |
codex:ollama:gpt-oss:20b | Codex on a local Ollama model |
lmstudio:<model> | Claude Code on LM Studio |
You can also set Agent and Provider separately on a step.
Providers and local models#
Anthropic, OpenAI, Ollama (localhost:11434) and LM Studio (localhost:1234) are built in.
Add your own (another Ollama host, or any Anthropic-compatible API) under Add a provider.
Local models cost nothing and keep your code on your machine; runs record them at $0. Choose
models trained for coding and tool use (e.g. qwen3-coder, gpt-oss) — general chat models
often fail to call tools. Use Try a model to check one works before you rely on it.
One provider. Each provider in the list is a link; it opens at #/models/<name> (Administration › Models › name). The page shows the status, the models and the agents that use it, its settings (kind, base URL, API key env var, default model) with Save provider, a Try a model box that starts on this provider, and Use in routing: the default model, rules and fallbacks that use it, with a link back to the Models page, where routing is still changed. Remove provider is in the Danger group, only for providers in your config, and asks first. A built-in provider keeps its kind; saving adds an override with the same name. A name that is not a provider shows "This provider is not set up." with a link back. Saves send the same config as before.
Routing#
Rules decide which model runs which step. The first matching rule wins — even over models
written in flows and blocks. A rule matches on a step id pattern, a flow name pattern and/or a
visit number (From visit 2 = only retries). The presets add common rules:
- Retries on Opus — fix steps use Opus from their second attempt.
- Codex reviews Claude's code — review steps run on Codex.
- Small jobs on a local model — triage and learning steps run locally.
Without a matching rule, a step uses its own model, then the flow's default, then the Default model.
Fallback models are tried in order when a model hits a rate or usage limit. With continue on the first free one when a budget runs out, runs switch to the first free fallback (local or ChatGPT) instead of pausing when the daily or run budget is used up.