[Bug]: OpenAI-compatible tool calls are returned as plain text when routed through PAIR
维护者通常 5 天内回复
@kjlubick 已经在做这个了。
开始于 2026年10月1日。
评估
调研方向
从 Ollama 代理的 /v1/chat/completions 入口点开始,比较存在工具定义时请求和响应的处理方式。使用文档中的 curl 请求分别针对 PAIR 和直接针对 Ollama 进行复现,然后验证 PAIR 保留了 message.tool_calls 和 finish_reason: tool_calls,而不是将调用作为文本返回。
由索引模型根据 Issue 内容生成。
描述
PAIR version or commit
0.1.1-463
Affected component
Ollama proxy
Environment
OS: Ubuntu 26.04.1 LTS on model host; Linux on NVIDIA DGX Spark PAIR client
Architecture: x86_64 model host; arm64 PAIR client
GPU and driver: AMD Radeon 8060S / Ryzen AI Max+ 395 on model host; NVIDIA GB10 on PAIR client
Engine and version: Ollama 0.33.2
Model: qwen3.6:27b
Cluster size: 4 nodes
Steps to reproduce
-
Configure a PAIR cluster with an Ollama node serving qwen3.6:27b.
-
Send an OpenAI-compatible POST request to:
/v1/chat/completionsThe request contains multiple OpenAI function/tool definitions and asks the model to work on a task for which it should call the
kanban_showfunction. -
Send the request through the PAIR Ollama proxy.
-
Send the exact same JSON request body directly to the Ollama server hosting qwen3.6:27b, bypassing PAIR.
-
Compare
finish_reason,message.content, andmessage.tool_callsin the two responses.
Repeated control test:
- Direct to Ollama: 3/3 requests returned a native
tool_callsobject. - Through PAIR: 3/3 requests returned
finish_reason: stopwith notool_callsobject. The intended function call instead appeared as ordinary assistant content.
The behavior is reproducible with curl and does not require an agent framework.
Expected behavior
When an OpenAI-compatible chat completion request containing tool definitions is routed through PAIR, native tool-calling behavior should be preserved.
For this request, the response should contain message.tool_calls with a call to kanban_show, and finish_reason should be tool_calls, matching the response obtained when the identical request is sent directly to the Ollama server.
Actual behavior
When the identical request is sent through the PAIR Ollama proxy, the native OpenAI-compatible tool call is not returned.
In repeated testing, PAIR returned:
finish_reason: stopmessage.tool_calls: null/ absent- The intended
kanban_showcall embedded inmessage.contentas ordinary text.
Three consecutive PAIR requests produced textual representations such as:
-
Python-like syntax:
kanban_show(task_id="t_65ba4229") -
Bracket syntax:
[kanban_show][0] -
XML-like syntax:
<invoke>kanban_show(task_id="t_65ba4229")</invoke>
By contrast, three consecutive requests using the identical JSON request body sent directly to Ollama returned native OpenAI-compatible tool calls:
finish_reason: tool_calls
with message.tool_calls containing a function call to kanban_show.
The same JSON payload succeeds when sent directly to the Ollama server on the model host, so the failure is introduced only when the request is routed through PAIR.
This also prevents OpenAI-compatible agent/tool frameworks from recognizing and executing the requested function when the request is routed through PAIR.
Sanitized logs or screenshots
Confirmations
- I searched existing issues for duplicates.
- This is not a security vulnerability.
- I agree to follow the Code of Conduct.
- 主要语言
- Go
- 星标
- 1.6k
- 派生
- 266
- 平均合并
- 3 天 6 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/Personal-AI-Router 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
NVIDIA/Personal-AI-Router#165 ·
维护者通常 5 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 46/100
NVIDIA/Personal-AI-Router#164 ·
维护者通常 5 天内回复
-
enhancement
难度 4/5 一周以上 新手友好度 12/100
NVIDIA/Personal-AI-Router#162 ·
维护者通常 5 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 25/100
NVIDIA/Personal-AI-Router#154 · 1 条评论 ·
维护者通常 5 天内回复
-
[Feature]: [Ollama] Alert the user about model pull failures可能已有人在做 @ckelseynv 于 3 天前认领。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 56/100
NVIDIA/Personal-AI-Router#152 · 1 条评论 · 已指派 1 人 ·
维护者通常 5 天内回复
查看 NVIDIA/Personal-AI-Router 的全部 Issue
相似的 Issue
-
documentation help wanted needs-triage
难度 1/5 1-3 小时 新手友好度 75/100
hivecommons/hive#11606 · 2 条评论 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
gravitational/teleport#69869 ·
-
category:agent
难度 2/5 1-3 小时 新手友好度 82/100
LanternOps/breeze#8493 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
docs
难度 2/5 1-3 小时 新手友好度 70/100
shaiknoorullah/hg-mono#815 ·
维护者通常 1 天内回复