
issue: Searxng is not working from WebUI even though it works from a curl in WebUI container
快速结论:此问题通常发生在模型不支持原生 Tool Calling 时,WebUI 未能自动触发搜索工具,导致模型回复 “I don’t have real-time access to…”,即使 SearXNG 本身能通过 curl 返回正确 JSON。优先排查并切换到 Legacy Tool Calling 模式。
问题场景
用户通过 Docker 运行 Open WebUI(0.10.1/0.10.2)和 SearXNG 最新容器,配置了正确的 WebUI websearch 设置(http://searxng:8080/search?q=<query>&format=json),在 WebUI 中发起如 “Whats the weather in ABC town?” 这类需要实时搜索的聊天测试时,模型回复 “I don’t have real-time access to…”,但直接在 WebUI 容器内执行 curl 到 SearXNG 却可以正常返回 JSON 格式的搜索结果。
报错原文
Chat response is always: "I don't have real-time access to..."
WebUI container curl works:
curl "http://searxng:8080/search?q=test&format=json"
# returns valid JSON with results
No search actually ran. Your model did not execute the search_web tool.
原因分析
核心原因是模型不支持原生 Tool Calling(或模型太小/太旧,无法正确调用搜索工具)。Open WebUI 默认使用原生 Tool Calling 机制,期望模型自主决定何时调用 search_web 工具。如果模型不具备此能力,WebUI 就不会触发搜索,即使 SearXNG 本身是正常的。开发者明确指出:“Your model is too small, old and frankly stupid to use the tools it has available.” 解决方案是启用 Legacy Tool Calling 模式——在该模式下,Open WebUI 会代替模型执行 web search 并注入上下文,从而绕过模型自身的工具调用限制。
环境排查
- Open WebUI 版本:0.10.1 / 0.10.2(问题出现);0.9.4(正常)
- SearXNG 版本:最新版(2026.6.30)
- 安装方式:Docker
- WebUI 搜索设置:
http://searxng:8080/search?q=<query>&format=json - SearXNG 配置(searxng.yml):开启了
json格式(formats: [html, json]),这是正确的。 - 模型:需确认模型是否支持原生 Tool Calling。若模型较小或较旧(如某些旧版对话模型),应尝试 Legacy 模式。
解决步骤
- 切换至 Legacy Tool Calling 模式:
- 打开 Open WebUI 设置界面(Admin Panel → Settings → Interface 或直接搜索 “Tool Calling”)。
- 找到 Tool Calling 设置,将模式从 Native 切换为 Legacy。
- 保存设置后,重新发起需要实时搜索的聊天请求。
- (可优先尝试)如果当前模型实在无法配合 Legacy 模式,请使用一个支持原生 Tool Calling 的模型:
- 推荐使用较新的、支持工具调用的模型(例如 GPT-4 系列、Claude 系列、Llama 3.1 70B+ 等)。
- 如果无法更换模型,Legacy 模式是更稳妥的兼容方案。
- 验证 SearXNG 连通性(可选,但可以排除网络问题):
- 在 WebUI 容器内执行:
curl "http://searxng:8080/search?q=test&format=json" - 如果返回合法的 JSON,说明 SearXNG 服务本身正常,问题出在 WebUI 的 Tool Calling 机制上。
- 在 WebUI 容器内执行:
验证方法
切换至 Legacy Tool Calling 模式后,发起一个需要实时数据的查询(例如 “What is the weather in London right now?”)。如果模型开始回答来自互联网搜索的内容(而非 “I don’t have real-time access to…”),则说明问题已解决。也可以检查 Open WebUI 日志,确认是否有 search_web 工具调用记录。如果仍不工作,请确认 SearXNG 配置中已包含 json 格式,且网络(DNS、端口)正常。



