mac部署openclaw+ollama(本地模型)
前提条件:
1.本地安装好ollama
2.在下适合自身机器的模型
这在上一篇中有提到https://blog.ZEEKLOG.net/i_k_o_x_s/article/details/77042085
安装:Docker Desktop
官网:https://www.docker.com/products/docker-desktop/
安装openclaw
需要其他装一些东西 homebrew
1.brew install node@22
(当前安装的可能是23的版本,openclaw 对这个不友好,需要装22的)
2.brew install vips

curl -fsSL https://openclaw.ai/install.sh | bash 大概等个几分钟

安装成功后
终端:
1.openclaw 启动

# 1) 启动/确认 ollama
ollama serve
# 新终端里确认模型
ollama pull qwen2.5:7b
ollama list
# 2) 给 OpenClaw 配本地 provider(占位 key 任意字符串)
openclaw config set models.providers.ollama.apiKey "ollama-local"
openclaw config set models.providers.ollama.baseUrl "http://127.0.0.1:11434"
openclaw config set models.providers.ollama.api "ollama"
# 3) 设默认模型
openclaw models set ollama/qwen2.5:7b
# 4) 查看状态
openclaw models status
成功标准:Default 是 ollama/qwen2.5:7b,且不再显示 Missing auth - ollama。
# 终端1:启动网关(保持这个窗口别关)
openclaw gateway --force
bash
# 终端2:查看 agent id
openclaw agents list
# 终端2:本地测试(把 main 换成你实际 agent id)
openclaw agent --agent main --message "你好,测试本地模型"

=============== 最后 ==========
openclaw dashboard
它会自动打开浏览器里的 Control UI,你就可以和 main agent(你的 ollama/qwen2.5:7b)对话。
