OpenClaw AntSeed 翻译为:开放爪子蚕种
v1将 OpenClaw 连接到 AntSeed P2P AI 网络作为买家。使用时:用户请求连接 OpenClaw 到 AntSeed,通过 AntSeed 路由 OpenClaw,设置 AntSeed 为 OpenClaw 的模型提供者,或在 OpenClaw 中使用 P2P AI 模型。安装 AntSeed 买家代理并配置 OpenClaw 将 LLM 请求路由通过 AntSeed 点对点网络。
运行时依赖
安装命令
点击复制技能文档
将 OpenClaw 连接到 AntSeed P2P 网络 设置 AntSeed 为 OpenClaw 的模型提供者。这将安装一个本地买家代理,该代理连接到 AntSeed 点对点网络,并将 LLM 请求路由到可用的提供者。
架构 OpenClaw → http://127.0.0.1:5005 (AntSeed 买家代理) → P2P 网络 → 提供者节点 → 上游 API (OpenRouter、Anthropic 等)
买家代理在本地运行,通过 DHT 发现提供者,并暴露一个 API 兼容的 HTTP 端点。
步骤 1:安装 AntSeed CLI 和买家插件 npm install -g @antseed/cli antseed plugin add @antseed/router-local-proxy 验证:antseed --version(需要 Node.js 20+)。
步骤 2:启动买家代理 在终端中运行或设置为持久服务:antseed connect --router local-proxy --port 5005 代理将: 加入 P2P 网络通过 DHT 发现可用的提供者 监听 http://localhost:5005
持久服务(systemd) 要将代理作为一个在重启后仍然运行的后台服务: sudo tee /etc/systemd/system/antseed-buyer.service > /dev/null <<'EOF' [Unit] Description=AntSeed 买家代理 After=network-online.target Wants=network-online.target [Service] Type=simple User=$USER ExecStart=/usr/bin/env antseed connect --router local-proxy --port 5005 Restart=on-failure RestartSec=10 StandardOutput=journal StandardError=journal SyslogIdentifier=antseed-buyer [Install] WantedBy=multi-user.target EOF sudo systemctl daemon-reload sudo systemctl enable --now antseed-buyer 验证:sudo systemctl is-active antseed-buyer
步骤 3:配置 OpenClaw 模型提供者 询问用户他们想要使用哪个模型。可用的模型取决于网络上活动的提供者。 设置提供者 openclaw config set models.providers.antseed.baseUrl "http://127.0.0.1:5005" openclaw config set models.providers.antseed.apiKey "antseed-p2p" openclaw config set models.providers.antseed.api "anthropic-messages" 添加模型 模型 ID 必须与网络上可用的模型匹配。询问用户或建议常见选项。 例如,通过 OpenRouter 使用 Kimi K2.5: cat ~/.openclaw/openclaw.json | python3 -c " 导入 sys、json cfg = json.load(sys.stdin) providers = cfg.setdefault('models', {}).setdefault('providers', {}) providers['antseed'] = { 'baseUrl': 'http://127.0.0.1:5005', 'apiKey': 'antseed-p2p', 'api': 'anthropic-messages', 'models': [{ 'id': 'MODEL_ID_HERE', 'name': 'MODEL_DISPLAY_NAME', 'reasoning': False, 'input': ['text'], 'contextWindow': 131072, 'maxTokens': 8192 }] } json.dump(cfg, sys.stdout, indent=2) " > /tmp/oc_antseed.json && mv /tmp/oc_antseed.json ~/.openclaw/openclaw.json 将 MODEL_ID_HERE 替换为实际模型(例如 moonshotai/kimi-k2.5、anthropic/claude-sonnet-4-20250514)。 设置为默认模型 openclaw config set agents.defaults.model.primary "antseed/MODEL_ID_HERE" 模型引用格式为 antseed/,其中 antseed 是提供者名称。
步骤 4:重启和验证 重启网关以获取新的提供者 sudo systemctl restart openclaw 或杀死并重启网关进程 测试连接 curl -s http://127.0.0.1:5005/v1/models 如果代理返回可用的模型,则连接正常。
引导节点(可选) 如果代理无法通过 DHT 找到提供者,请将已知提供者添加为引导节点: 编辑 ~/.antseed/config.json 并将以下内容添加到 bootstrapNodes 数组中: { "bootstrapNodes": [ { "host": "PROVIDER_IP", "port": 6882 } ] } 然后重启买家代理。
API 格式说明 使用 anthropic-messages API 格式。AntSeed 代理在需要时将格式转换。 apiKey 值无关紧要 - 将其设置为任何非空字符串(例如 antseed-p2p)。 代理不验证它。 支持流媒体。 代理将来自提供者的 SSE 流中继。
验证清单 antseed --version 打印版本 antseed connect --router local-proxy --port 5005 启动时没有错误 curl http://127.0.0.1:5005/v1/models 返回可用的模型 OpenClaw 配置具有 models.providers.antseed 配置 agents.defaults.model.primary 设置为 antseed/ OpenClaw 网关使用 AntSeed 模型响应消息
故障排除 “没有可用的卖家”:没有通过 DHT 找到提供者。 添加引导节点(见上文)或检查提供者是否正在运行。 “DHT 返回 0 个结果”:检查互联网连接和防火墙。 DHT 使用 UDP 的随机高端口。 确保允许入站 UDP。 第一次请求缓慢:DHT 发现需要 5-10 秒的时间。 后续请求重用缓存的对等连接。 大请求超时:一些模型通过 P2P 路由需要更长时间。 确保 OpenClaw 模型配置具有足够的 maxTokens。 “502 上游错误”:提供者的上游 API(OpenRouter、Anthropic)返回了错误。 检查提供者日志。 空响应:验证模型 ID 是否与提供者允许的模型匹配。 模型名称不匹配会导致 403 错误。