Skip to main content
Blitz
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Models

Spec: models.

With no model set, Blitz uses Gemini’s gemini-4-argon (for chat and for Google web searches). Choose another with /model provider/model in a session, --model, or model under [llm.<provider>] in the settings; a model you’ve set is kept across releases. Setting up a provider, its key or sign-in, is in Providers.

Switching models in a conversation

In the desktop app, the status bar shows the agent and the model as two buttons. Click the model for every model of every provider you’ve set up, grouped by provider, each with its price per million tokens, its context window, and “no tools” when it can’t call them; with many models, type to filter. Choosing one moves the conversation to it (before your first message, the workspace’s default), Use for new chats in this workspace makes it the default, Refresh the list asks the providers again, and a provider you haven’t set up has Set up. Ollama is listed whenever it runs on your computer. Only models that hold a conversation are listed: embeddings, image, video and speech models aren’t (Pictures has the image models).

In the terminal, /model on its own opens the same list (type to filter), /model --refresh asks the providers again, and /model provider/model moves the conversation you’re in to that model from its next turn; your other conversations, and jobs, keep theirs. Blitz says what the move costs: the new model reads the conversation again from the start, with none of it cached (“From the next turn, anthropic/claude-opus-5-5 reads this conversation again: about 84k tokens, $0.42.”). If the conversation is too long for the new model, it’s summarised first. /model provider/model --new starts a fresh conversation on the model instead, which costs nothing to switch. /model on its own shows the conversation’s model and the workspace’s.

What carries over: everything said, every tool call and its result, and your attachments. What doesn’t: the previous model’s hidden reasoning, which only the model that wrote it can read (it’s kept, so switching back picks it up again). Moving from a stronger model to a weaker one mid-task can cost quality, since the weaker one picks up a long, complex conversation; a new conversation with a short summary of where you are often works better.

An agent with a pinned model keeps it (Per-agent models). A fallback model that takes over in the middle of a turn goes on from the calls the first model made.

Resilience

Model requests are retried on rate limits, overload, 5xx responses and dropped connections, with exponential backoff that honours Retry-After (llm.max_retries, default 3; 0 turns retries off). A request that sends nothing for llm.stall_timeout_seconds (default 600) fails instead of hanging the turn. A connection that stops answering altogether, as when a VPN or a network change drops it, is noticed within a minute and the request is retried on a new one. A stream that fails partway through isn’t retried, because its text has already been shown. At most tools.max_parallel (default 8) tool calls from one model response run at once.

Listing models

blitz models asks each provider you’ve set up which models it offers, and shows the price Blitz knows for each; blitz models anthropic asks one.

Fallback models

If the model fails before answering (after its retries), for any reason (an outage, a rate limit, a bad key, a model name it doesn’t know, a conversation too long for it, your organization’s budget), the next one in llm.fallback_models answers instead. Stopping a turn never switches models:

[llm]
provider = "gemini"
fallback_models = ["anthropic/claude-sonnet-5", "gemini-3.5-flash-lite"]

Each provider uses its own credentials. A failed model is skipped for 15 seconds, doubling up to 5 minutes, then tried again. You see one notice when a fallback takes over, naming the primary’s error so a broken key or a mistyped model doesn’t go unnoticed, and one when the primary is back, and cost is priced by the model that answered. For OpenRouter names that contain a slash, write the provider first: openai/anthropic/claude-sonnet-5.

Per-agent models

Agents can run on different models, for example a cheaper one for reviews:

[agent_models]
qa = "anthropic/claude-haiku-4-5"

A pin wins over an agent’s own default_model, and both win over the configured model. Pinned agents keep the fallback chain. /pin_model and /unpin change pins and save them in the workspace’s own settings (~/.blitz/workspaces/<name>-<hash>/.env.toml), so each workspace keeps its own: a pin there wins over one in the global settings, and /unpin of an agent the global settings pin saves agent = "", which masks the global pin in that workspace only. Pins in the global .env.toml apply to every workspace that doesn’t set its own.

Per-model settings

[model_settings."gpt-5"]
temperature = 0.3
top_p = 0.9
max_tokens = 4096
seed = 7

[model_settings."claude-opus-5-5"]
reasoning_effort = "high"   # minimal, low, medium, high or max
thinking_budget = 16000     # 0 turns thinking off

