Getting started
Models and providers
Connect a model provider and decide which model runs each job.
Dive never names a model in an agent, plan or tool. They name a role, such as chat or judge, and config.toml maps each role to a provider and a model.
version = 4
[providers.anthropic]
type = "anthropic"
api_key = "${ANTHROPIC_API_KEY}"
[providers.openai]
type = "openai"
api_key = "${OPENAI_API_KEY}"
[models.default]
provider = "anthropic"
model = "claude-sonnet-5"
fallbacks = [{ provider = "openai", model = "gpt-5" }]
[models.judge]
provider = "anthropic"
model = "claude-haiku-4-5"
[models.repair]
provider = "anthropic"
model = "claude-haiku-4-5"
[models.fast]
provider = "anthropic"
model = "claude-haiku-4-5"
description = "Fast and cheap. Short, self-contained tasks such as one line per item in a map."
[pricing."claude-sonnet-5"]
input = 3.00
output = 15.00
[pricing."claude-haiku-4-5"]
input = 1.00
output = 5.00Providers
A provider is a connection to a model API, written as [providers.<name>]:
type | Connects to |
|---|---|
anthropic | The Anthropic API |
openai | The OpenAI API |
openai_compat | Any OpenAI-compatible endpoint, such as Ollama, vLLM or a gateway, at base_url |
systemone | A decision model |
gemini | The Gemini API, for image models |
api_key = "${ANTHROPIC_API_KEY}" reads the key from the environment or, when it isn't set there, from the OS credential store, so the file is safe to commit. dive secret set ANTHROPIC_API_KEY stores the key there; see Secret references.
Roles
[models.<role>] maps a role to a provider and a model. Agent files, agent steps, prompt tools, builtin__infer and infer conditions select a role by name. Dive's own model calls use these roles:
| Role | Used for |
|---|---|
chat | Agents. Every built-in agent uses it, except the drafting architects and the workbench's builders |
architect | The drafting architects, network_drafter and network_editor: the interview, the design, and running the builders |
drafter | The workbench's builders, which draft each tool, plan and agent the drafting architect sketches |
planner | Drafting plans |
outliner | Listing a goal's inputs and steps before the planner drafts |
solver | Writing the answer for a plan that finishes with solver |
repair | One retry when a model's structured output doesn't parse. When a prompt tool's output is missing required fields, the same model is first asked again with the original messages, so it can fill them in from what it saw; the repair role then fixes whatever is still wrong, from the output and the schema alone. Output cut off at the model's output limit is never repaired: the call fails with an error naming the limit |
judge | infer conditions on exit, route and filter |
decider | decide conditions and tool search. Needs a decision model |
image | builtin__generate_image. Needs an image model |
A role with no entry uses default, except decider and image. No role falls back to another role first, so architect and drafter use default rather than chat until you set them. Put a cheaper model on the roles that run most often, such as judge and repair.
Custom roles
Any other name under [models] is a custom role, such as fast. A custom role never uses default, so a name that isn't configured fails and lists the roles that are.
Every role has a type: chat, decision or image. A custom role is a chat role unless it says otherwise, and its provider must serve that type:
[models.triage]
type = "decision"
provider = "typesafe"
model = "jev-latest"Standard roles have a fixed type: decider is decision, image is image, and the rest are chat. Once a role is saved its type stays: the agents, plans and tools that use it expect that kind of model, so Settings and dive's model commands refuse to change it. Add a new role for another type instead. Dive never works out a role's type from its provider or model, so a config that puts a role on a provider of the wrong type fails to load and names the fix.
Drafters see every role, with its model, type and description, when they pick a model for an agent or step, and the description steers them toward the smallest model that fits. Standard roles have built-in descriptions, and a description you set replaces it. A prompt tool's model input, and builtin__generate_image's, offer every role of the matching type that resolves and has a description, including standard chat roles such as solver that fall back to default because you haven't set them. They leave out architect, planner, outliner, drafter and repair unless you describe them yourself. The input appears once the offered roles use at least two different models. Settings edits a role's description alongside its model; clearing it there removes the line.
Fallbacks
fallbacks on any role, standard or custom, lists other models to try, in order, when the role's provider is down. Dive moves to the next one only after the provider's own retries run out, and only on errors that look like an outage. A bad request fails right away. Each fallback names its own provider and model.
Images
A role takes images unless it sets images = false. Every model that reads a file reference gets the image with its request, so set false on a role, or on one of its fallbacks, whose model only reads text. That model gets a note naming the images instead, and plan validation reports a step that sends one a file:
[models.judge]
provider = "local"
model = "qwen3:8b"
images = falseThe setting is per model in the chain. When a role that takes no images fails over to a fallback that does, the fallback gets the images, and the other way round. That holds for agents on the role too: one whose role and fallbacks all take no images never loads the files it sees. Plan validation checks agent__<name> steps against the agent's model role as well as infer, decide and prompt-tool steps.
Decision models
A decision model answers a question about a piece of data with a probability instead of text, faster and cheaper than a chat model. Connect one with a systemone provider, which defaults to TypeSafe's API, and map it to decider:
[providers.typesafe]
type = "systemone"
api_key = "${TYPESAFE_API_KEY}"
[models.decider]
provider = "typesafe"
model = "jev-latest"Decision models run decide conditions, decision tools such as builtin__decide, and tool search when Dive drafts a plan. Without one, tool search ranks tools by keyword. Dive never swaps a chat model for a decision model or the reverse, and refuses a config that maps one to the other's role.
A decision model reads images too. When a decide condition's state or question, or a decision tool's input, holds a file reference, Dive sends the image to TypeSafe with the request, as an asset the reference names, and adds the TypeSafe-Danger-Zone-Images: true header that TypeSafe needs for images. Requests without images are sent exactly as before. TypeSafe takes PNG and JPEG between 280 and 1568 pixels a side, so Dive converts GIF and WebP to PNG, scales a larger image down, pads a smaller one with white, and applies a photo's EXIF rotation. An image Dive can't read or convert is left out and the decision goes ahead with the reference text, and when the images together would be over TypeSafe's 32 MiB request limit, Dive leaves out the largest until the rest fit. TypeSafe's images support is in preview and needs a Jev model that accepts images; set images = false on a decision role whose model doesn't.
Image models
An image model draws or edits images for builtin__generate_image. Connect one with a gemini provider, which uses the Gemini API's Interactions endpoint, and map it to image:
[providers.gemini]
type = "gemini"
api_key = "${GEMINI_API_KEY}"
[models.image]
provider = "gemini"
model = "gemini-nano-banana-2.1"builtin__generate_image appears in the tool catalog once an image role is configured. Agents use it like any other tool by listing it, and plans call it as a step. It takes a prompt, optional images to edit, aspect_ratio, size, count and path, and returns each image as a file ref such as blob:sha256-….png. Once you add a second image role, such as a custom role with type = "image", the call's model input lets agents choose between them by description. See Work with files for where the files are stored.
What a run cost
dive ask, dive chat and dive plan run print a usage line on stderr after each run:
1 call · 53k in / 10 out · $0.20Dive ships no prices. Add [pricing."<model>"] with input and output prices in US dollars per million tokens, or the line shows tokens only. Image models bill the tokens of the images they draw at output_image, which falls back to output when unset. See config.toml for every key.
Some models charge more once a prompt passes a size. Claude Haiku 5.5, for example, costs five times as much per token for a prompt over 100,000 tokens. Add a tier for each threshold:
[pricing."claude-haiku-5-5"]
input = 0.10
output = 0.50
cache_read = 0.01
[[pricing."claude-haiku-5-5".tiers]]
above = 100_000
input = 0.50
output = 2.50Dive prices each call on its own. A prompt's size counts its input, cache-write and cache-read tokens. A call whose prompt has more tokens than a tier's above pays that tier's rates for every token, output included. A tier that leaves out a cache rate scales it from the base rate by the same factor as input.
The desktop app fills these entries for you from the models.dev catalogue, tiers included, and marks them source = "models.dev". For a Gemini image model it sets output_image to the catalogue's image rate and output to the model's text rate. Its refresh updates only entries with that mark, so a price you edit by hand stays as you set it.