Agent skill

NanoClaw Ollama Provider

by nanocoai in nanocoai/nanoclaw

Routes a NanoClaw agent group to a local Ollama model instead of the Anthropic API, using environment overrides and an optional block on Anthropic hosts.

MITAuto-check passedAI & LLM Engineering

Install NanoClaw Ollama Provider

skills CLI
$ npx skills add nanocoai/nanoclaw --skill add-ollama-provider -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nanocoai/nanoclaw add-ollama-provider --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nanocoai/nanoclaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-ollama-provider .claude/skills/add-ollama-provider && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-ollama-provider
GitHub stars
31k
Token cost
~1.5k tokens
SKILL.md length
543 words
Files
1
Skills in repo
59
Repo updated
First seen
Licence
MIT

At a glance

Routes a NanoClaw agent group to a local Ollama model instead of the Anthropic API, using environment overrides and an optional block on Anthropic hosts.

  • Works in 6 steps: Check source support → Identify the setup → Configure container.json → …
  • Running a NanoClaw agent locally on an open-weight model
  • SKILL.md covers Prerequisites, 1. Check source support, 2. Identify the setup and 3. Configure container.json, plus 5 more sections
  • Calls curl, pnpm and docker; needs ANTHROPIC_API_KEY

What it does

This skill points one NanoClaw agent group at a local Ollama instance. Ollama speaks the Anthropic messages API natively, so no provider code changes are needed beyond environment variable overrides and a model setting in the group's container.json. The agent first checks that the source already supports two ContainerConfig fields, env and blockedHosts, wired into container-runner.ts, and adds them when either is missing. It also checks the container's home directory permissions, relaxing them when the container may run under a different user id, and rebuilds the image afterward.

Next it asks you three things in plain text: which agent group, which Ollama model, and whether to block the Anthropic API, which it recommends so a config drift cannot cause accidental spend. It then writes an env block, including an ANTHROPIC_BASE_URL aimed at the host's Ollama port, and optionally blockedHosts into the group's container.json. Prerequisites are a running Ollama install, a pulled model such as gemma4 or qwen3-coder, and an existing agent group. Background and tradeoffs live in docs/ollama.md.

When your agent uses it

  • Running a NanoClaw agent locally on an open-weight model
  • Cutting API costs by moving an agent group off the Anthropic API
  • Experimenting with models such as gemma4 or qwen3-coder
  • Blocking Anthropic hosts for a group so it cannot spend by accident

Example prompts

  • “Switch my support agent group to the qwen3-coder model running in Ollama.”
  • “Set up the NanoClaw research group to use local Ollama and block the Anthropic API.”
  • “Check whether my NanoClaw source already has the env and blockedHosts config fields.”

Requirements

  • Ollama installed and running on the host
  • A pulled Ollama model
  • An existing NanoClaw agent group

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Check source support
  2. Identify the setup
  3. Configure container.json
  4. Set the model
  5. Build and restart
  6. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit a0c79dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • pnpm
    • docker
    • ollama

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, pnpm and docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ANTHROPIC_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

NanoClaw Ollama Provider loads about 1.5k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 543 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nanocoai/nanoclaw at commit a0c79dd, republished under its MIT licence (© nanocoai). 543 words, ~1,546 tokens.

Download SKILL.mdSave it as .claude/skills/add-ollama-provider/SKILL.md (or your agent's skills folder).
name
add-ollama-provider
description
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.

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

  1. Ollama is installed and running on the host — verify: curl -s http://localhost:11434/api/tags
  2. A model is pulled — e.g. ollama pull gemma4 or ollama pull qwen3-coder
  3. 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:

bash
grep -c 'blockedHosts' src/container-config.ts src/container-runner.ts

If 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:

typescript
env?: Record<string, string>;
blockedHosts?: string[];

And in readContainerConfig, add inside the returned object:

typescript
env: raw.env,
blockedHosts: raw.blockedHosts,
1b. Wire into container-runner

In src/container-runner.ts, after the NANOCLAW_MCP_SERVERS block, add:

typescript
// 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:

bash
grep 'chmod.*home/node' container/Dockerfile

If 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):

  1. Which agent group? List available groups: pnpm exec tsx scripts/q.ts data/v2.db "SELECT folder, name FROM agent_groups;"
  2. Which Ollama model? List available: curl -s http://localhost:11434/api/tags | grep '"name"'
  3. Block Anthropic API? Recommended yes — prevents accidental spend if config drifts.

