[GH-ISSUE #10899] qwen2.5-coder and llama3.1 return empty content with tools #69223

Closed
opened 2026-05-04 17:30:27 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @rensftw on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10899

Originally assigned to: @ParthSareen on GitHub.

What is the issue?

Description

When I call a model with tools, I always get an empty response from Ollama (like "content": "")
I have observed this behaviour with:

  • qwen2.5-coder:7b
  • llama3.1:latest
  • devstral:latest

Interestingly, qwen3:8b does work with tools and correctly streams back a response.

Example call:

Request:

curl http://localhost:11434/api/chat -d '{
  "model": "qwen2.5-coder:7b",
  "messages": [
    {
      "role": "user",
      "content": "What is the weather today in Toronto?"
    }
  ],
  "stream": true,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_current_weather",
        "description": "Get the current weather for a location",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "The location to get the weather for, e.g. San Francisco, CA"
            },
            "format": {
              "type": "string",
              "description": "The format to return the weather in, e.g. 'celsius' or 'fahrenheit'",
              "enum": ["celsius", "fahrenheit"]
            }
          },
          "required": ["location", "format"]
        }
      }
    }
  ]
}' 

Response:

{
  "model": "qwen2.5-coder:7b",
  "created_at": "2025-05-29T15:32:39.778126Z",
  "message": {
    "role": "assistant",
    "content": "",
    "tool_calls": [
      {
        "function": {
          "name": "get_current_weather",
          "arguments": {
            "format": "celsius",
            "location": "Toronto"
          }
        }
      }
    ]
  },
  "done": false
}
{
  "model": "qwen2.5-coder:7b",
  "created_at": "2025-05-29T15:32:39.815178Z",
  "message": {
    "role": "assistant",
    "content": ""
  },
  "done_reason": "stop",
  "done": true,
  "total_duration": 2543474417,
  "load_duration": 676834417,
  "prompt_eval_count": 224,
  "prompt_eval_duration": 972060750,
  "eval_count": 25,
  "eval_duration": 890930417
}

Relevant log output


OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.8.0

Originally created by @rensftw on GitHub (May 29, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10899 Originally assigned to: @ParthSareen on GitHub. ### What is the issue? # Description When I call a model with tools, I **always** get an empty response from Ollama (like `"content": ""`) I have observed this behaviour with: - `qwen2.5-coder:7b` - `llama3.1:latest` - `devstral:latest` Interestingly, `qwen3:8b` does work with tools and correctly streams back a response. ## Example call: Request: ```sh curl http://localhost:11434/api/chat -d '{ "model": "qwen2.5-coder:7b", "messages": [ { "role": "user", "content": "What is the weather today in Toronto?" } ], "stream": true, "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather for a location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The location to get the weather for, e.g. San Francisco, CA" }, "format": { "type": "string", "description": "The format to return the weather in, e.g. 'celsius' or 'fahrenheit'", "enum": ["celsius", "fahrenheit"] } }, "required": ["location", "format"] } } } ] }' ``` Response: ```json { "model": "qwen2.5-coder:7b", "created_at": "2025-05-29T15:32:39.778126Z", "message": { "role": "assistant", "content": "", "tool_calls": [ { "function": { "name": "get_current_weather", "arguments": { "format": "celsius", "location": "Toronto" } } } ] }, "done": false } { "model": "qwen2.5-coder:7b", "created_at": "2025-05-29T15:32:39.815178Z", "message": { "role": "assistant", "content": "" }, "done_reason": "stop", "done": true, "total_duration": 2543474417, "load_duration": 676834417, "prompt_eval_count": 224, "prompt_eval_duration": 972060750, "eval_count": 25, "eval_duration": 890930417 } ``` ### Relevant log output ```shell ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.8.0
GiteaMirror added the toolsbug labels 2026-05-04 17:30:28 -05:00
Author
Owner

@rick-github commented on GitHub (May 29, 2025):

For most non-thinking tools, the content is the tool call. The context gets converted into the tool_calls structure and is cleared.

5f57b0ef42/server/routes.go (L1581)

qwen3:8b, as a thinking model, has the tool call removed from the output but the remaining thinking is returned.

<!-- gh-comment-id:2919867957 --> @rick-github commented on GitHub (May 29, 2025): For most non-thinking tools, the content is the tool call. The context gets converted into the `tool_calls` structure and is cleared. https://github.com/ollama/ollama/blob/5f57b0ef4268a6bd9e8043d54c351a608a7e1bca/server/routes.go#L1581 qwen3:8b, as a thinking model, has the tool call removed from the output but the remaining thinking is returned.
Author
Owner

@rensftw commented on GitHub (May 29, 2025):

@rick-github You're right

I hadn't read all of the chunked responses until now - looks like qwen3:8b prints only the thinking part and not the actual result from the tool.

<!-- gh-comment-id:2919932481 --> @rensftw commented on GitHub (May 29, 2025): @rick-github You're right I hadn't read all of the chunked responses until now - looks like `qwen3:8b` prints only the thinking part and not the actual result from the tool.
Author
Owner

@rick-github commented on GitHub (May 29, 2025):

Note that in 0.9.0 this will be returned in the thinking field and content will be empty again.

<!-- gh-comment-id:2919936483 --> @rick-github commented on GitHub (May 29, 2025): Note that in 0.9.0 this will be returned in the `thinking` field and `content` will be empty again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69223