Current Claude models (Opus 4.7 and later, Sonnet 5, Fable) decide how much to think themselves and take no budget: on them thinking_budget turns thinking on at the effort it stands for (up to 4096 low, 16384 medium, 65536 high, beyond that max), unless reasoning_effort is set. Opus 5.5 and Fable always think, so 0 can’t turn it off there; /model_settings says so.

The key is the model name. Every model uses its own settings: the main model, pinned agents, and each fallback. /model_settings gpt-5 temperature=0.3 changes them from the next model call and saves them. A setting the provider doesn’t accept is left out of the request, and /model_settings warns.

/effort high (or --effort high) sets the reasoning effort for every model call in the session, over each model’s own (minimal, low, medium, high, xhigh, or max); /effort auto goes back to them. For automatic tier routing, dynamic effort dialing, and cost-per-task savings, see Model tiering & savings.

The optimizer

The optimizer is experimental and off by default. /optimize coding (or /optimize on), in the terminal or the desktop app, turns it on for the current conversation, and Blitz warns that it may reduce the agent’s accuracy. From the next model call it sends less:

  • Prompts lose filler such as “Hi, could you please…”, “Thanks so much!” and a closing “, please”. In general mode, runs of whitespace in prose also collapse and JSON is minified. In coding mode only trailing spaces go besides the filler. Code blocks, inline code, stack traces, file paths and pasted content are never changed.
  • Tool output from shell commands, background processes, web_fetch and MCP tools loses terminal colour codes, progress-bar redraws, extra blank lines and repeated lines. Output over the budget keeps its first 30% and last 70%, so an error at the end survives. read_file, search and edit results are left alone.

/optimize tokens 4000 sets the tool output budget in estimated tokens (2000 by default), /optimize filler off keeps prompts’ wording, and /optimize shows the settings. Only what is sent changes: the conversation keeps everything, so /optimize off restores the full context from the next call. Each conversation keeps its own settings, and snapshots carry them. With telemetry on, blitz.optimizer.chars_saved counts what was saved.

What Blitz learns about a model

Blitz knows the main families (Claude, Gemini, GPT, o-series): their context windows, maximum output, whether they think and which settings they take. Claude through Bedrock or Vertex AI counts as the Claude model it names. For Ollama, Blitz asks Ollama itself whether a model calls tools or reads images, and how much context it holds. For your organization’s models, the organization’s catalog says.

Nobody can know every model, though. When a model refuses something with an error that says what (it doesn’t call tools, doesn’t read images, doesn’t stream, doesn’t take a setting, holds fewer tokens than sent), Blitz:

  • remembers it;
  • sends the same request again once without it;
  • tells you once, for example “llama3.2 can’t use tools: it answers without them from now on”.

A model that can’t use tools answers without them. If a fallback can use them, it takes calls that offer tools.

What Blitz learned is kept in ~/.blitz/models.learned.toml and checked again after 30 days. blitz models forget <model> (ollama/llama3.2, or just llama3.2 for every provider) clears it.

Context and cost

History is compacted automatically before it fills the model’s context window: at the window less the model’s maximum output, less a tenth, for a model Blitz knows. Set context.token_threshold to choose the point yourself (its default, 120,000, leaves it to the model). /compact [focus] compacts on demand. List prices for the default models are built in; override or add them under [pricing."model-name"] (input_per_mtok, output_per_mtok, cached_input_per_mtok, cache_write_per_mtok). blitz doctor warns when the active model has no price. /cost shows the session’s tokens, including cache reads and writes, and its estimated cost. Web searches through Google are billed per query and shown on their own line, priced by [search_pricing.google] per_1k_queries (default $14).

Blitz keeps a ledger of each session: every model call, with the model that answered, what it was for (the conversation, a summary, a review, a background task, speech, a web search), its tokens and what it cost at the time. So a session that changed model, or whose fallback answered, says what each model cost: /cost breaks the total down by model and by purpose, the desktop app’s cost in the status bar does too when you hover over it, and blitz sessions usage <id> lists every call. A call to a model with no price makes only that call’s cost unknown: the total says “$0.42, plus 3 calls with no price”. Your organization’s models are priced from its catalog. A turn with a cost limit tells you when it can’t count a call because its model has no price. Sessions from before 0.9.2 show what they spent until then as one line.