add-ollama-provider

Configure a NanoClaw agent group to route requests to a local Ollama model instead of the Anthropic API.

2|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/RADHA0-max/selfhealbackend --skill add-ollama-provider-radha0-max
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-ollama-provider
Source: https://github.com/RADHA0-max/selfhealbackend/tree/main/nanoclaw/.claude/skills/add-ollama-provider
Command: npx skills add https://github.com/RADHA0-max/selfhealbackend --skill add-ollama-provider-radha0-max

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running NanoClaw agents against the Anthropic API incurs per-token costs and requires cloud connectivity. This Skill reroutes an agent group to a locally running Ollama instance, letting you cut API costs, run open-weight models, and keep inference on your own hardware without changing provider code. ## Core Features & Use Cases - Environment-based rerouting: Sets ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, and NO_PROXY overrides in the agent group's container.json so the Anthropic SDK talks to Ollama's native /v1/messages endpoint. - Source wiring when needed: Extends ContainerConfig with env and blockedHosts fields and wires them into container-runner.ts if the feature is not already present. - Optional API blocking: Maps api.anthropic.com to 0.0.0.0 inside the container to prevent accidental spend if configuration drifts. - Use Case: You want to experiment with qwen3-coder or gemma models on one agent group while keeping others on Claude. Run this Skill to configure the group, set the model in the shared settings file, rebuild, and verify via Ollama's /api/ps endpoint. ## Quick Start Ask the assistant to route one of your NanoClaw agent groups to a local Ollama model and confirm which group, which model, and whether to block the Anthropic API.

Frequently Asked Questions about add-ollama-provider

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a NanoClaw agent on a local Ollama model?

Set ANTHROPIC_BASE_URL to http://host.docker.internal:11434 and ANTHROPIC_API_KEY to ollama in the agent group's container.json env block, then add the model name to the group's shared Claude settings.json. Ollama speaks the Anthropic /v1/messages API natively, so no provider code changes are needed.

How do I switch an agent group back from Ollama to the Anthropic API?

Remove the env and blockedHosts keys from the group's container.json, remove the model key from the shared settings file, and restart the service. No rebuild is required because both files are read at container spawn time.

Does Ollama work with the Anthropic API without code changes?

Yes, Ollama natively implements the Anthropic /v1/messages endpoint, so the Anthropic SDK can talk to it directly. You only need to override ANTHROPIC_BASE_URL and provide any value for ANTHROPIC_API_KEY, which Ollama ignores.

Why does my agent hang with no response after switching to Ollama?

Ollama may be loading the model cold, which takes 10-30 seconds for large models. Watch curl -s http://localhost:11434/api/ps to see when the model appears as active, then the agent should respond.

Why does the agent respond but Ollama shows no activity?

The NO_PROXY variable may not have taken effect for the lowercase http_proxy variant, so requests still go through the OneCLI HTTPS proxy. Add both NO_PROXY and no_proxy with host.docker.internal to the env block in container.json.

How do I prevent accidental Anthropic API spend when using Ollama?

Add api.anthropic.com to the blockedHosts array in container.json. The container runner maps blocked hosts to 0.0.0.0 via --add-host, making the Anthropic API unreachable inside the container even if configuration drifts.