Record as FOLDER, MODEL, and BLOCK_ANTHROPIC.

3. Configure container.json

Read groups/<FOLDER>/container.json. Add (or merge into) an env block and optionally blockedHosts:

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"]
}

Omit blockedHosts if the user declined step 2.

Why these vars: ANTHROPIC_BASE_URL redirects the Anthropic SDK to Ollama. ANTHROPIC_API_KEY=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.

Show full SKILL.md (241 more words)Show less

4. Set the model

Read the agent group's shared Claude settings:

bash
# 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.json

Add "model": "<MODEL>" to that settings file. Create the file if it doesn't exist:

json
{
  "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:

bash
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:

bash
# 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 ANTHROPIC

Expected: api.anthropic.com:0.0.0.0 in ExtraHosts, ANTHROPIC_BASE_URL=http://host.docker.internal:11434.

Reverting to Claude

To switch back to the Anthropic API:

  1. Remove the env and blockedHosts keys from groups/<FOLDER>/container.json
  2. Remove "model" from the shared settings file
  3. 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/<FOLDER>/CLAUDE.md telling it what model it runs on.

Agent responds but Ollama shows no activity: NO_PROXY may not have taken effect for http_proxy (lowercase). Add both NO_PROXY and no_proxy to the env block.

© nanocoai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/add-ollama-provider of nanocoai/nanoclaw.

Open the folder on GitHubat commit a0c79dd

Compare with similar skills

NanoClaw Ollama Provider next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

NanoClaw Ollama Provider compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
NanoClaw Ollama Provider this skillnanocoai/nanoclaw31k—~1.5kAutomated safety check: PassMIT
Perfupraullenchai/Rapid-MLX4k—~1.6kAutomated safety check: NotesCustom licence
New Providerfinch-xu/cc-router277—~1.6kAutomated safety check: PassMIT
Configuring Visionoxbshw/watch-skill470—~509Automated safety check: NotesMIT
QuorumDetrol/quorum-cli119—~807Automated safety check: NotesCustom licence
Ollama Setupjeremylongshore/tons-of-skills-marketplace2.8k—~1.4kAutomated safety check: NotesMIT

Similar skills

  • Perfup

    raullenchai/Rapid-MLX

    Autonomous performance optimization: research, PoC, benchmark, implement, review, PR

    4k GitHub stars~1.6k tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • New Provider

    finch-xu/cc-router

    用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…

    277 GitHub stars~1.6k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Configuring Vision

    oxbshw/watch-skill

    The user wants to connect an LLM or vision provider, already has an API key, asks "can I use OpenAI/Anthropic/Gemini/OpenRouter", wants local Ollama, or needs different cheap and strong models.

    470 GitHub stars~509 tokensUpdated 26 days ago
    AI & LLM EngineeringAuto-check: notes
  • Quorum

    Detrol/quorum-cli

    Run a structured debate between agent CLIs (claude, codex, agy, grok) and the user's configured API or local models (OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama and more) through the Quorum…

    119 GitHub stars~807 tokensUpdated 14 days ago
    AI & LLM EngineeringAuto-check: notes
  • Ollama Setup

    jeremylongshore/tons-of-skills-marketplace

    Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs.

    2.8k GitHub stars~1.4k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • Vllm

    magnus919/agent-skills

    Operate, configure, benchmark, and troubleshoot vLLM inference servers: Docker and Kubernetes deployment, quantization-aware model configuration (tensor parallelism, KV cache), OpenAI-compatible API…

    115 GitHub stars~4.1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes

More from nanocoai/nanoclaw

All 59 skills in this repo
  • Installs or refreshes Iron Proxy and its Iron Control web console for NanoClaw, with a local Docker setup, database, credentials and a human approval bridge.

    31k GitHub stars~4.6k tokensUpdated yesterday
    Auto-check: notes
  • Installs or refreshes OneCLI as the gateway provider for NanoClaw, copying the adapter files, registering the provider and running the setup script.

    31k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check: notes
  • Agent Browser

    nanocoai/nanoclaw

    Drives a web browser from the shell with the agent-browser CLI: open pages, read an element snapshot, click and fill by reference, grab text and screenshots.

    31k GitHub starsUsed in 2 repos~1.6k tokens
    Auto-check passed
  • Add Dial Tool

    nanocoai/nanoclaw

    Installs the `dial` CLI and a credential in NanoClaw agent containers so chosen agents can send SMS, place AI voice calls and receive verification codes.

    31k GitHub stars~4.8k tokensUpdated yesterday
    Auto-check passed
  • Guides a conversational migration from an OpenClaw install to NanoClaw v2, carrying over identity, channel credentials, scheduled tasks and workspace files.

    31k GitHub stars~6k tokensUpdated yesterday
    Auto-check: notes
  • Wires up an additional phone number onto an already-installed Dial channel, so one NanoClaw install answers SMS and AI voice calls on more than one line.

    31k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Questions about NanoClaw Ollama Provider

What does NanoClaw Ollama Provider do?

Routes a NanoClaw agent group to a local Ollama model instead of the Anthropic API, using environment overrides and an optional block on Anthropic hosts. This skill points one NanoClaw agent group at a local Ollama instance.json.

When should I use NanoClaw Ollama Provider?

NanoClaw Ollama Provider fits situations like: running a NanoClaw agent locally on an open-weight model; cutting API costs by moving an agent group off the Anthropic API; experimenting with models such as gemma4 or qwen3-coder; blocking Anthropic hosts for a group so it cannot spend by accident.

How do I install NanoClaw Ollama Provider in Claude Code?

Run `npx skills add nanocoai/nanoclaw --skill add-ollama-provider -a claude-code`. Or copy the skill folder (.claude/skills/add-ollama-provider in nanocoai/nanoclaw) into .claude/skills/add-ollama-provider in your project. Claude Code loads it when a task matches its description.

How do I install NanoClaw Ollama Provider in Codex?

Run `npx skills add nanocoai/nanoclaw --skill add-ollama-provider -a codex`. Or copy the skill folder (.claude/skills/add-ollama-provider in nanocoai/nanoclaw) into .agents/skills/add-ollama-provider in your project. Codex loads it when a task matches its description.

Can I use NanoClaw Ollama Provider in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nanocoai/nanoclaw --skill add-ollama-provider -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-ollama-provider, .gemini/skills/add-ollama-provider, .github/skills/add-ollama-provider and .opencode/skills/add-ollama-provider in your project.

What does NanoClaw Ollama Provider need to run?

Going by SKILL.md and its folder, NanoClaw Ollama Provider needs the command-line tools its instructions call (curl, pnpm, docker and ollama) and credentials named ANTHROPIC_API_KEY. Our summary lists: Ollama installed and running on the host; A pulled Ollama model; An existing NanoClaw agent group.

Does NanoClaw Ollama Provider access the network?

SKILL.md contains no URLs. Its commands use curl and docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is NanoClaw Ollama Provider safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does NanoClaw Ollama Provider use?

NanoClaw Ollama Provider is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does NanoClaw Ollama Provider use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to NanoClaw Ollama Provider?

Skills that share tags, products or a category with NanoClaw Ollama Provider: Perfup (raullenchai/Rapid-MLX, 4k stars), New Provider (finch-xu/cc-router, 277 stars), Configuring Vision (oxbshw/watch-skill, 470 stars) and Quorum (Detrol/quorum-cli, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains NanoClaw Ollama Provider?

nanocoai (a GitHub organization) maintains it in nanocoai/nanoclaw, which has 30,915 GitHub stars. The repository holds 59 skills in this directory. The repository was last updated on October 10, 2026.

Source: nanocoai/nanoclaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.