Skills
Enhancement Official
Ollama (Provider)
Route a NanoClaw agent group to a local Ollama model instead of the Anthropic API. No code changes — just env overrides.
What it does
- Run an entire agent group on a local Ollama model — no API calls
- Ollama speaks the Anthropic API natively (v1/messages) — no provider code needed
- Per-group switching: some agents on Claude, some on local
- Optional API.anthropic.com host blocking to prevent accidental spend
- Reverts cleanly — remove env block, restart, back on Claude
What you'll need
- NanoClaw installed and running
- Ollama installed and running on the host (port 11434)
- A pulled Ollama model (e.g. gemma4, qwen3-coder)
- An existing agent group to route
Install
/add-ollama-provider How it works
The /add-ollama-provider skill routes a NanoClaw agent group to a local Ollama instance instead of the Anthropic API. Because Ollama already speaks the Anthropic API natively (v1/messages), there’s no provider code to change — just an env override telling the Anthropic SDK where to send its requests.
This is a per-group switch. Other groups in the same NanoClaw install can keep talking to Claude.
Setup
The skill is mostly automated:
- Source-level prep (one-time per install) — extends
ContainerConfigwithenvandblockedHostsfields and wires them intocontainer-runner.tsso groups can pass per-group env overrides into Docker. Only runs if not already in place. - Per-group config — adds
envandblockedHoststogroups/<folder>/container.json:{ "env": { "ANTHROPIC_BASE_URL": "http://host.docker.internal:11434", "ANTHROPIC_API_KEY": "ollama", "NO_PROXY": "host.docker.internal", "no_proxy": "host.docker.internal" }, "blockedHosts": ["api.anthropic.com"] } - Model selection — adds
"model": "<your-model>"to the group’s shared Claude settings atdata/v2-sessions/<group-id>/.claude-shared/settings.json. Claude Code reads its model from settings, not env vars. - Restart — the env block is read at container spawn, no rebuild needed.
What you get
- Local inference — the agent’s reasoning runs on your machine, never crosses the network.
- Per-group isolation — flip an env block to switch one group to local, leave others on Claude.
- Safety net —
blockedHosts: ["api.anthropic.com"]resolves the host to0.0.0.0inside that group’s container so a misconfiguration can’t accidentally fall through to paid API. - No provider code — Ollama’s Anthropic-API compatibility means this is just configuration, not new TypeScript.
Tips
- The skill changes
chmod 755tochmod 777on/home/nodein the container Dockerfile (and rebuilds) so any host UID can write there. Ollama’s host integration sometimes runs as a non-1000 UID inside the container. - Cold first call: Ollama lazy-loads models. Watching
curl -s http://localhost:11434/api/psshows when the model is in memory. - Models trained on Claude conversations sometimes claim to be Claude. Add a line to
groups/<folder>/CLAUDE.mdtelling the model what it is to head this off. - If the agent responds but Ollama’s
/api/psshows no activity, double-check bothNO_PROXYandno_proxy(lowercase) — some HTTP libraries only honor one. - Reverting is just deleting the
envandblockedHostskeys fromcontainer.jsonand themodelkey from settings, then restarting. No rebuild needed. - Pair with
/add-ollama-toolif you also want Claude (running on the cloud) to call out to an Ollama model as an MCP tool — that’s a different use case.