NVIDIA / NVIDIA/Personal-AI-Router
[Bug]: OpenAI-compatible tool calls are returned as plain text when routed through PAIR
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 250
- Avg merge
- 23h 27m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Ollama proxy's /v1/chat/completions entry point and compare how requests and responses are handled when tool definitions are present. Reproduce with the documented curl request against PAIR and direct Ollama, then verify that PAIR preserves message.tool_calls and finish_reason: tool_calls instead of returning the call as text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, ollama
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100