配置大模型
进入OpenClaw配置目录:
cd ~/.openclaw
编辑openclaw.json文件
vim openclaw.json
在文件中找到models.providers,添加/修改vLLM配置(替换成自己的服务器信息):
"vllm": {
"baseUrl": "http://你的服务器IP:端口/v1", // 如http://192.168.1.100:1234/v1
"apiKey": "任意字符", // 无API_KEY则随意填写,不能为空
"api": "openai-completions",
"models": [
{
"reasoning": false,
"id": "qwen3-32b", // 服务器vLLM的模型名称
"name": "qwen3-32b", // 与模型id一致
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
设置默认对接模型
# 将vLLM的qwen3-32b设为OpenClaw默认模型
openclaw models set vllm/qwen3-32b
# 可选:查看当前模型列表,确认默认模型是否设置成功
openclaw models list
重启网关使配置生效
# 普通重启网关
openclaw gateway
# 若配置不生效,执行强制重启(必成功)
openclaw gateway --force
