Skip to main content
inferrs 在 OpenAI 兼容的 /v1 API 后提供本地模型服务。OpenClaw 通过通用的 openai-completions 适配器与之对接。
inferrs 是一个自托管的、兼容 OpenAI 的自定义后端,不是专用的 OpenClaw 提供方插件:你需要在 models.providers.inferrs 下进行配置,而不是选择某个引导认证选项。若想要带自动发现的内置插件,请参阅 SGLangvLLM

快速开始

1

使用模型启动 inferrs

2

验证服务器是否可访问

3

添加一个 OpenClaw 提供商条目

添加一个显式的提供商条目,并将你的默认模型指向它。请参见下面的配置示例。

完整配置示例

本地 inferrs 服务器上的 Gemma 4:

按需启动

OpenClaw 仅在选择 inferrs/... 模型时才会自行启动 inferrs。将 localService 添加到同一个 provider 条目中:
command 必须是绝对路径。在 Gateway 主机上运行 which inferrs 并使用该路径。完整字段参考: 本地模型服务

高级配置

Some inferrs Chat Completions routes accept only string messages[].content, not structured content-part arrays.
If OpenClaw runs fail with:
set compat.requiresStringContent: true in the model entry. OpenClaw then flattens pure text content parts into plain strings before sending the request.
Some inferrs + Gemma combinations accept small direct /v1/chat/completions requests but fail on full OpenClaw agent-runtime turns. Try disabling the tool schema surface first:
That reduces prompt pressure on stricter local backends. If tiny direct requests still work but normal OpenClaw agent turns keep crashing inside inferrs, treat it as an upstream model/server limitation rather than an OpenClaw transport issue.
Test both layers once configured:
If the first command works but the second fails, see Troubleshooting below.
Because inferrs uses the generic openai-completions adapter (not openai-responses), native-OpenAI-only request shaping never applies: no service_tier, no Responses store, no prompt-cache hints, and no OpenAI reasoning-compat payload shaping get sent.

故障排除

inferrs 未运行、无法访问,或未绑定到你配置的主机/端口。请确认服务器已启动并在该地址上监听。
在模型条目中设置 compat.requiresStringContent: true(见上文)。
设置 compat.supportsTools: false 以禁用工具 schema 表面(见上面的 Gemma 注意事项)。
如果 schema 错误已经消失,但 inferrs 在较大的 agent 轮次中仍然崩溃,请将其视为上游 inferrs 或模型限制。减少提示词压力或切换后端/模型。
如需一般帮助,请参阅 故障排除FAQ

相关内容

本地模型

在本地模型服务器上运行 OpenClaw。

本地模型服务

按需启动已配置提供方的本地模型服务器。

网关故障排除

调试通过探测但在 agent 运行时失败的本地 OpenAI 兼容后端。

模型选择

所有提供方、模型引用和故障转移行为的概览。