Menu Local models with Ollama

Guides

Local models with Ollama

Whole agents, or just Claude Code's subagents, on models you host; credentials never reach Ollama.

indra runs agents on models you host with Ollama, in three ways:

What runs whereHow
The whole agent on a local modela profile with provider = "ollama"
The main agent on Anthropic, its subagents on a local modela profile with subagent_provider = "ollama"
One role or one step on a local modelplan and delegate, or a workflow task, naming such a profile, or a task's own model and provider

Claude Code works with all three (Ollama 0.14 and later serves the Anthropic Messages API it speaks). Codex works with the first (--oss). Other runners can be pointed at Ollama with their own options in a profile's env.

Quick start: Claude Code on a local model

OLLAMA_CONTEXT_LENGTH=65536 ollama serve     # Claude Code needs a big context window
indra claude -m qwen3-coder --pull           # pull it if needed, check it, start Claude Code

indra claude is Claude Code itself, interactive, in your terminal, with every model call going to Ollama. Before it starts, it checks that:

What else it takes:

Flag
-m MODELthe Ollama model to run
--ollama URLanother machine's server (default http://localhost:11434)
--subagents MODELkeep Claude on Anthropic, run only its subagents on this local model
--profile NAMEstart from a profile in indra.toml (model, provider, mode, tools, env and secrets)
--context TOKENSthe window to tell Claude Code (default: what the server runs the model with)
--pull, --no-check, --dry-runpull first; skip the checks; print what would run
-- ARGSClaude Code's own flags, e.g. -- --resume or -- -p "fix the tests"

The same Claude Code, started with an Ollama profile, is also on the console's Terminal page (indra serve --shell): pick the profile, then Claude Code. And an agent that ran on Ollama reopens there on Ollama, not on Anthropic.

The whole agent on Ollama

[[profile]]
name        = "local"
runner      = "claude"                # or "codex"
model       = "qwen3-coder"           # a model your Ollama server has (`ollama pull qwen3-coder`)
provider    = "ollama"
# ollama_url = "http://gpu-box:11434" # another machine's Ollama; default: this machine

For Claude Code, indra sets the base URL and maps opus, sonnet and haiku (and Claude Code's own background model and subagent model) to model, so agent files that say model: opus, like the indra plugin's, run on the local model too. Anything the profile's env sets itself wins. For Codex, it adds --oss -m <model> and points Codex at the server.

Subagents on Ollama, the main agent on Anthropic

[[profile]]
name              = "lead-local"
runner            = "claude"
model             = "opus"            # the main agent: plans, decides, reviews
subagent_model    = "qwen3-coder"     # every subagent it spawns
subagent_provider = "ollama"

Claude Code sends all of a session's model calls to one base URL, so indra points it at its model router: a small proxy on 127.0.0.1 in the indra process that starts the agent (the console, or indra node on another machine). The router reads each request's model: the subagent model goes to Ollama, everything else goes to Anthropic (or to the ANTHROPIC_BASE_URL the profile already set, such as a gateway). Responses stream through unchanged.

What reaches Ollama

Nothing that identifies you. The router drops authorization and x-api-key before a request goes to Ollama, and a whole agent on Ollama goes through the router for this reason alone: Claude Code sends whatever login it has (an API key, or a Claude subscription login) to its base URL, and that should never reach a model server, least of all one on another machine over plain HTTP. On the Anthropic leg the router passes the agent's own credentials through and adds none.

Each launch gets its own route behind a random path, so another program on the machine cannot borrow it by guessing the port. The Settings > Profiles page, Launch and GET /api/ollama show how many requests went each way.

Picking a model

Tools > Local models (Ollama) lists the server's models with their size, tool calling and context window, marks which ones can run Claude Code, and pulls new ones with progress. Model fields everywhere suggest the server's models next to Claude's aliases.

On Launch, Runs on overrides the profile for one launch: the whole agent on Ollama, or Anthropic with its subagents on Ollama (and the subagents' model). Before you launch, Launch checks the model and warns if it is not pulled, cannot call tools, or has too small a window.

The context window

Claude Code's system prompt and tool definitions alone take about 20k tokens. Two settings matter:

In workflows and teams

A workflow task can name a profile and override its model and provider:

[[workflow.task]]
id       = "triage"
profile  = "local"
model    = "llama3.3"                 # this step only
provider = "ollama"
prompt   = "Sort the findings in {target}/.security-harness by file"

In plan and delegate, each role is a profile, so a planner on Opus and a local worker give "Claude plans, a local model builds" across processes, and a lead-local worker gives it inside each step as well.

Notes