add-ollama-provider

仓库创建 2026年1月31日最近提交 1 天前SkillHot 收录 20 天前
▸ 精选理由

适合希望本地运行模型或降低 API 成本的用户

▸ 风险提示

要求宿主机安装并运行 Ollama 并开放相应接口

这个 Skill 做什么

将代理流量重定向至本地 Ollama 模型,替代 Anthropic API。

把某个代理组的模型调用改走本地 Ollama 实例,替代 Anthropic API。想在本地运行代理、节省 API 费用或试用开源权重模型时会用。Ollama 原生兼容 Anthropic 的 v1/messages 接口,只需调整环境变量和模型设置,不用改供应商代码。

▸ 展开 SKILL.md 英文原文

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.

开发编程本地模型Ollama成本优化通用
3.0w
Stars
1.3w
Forks
40
仓库内 Skill
+241
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/nanocoai/nanoclaw/main/.claude/skills/add-ollama-provider/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/nanocoai/nanoclaw/main/.claude/skills/add-ollama-provider/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# 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.t
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有