add-ollama-provider skill
Route a NanoClaw agent group to a local Ollama model instead of the Anthropic API. Ollama speaks the Anthropic API natively (v1/messages), so no provider code changes are needed — just env var overrides and a model setting. Use when the user wants to run their agent locally, cut API costs, or experiment with open-weight models. See docs/ollama.md for background.
Is the add-ollama-provider skill safe?
Clean: nothing in its files matched our rules. We read 1 file in the folder on 2026-09-28.
- medium
SKILL.md:139Edits shell startup files, cron or launch agents, so something runs again after the skill is done.
launchctl unload ~/Library/LaunchAgents/$(launchd_label).plist
Install the add-ollama-provider skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/nanocoai/nanoclaw.git /tmp/nanoclaw mkdir -p ~/.claude/skills cp -r /tmp/nanoclaw/.claude/skills/add-ollama-provider ~/.claude/skills/add-ollama-provider
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on GitHub
Add Ollama Provider
Routes an agent group to a local Ollama instance instead of the Anthropic API. See docs/ollama.md for how this works and the tradeoffs involved.
Prerequisites
- Ollama is installed and running on the host — verify: curl -s http://localhost:11434/api/tags
- A model is pulled — e.g. ollama pull gemma4 or ollama pull qwen3-coder
- The agent group already exists — run /init-first-agent first if needed
1. Check source support
The feature requires two fields in ContainerConfig (env and blockedHosts) and their corresponding wiring in container-runner.ts. Check if already present:
grep -c 'blockedHosts' src/container-config.ts src/container-runner.tsIf either count is 0, apply the changes in steps 1a and 1b. Otherwise skip to step 2.
1a. Extend ContainerConfig
In src/container-config.ts, add to the ContainerConfig interface:
env?: Record<string, string>;
blockedHosts?: string[];And in readContainerConfig, add inside the returned object:
env: raw.env,
blockedHosts: raw.blockedHosts,1b. Wire into container-runner
In src/container-runner.ts, after the NANOCLAWMCPSERVERS block, add:
// Per-agent-group env overrides — applied last to win over OneCLI values.
if (containerConfig.env) {
for (const [key, value] of Object.entries(containerConfig.env)) {
args.push('-e', `${key}=${value}`);
}
}
// Blocked hosts: resolve to 0.0.0.0 so they are unreachable inside the container.
if (containerConfig.blockedHosts) {
for (const host of containerConfig.blockedHosts) {
args.push('--add-host', `${host}:0.0.0.0`);
}
}1c. Fix home directory permissions (if not already done)
The container may run as your host uid (not uid 1000). Check the Dockerfile:
grep 'chmod.*home/node' container/DockerfileIf it shows chmod 755, change it to chmod 777 so any uid can write there. Then rebuild the container image: ./container/build.sh
2. Identify the setup
Ask the user (plain text, not AskUserQuestion):
- Which agent group? List available groups: pnpm exec tsx scripts/q.ts data/v2.db "SELECT folder, name FROM agent_groups;"
- Which Ollama model? List available: curl -s http://localhost:11434/api/tags | grep '"name"'
- Block Anthropic API? Recommended yes — prevents accidental spend if config drifts.
Record as FOLDER, MODEL, and BLOCK_ANTHROPIC.
3. Configure container.json
Read groups//container.json. Add (or merge into) an env block and optionally blockedHosts:
{
"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"]
}Omit blockedHosts if the user declined step 2.
Why these vars: ANTHROPICBASEURL redirects the Anthropic SDK to Ollama. ANTHROPICAPIKEY=ollama satisfies the SDK's key requirement (Ollama ignores it). NO_PROXY bypasses the OneCLI HTTPS proxy for requests to host.docker.internal so they reach Ollama directly instead of going through the credential gateway.
4. Set the model
Read the agent group's shared Claude settings:
# Find the agent group ID
AG_ID=$(pnpm exec tsx scripts/q.ts data/v2.db "SELECT id FROM agent_groups WHERE folder='<FOLDER>';")
SETTINGS=data/v2-sessions/$AG_ID/.claude-shared/settings.jsonAdd "model": "" to that settings file. Create the file if it doesn't exist:
{
"model": "gemma4:latest"
}If the file already has content, merge the model key in — don't overwrite existing keys.
Why here and not container.json: Claude Code reads its model from its own settings file, not from env vars. This file is bind-mounted into the container as ~/.claude/settings.json.
5. Build and restart
Run from your NanoClaw project root:
export PATH="/opt/homebrew/bin:$PATH"
pnpm run build
source setup/lib/install-slug.sh
launchctl unload ~/Library/LaunchAgents/$(launchd_label).plist
launchctl load ~/Library/LaunchAgents/$(launchd_label).plist
# Linux: systemctl --user restart $(systemd_unit)6. Verify
Send a message to the agent. Then confirm:
# Ollama shows the model as active
curl -s http://localhost:11434/api/ps | grep '"name"'
# Container has the right env vars
CTR=$(docker ps --filter "label=nanoclaw-group-folder=<FOLDER>" --format "{{.Names}}" | head -1)
docker inspect "$CTR" --format '{{json .HostConfig.ExtraHosts}}'
docker exec "$CTR" env | grep ANTHROPICExpected: api.anthropic.com:0.0.0.0 in ExtraHosts, ANTHROPICBASEURL=http://host.docker.internal:11434.
Reverting to Claude
To switch back to the Anthropic API:
- Remove the env and blockedHosts keys from groups//container.json
- Remove "model" from the shared settings file
- Restart the service
No rebuild needed — both files are read at container spawn time.
Troubleshooting
Agent hangs, no response: Ollama may be loading the model cold (large models take 10–30s). Watch curl -s http://localhost:11434/api/ps — the model appears once loaded.
"model not found" error in container logs: The model name in settings.json doesn't match what Ollama has. Run ollama list on the host and use the exact name shown.
Responses claim to be Claude: The model was trained on data that includes Claude conversations. Add a line to groups//CLAUDE.md telling it what model it runs on.
Agent responds but Ollama shows no activity: NOPROXY may not have taken effect for httpproxy (lowercase). Add both NOPROXY and noproxy to the env block.
More skills from nanocoai/nanoclaw
- Aadd-anydocAdd local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when agents need to read attached Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, or text-based PDF files without uploading them to a hosted parser.
- Aadd-atomic-chat-toolAdd Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its OpenAI-compatible API.
- Fadd-clidashAdd clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists resources as JSON. Ships pre-wired for NanoClaw's ncl CLI (agent groups, sessions, channels, users, roles), plus message-activity charts, a log tail, and a read-only file viewer for group skills/CLAUDE.md/profiles.
- Aadd-codexUse Codex (OpenAI's codex app-server) as a full agent provider — planning, tool orchestration, MCP tools, server-side history, session resume — alongside or instead of Claude. ChatGPT subscription or OpenAI API key, vault-only via the selected gateway. Per-group via `ncl groups config update --provider codex`. Distinct from using OpenAI as an MCP tool (where Claude remains the planner).
- Aadd-dashboardAdd a monitoring dashboard to NanoClaw. Installs @nanoco/nanoclaw-dashboard and a pusher that sends periodic JSON snapshots.
- Aadd-deltachatAdd DeltaChat channel integration via @deltachat/stdio-rpc-server. Native adapter — no Chat SDK bridge. Email-based messaging with end-to-end encryption.
- Cadd-dialAdd Dial channel integration — a real phone number for SMS and AI voice calls via the Dial platform (getdial.ai). Native adapter — no Chat SDK bridge.
- Aadd-dial-numberAdd another phone number to an existing Dial channel — a second (or third) public line for the agent, so one NanoClaw install answers SMS and AI voice calls on multiple numbers. Use when Dial is already installed and the operator wants an additional number (e.g. a personal line plus a support line). Requires the Dial channel to already be installed (see /add-dial).
- Aadd-dial-toolGive chosen NanoClaw agents a real phone number as a container tool — the `dial` CLI baked into the agent image plus OneCLI credential injection for api.getdial.ai, scoped per agent, so the agents you pick can send SMS, place AI voice calls, and receive verification codes from inside the sandbox. Independent of the Dial channel; idempotent; re-run to change which agents may use it. Use when the user wants agents to text, call, or run `dial …` from a chat, without wiring Dial as a messaging channel.
- Aadd-discordAdd Discord bot channel integration via Chat SDK.
- Aadd-emacsAdd Emacs as a channel. Opens an interactive chat buffer and org-mode integration so you can talk to NanoClaw from within Emacs (Doom, Spacemacs, or vanilla). Local HTTP bridge — no bot token or external service needed.
- Aadd-gchatAdd Google Chat channel integration via Chat SDK.