本地模型
Local is doable, but OpenClaw expects large context + strong defenses against prompt injection. Small cards truncate context and leak safety. Aim high: ≥2 maxed-out Mac Studios or equivalent GPU rig (~$30k+). A single 24 GB GPU works only for lighter prompts with higher latency. Use the largest / full-size model variant you can run; aggressively quantized or “small” checkpoints raise prompt-injection risk (see Security).推荐:LM Studio + MiniMax M2.1(Responses API,完整尺寸)
Best current local stack. 当前最佳本地堆栈。在 LM Studio 中加载 MiniMax M2.1,启用本地服务器(默认http://127.0.0.1:1234),并使用 Responses API 将推理与最终文本分开。
- 安装 LM Studio:https://lmstudio.ai
- 在 LM Studio 中,下载可用的最大 MiniMax M2.1 构建(避免”小型”/重度量化变体),启动服务器,确认
http://127.0.0.1:1234/v1/models列出了它。 - 保持模型加载;冷加载会增加启动延迟。
- 如果你的 LM Studio 构建不同,调整
contextWindow/maxTokens。 - 对于 WhatsApp,坚持使用 Responses API,这样只发送最终文本。
models.mode: "merge" 以便备用方案保持可用。
混合配置:托管为主,本地备用
本地优先,托管作为安全网
交换主要和备用的顺序;保持相同的 providers 块和models.mode: "merge",这样当本地机器宕机时可以回退到 Sonnet 或 Opus。
区域托管/数据路由
- Hosted MiniMax/Kimi/GLM variants also exist on OpenRouter with region-pinned endpoints (e.g., US-hosted). Pick the regional variant there to keep traffic in your chosen jurisdiction while still using
models.mode: "merge"for Anthropic/OpenAI fallbacks. - 纯本地仍然是最强的隐私路径;当你需要提供商功能但又想控制数据流时,托管区域路由是折中方案。
其他 OpenAI 兼容本地代理
vLLM、LiteLLM、OAI-proxy 或自定义网关都可以工作,只要它们暴露 OpenAI 风格的/v1 端点。用你的端点和模型 ID 替换上面的 provider 块: Replace the provider block above with your endpoint and model ID:
models.mode: "merge" 以便托管模型作为备用保持可用。
故障排除
- Gateway 网关能访问代理吗?
curl http://127.0.0.1:1234/v1/models。curl http://127.0.0.1:1234/v1/models. - LM Studio 模型卸载了?重新加载;冷启动是常见的”卡住”原因。 Reload; cold start is a common “hanging” cause.
- Context errors? 上下文错误?降低
contextWindow或提高服务器限制。 - 安全:本地模型跳过提供商端过滤器;保持智能体范围窄并开启压缩以限制提示注入的影响范围。