惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 三瑞

idea 安装cline openclaw 允许局域网能访问 VirtualBox 共享文件夹配置指南(Ubuntu 24.04 不重启方案) Nginx+Bearer Key 保护 Ollama + OpenClaw 远程连接 ubuntu24.04 安装 vscode Ubuntu 24.04 安装 KVM 完整指南 - 三瑞 Ubuntu 启动卡顿 2 分钟?一条命令解决 Linux下Ollama + AMD ROCm GPU加速安装实操指南 - 三瑞 Ubuntu 24.04 挂载第二块磁盘并扩展 LVM 系统盘 openclaw qqbot 反复提示 ubuntu 终端代理设置 干货|xrdp 无人值守+同屏稳定配置(Ubuntu 22.04/24.04 实测可用) openclaw 使用不同的模型 AMD GPU (RX 7900 XTX) 使用情况查看 Ubuntu 24.04 自带GNOME RDP远程连不上?一招解决xrdp残留冲突问题 Ubuntu 24.04 磁盘空间管理:从查看到 LVM 动态扩容完整指南 干货|Ubuntu 24.04 + AMD 7900 XTX 24G:Ollama 纯 Vulkan 加速部署(免 ROCm) Windows 连接 Ubuntu XRDP 远程桌面 QQ机器人接入OpenClaw完整指南:从零开始打造你的智能助手 VirtualBox U盘识别问题完美解决指南 ——记一次从入门到放弃再到入门的折腾历程 Ubuntu 系统 root 密码忘记怎么办?一招教你轻松重置 VirtualBox Ubuntu 虚拟机安装增强功能完整指南 HTTP 错误 500.21 - Internal Server Error 处理程序“BlockViewHandler”在其模块列表中有一个错误模块“ManagedPipelineHandler” 达梦数据库(DM)通过数据库类型生成修改字段类型的语句
避坑指南完整版:OpenClaw 连接 Ollama 详细实战教程
三瑞 · 2026-03-29 · via 博客园 - 三瑞

前言

我为了用 OpenClaw + Ollama 做本地 AI 编程助手,一开始直接选了 qwen2.5-coder:32b 代码模型,结果反复出现 AI 不回复(NO_REPLY),折腾了超久。

这篇博客只写实战、不废话,把模型怎么选、为什么不回复、日志在哪看、看什么关键字全部讲清楚,让你一次配通、永不踩坑。

一、环境说明

  • Ollama 机器:192.168.1.200(局域网主机)
  • OpenClaw 机器:192.168.1.208(Ubuntu 虚拟机)
  • 最大坑:代码专用模型(coder 系列)在 OpenClaw 里不能聊天,只会返回 NO_REPLY

二、OpenClaw 连接 Ollama 完整步骤(直接照抄)

1. Ollama 允许局域网访问(必须做)

bash

运行

# 在 Ollama 主机执行
ollama serve

2. OpenClaw 初始化配置(新手专用)

bash

运行

openclaw configure

配置选择顺序:

  1. 只勾选 Model,最后勾选 Continue
  2. Model provider → ollama
  3. Ollama mode → Local(远程模型一律选 Local,不要选 Cloud)
  4. Ollama base URL → http://192.168.1.200:11434(你的 Ollama 地址)
  5. 模型列表:务必选通用对话模型,不要选 coder 模型

3. 设置默认模型(命令行方式)

bash

运行

# ✅ 正确:通用对话模型(推荐)
openclaw models set ollama/qwen2.5:7b-instruct-q4_K_M

# ❌ 错误:代码专用模型(会 NO_REPLY)
# openclaw models set ollama/qwen2.5-coder:7b-instruct-q4_K_M

4. 重启网关

bash

运行

openclaw gateway restart

5. 检查状态

bash

运行

openclaw gateway status

显示 running 即成功。

三、Ollama 模型怎么选?原则是什么?(重点中的重点)

很多人不知道模型名字里的含义,乱选导致 NO_REPLY。

模型名字 = 选择依据,不用看复杂介绍,看后缀即可。

模型命名规则(Ollama 通用)

1. 看有没有 coder → 决定能不能聊天

  • coder

    • 示例:qwen2.5-coder:7bqwen2.5-coder:32b
    • 定位:纯代码模型
    • 只做:代码生成、代码解释、代码补全
    • OpenClaw 表现:日常对话直接返回 NO_REPLY
    • 结论:不能当默认对话模型!
  • 不含 coder

    • 示例:qwen2.5:7b-instructllama3.2:7b-instruct
    • 定位:通用对话模型
    • 能做:聊天、问答、写作、简单代码
    • OpenClaw 表现:正常回复
    • 结论:必须用这类做默认模型!

2. 看有没有 instruct → 决定是否适合对话

  • instruct:指令微调模型 → 适合聊天、交互
  • 不含 instruct:基座模型 → 不适合对话,容易乱答

3. 数字代表大小(7b、14b、32b)

  • 7b:轻量快速,适合日常使用
  • 32b:大参数,代码强,但更吃资源

模型选择终极原则(背下来)

  1. OpenClaw 日常交互 → 必须选:不带 coder、带 instruct 的模型
  2. 只想写代码 → 可以用 coder 模型,但不要用来聊天
  3. 想聊天 + 写代码两不误 → 主模型用通用版,需要代码时临时切换 coder

推荐模型清单(直接复制)

✅ 通用对话(推荐默认)

plaintext

qwen2.5:7b-instruct-q4_K_M

✅ 代码专用(只在写代码时切换)

plaintext

qwen2.5-coder:7b-instruct-q4_K_M
qwen2.5-coder:32b-instruct-q4_K_M

四、AI 不回复?日志排查方法(一步定位)

1. 日志路径(固定位置)

plaintext

/home/vboxuser/.openclaw/agents/main/sessions/xxxx.jsonl

每个会话一个 jsonl 文件,文件名是会话 ID。

2. 查看日志命令

bash

运行

cat /home/vboxuser/.openclaw/agents/main/sessions/你的会话文件.jsonl

3. 关键搜索内容(直接搜这个)

❌ 异常:模型不回复

json

"text":"NO_REPLY"

99% 原因:用了 coder 代码模型聊天

✅ 正常:模型回复

json

"text":"你好!有什么我可以帮你的吗?"

4. NO_REPLY 唯一真实原因

OpenClaw 发送了普通聊天内容 → coder 模型判定非代码 → 拒绝回答 → 返回 NO_REPLY

五、完整排错流程(遇到问题按这个走)

  1. 网关没运行:openclaw gateway restart
  2. 配置错误:openclaw configure 重配 Ollama 地址
  3. 不回复:看日志是否出现 NO_REPLY → 立刻换通用模型
  4. 旧会话坏了:网页端新建聊天,不要用旧会话
  5. 模型不兼容:记住 coder 模型不能聊天

六、总结(最核心三句话)

  1. OpenClaw + Ollama 配置不难,难在模型选择
  2. 带 coder 的模型 = 代码专用 = 聊天会 NO_REPLY
  3. 日志看 jsonl 文件,搜 NO_REPLY 直接定位问题

按这篇教程操作,OpenClaw 连接 Ollama 一次成功,再也不用反复踩坑!