Summary
ai/functiongemma emits well-formed tool-call tokens in its own format, but Docker Model Runner does not parse them:
tool_calls stays null and the raw <start_function_call>…<end_function_call> text is returned in message.content;
<end_function_call> is not treated as a stop token, so the call repeats until max_tokens and finish_reason is "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 engine 29.7.2
- Backend
llama.cpp b9879-metal, macOS, Apple Silicon
- Model:
ai/functiongemma
Summary
ai/functiongemmaemits 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
Actual
Expected
tool_callspopulated,finish_reason: "tool_calls", and no call tokens incontent. For comparison, an equivalent request to Ollama returns:{"tool_calls": [{"id": "call_o3fkhnnc", "function": {"name": "get_time", "arguments": {}}}]}with
contentempty.Suggested resolution
Parse the
<start_function_call>…<end_function_call>format intotool_callsand treat<end_function_call>as a stop token.Related: #1046.
/api/showexposes nocapabilities, so a client also cannot check for tool support before making the request.Environment
v1.2.6, Docker Desktop engine29.7.2llama.cpp b9879-metal, macOS, Apple Siliconai/functiongemma