`ai/functiongemma` tool calls are not parsed into `tool_calls`

Open
#1,045 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, go
Domain
ai, api

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_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
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/model-runner

All issues in docker/model-runner

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.