`ai/functiongemma` tool calls are not parsed into `tool_calls`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start by running the provided curl request against the OpenAI-compatible chat completions endpoint, then trace the response parsing and stop-token handling for ai/functiongemma. Implement support for its function-call delimiters and verify that tool_calls is populated, content is empty, and finish_reason is tool_calls instead of length.
Written by the indexing model from the issue text.
Description
Summary
ai/functiongemma emits well-formed tool-call tokens in its own format, but Docker Model Runner does not parse them:
tool_callsstaysnulland the raw<start_function_call>…<end_function_call>text is returned inmessage.content;<end_function_call>is not treated as a stop token, so the call repeats untilmax_tokensandfinish_reasonis"length".
There is no error. To a client, the response looks like the model simply did not use the tool.
Steps to reproduce
docker model pull ai/functiongemma
curl -s http://localhost:12434/engines/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ai/functiongemma",
"max_tokens": 400,
"messages": [{"role":"user","content":"What is the current time? Use the get_time tool."}],
"tools": [{"type":"function","function":{
"name":"get_time","description":"Get the current time",
"parameters":{"type":"object","properties":{}}}}]
}' | jq '.choices[0]'
Actual
tool_calls : null
finish_reason : "length"
content : "<start_function_call>call:get_time{}<end_function_call>call:get_time{}<end_function_call>call:get_ti…"
Expected
tool_calls populated, finish_reason: "tool_calls", and no call tokens in content. For comparison, an equivalent request to Ollama returns:
{"tool_calls": [{"id": "call_o3fkhnnc", "function": {"name": "get_time", "arguments": {}}}]}
with content empty.
Suggested resolution
Parse the <start_function_call>…<end_function_call> format into tool_calls and treat <end_function_call> as a stop token.
Related: #1046. /api/show exposes no capabilities, so a client also cannot check for tool support before making the request.
Environment
- Model Runner client
v1.2.6, Docker Desktop engine29.7.2 - Backend
llama.cpp b9879-metal, macOS, Apple Silicon - Model:
ai/functiongemma
- Dominant language
- Go
- Stars
- 665
- Forks
- 161
- Avg merge
- 4h 25m
- Merged PRs (30d)
- 18
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing 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.
More from docker/model-runner
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
docker/model-runner#1118 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
docker/model-runner#1107 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 43/100
docker/model-runner#1103 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
docker/model-runner#1100 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
docker/model-runner#1077 · 1 comment ·
Maintainers usually reply within 1 day
All issues in docker/model-runner
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Add CybeDefendOpen
Difficulty 1/5 Under an hour Newbie friendliness 66/100
slavakurilyak/awesome-ai-agents#1031 ·