[GH-ISSUE #10897] cogito:3b with tools not working with Ollama 0.8.0 #69221

Closed
opened 2026-05-04 17:29:55 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @HSD-PZinieris on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10897

Originally assigned to: @ParthSareen on GitHub.

What is the issue?

I have just updated to Ollama 0.8.0 and my chat requests with tools are failing. It only works if I remove the tools from my requests!
Note that before the upgrade the same requests were working fine

I removed and downloaded cogito:3b after the upgrade but it didn't changed anything. Trying the same requests with qwen3:4b are working fine

Relevant log output

Request:
curl http://localhost:11434/api/chat -d '{"Messages":[{"Role":"User","Content":"What weather will be having tomorrow night in 
New York?"}],"Tools":[{"Type":"function","Function":{"Name":"GetCurrentWeather","Description":"Gets the weather for the given 
location.\\r\\nIf measuringUnit is not provided, use Celsius.\\r\\nIf whichDay is not not provided, use Now.","Parameters":
{"Type":"object","Properties":{"location":{"Type":"string","Description":"The location or city to get the weather 
for","Enum":null},"measuringUnit":{"Type":"string","Description":"The unit to measure the temperature in","Enum":
["Celsius","Fahrenheit"]},"whichDay":{"Type":"string","Description":"Which day or week the report is requested","Enum":
["Now","Today","Tomorrow","DayAfterTomorrow","Week","Forecast"]}},"required":["location","measuringUnit","whichDay"]}}},
{"Type":"function","Function":{"Name":"GetUserLocation","Description":"Use this to get the user current location.","Parameters":
{"Type":"object","Properties":{},"required":[]}}}],"Model":"cogito:3b","Stream":true}'

Response:
{"error":"invalid character '\u003c' looking for beginning of value"}

OS

Windows

GPU

No response

CPU

Intel

Ollama version

0.8.0

Originally created by @HSD-PZinieris on GitHub (May 29, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10897 Originally assigned to: @ParthSareen on GitHub. ### What is the issue? I have just updated to Ollama 0.8.0 and my chat requests with tools are failing. It only works if I remove the tools from my requests! Note that before the upgrade the same requests were working fine I removed and downloaded cogito:3b after the upgrade but it didn't changed anything. Trying the same requests with qwen3:4b are working fine ### Relevant log output ```shell Request: curl http://localhost:11434/api/chat -d '{"Messages":[{"Role":"User","Content":"What weather will be having tomorrow night in New York?"}],"Tools":[{"Type":"function","Function":{"Name":"GetCurrentWeather","Description":"Gets the weather for the given location.\\r\\nIf measuringUnit is not provided, use Celsius.\\r\\nIf whichDay is not not provided, use Now.","Parameters": {"Type":"object","Properties":{"location":{"Type":"string","Description":"The location or city to get the weather for","Enum":null},"measuringUnit":{"Type":"string","Description":"The unit to measure the temperature in","Enum": ["Celsius","Fahrenheit"]},"whichDay":{"Type":"string","Description":"Which day or week the report is requested","Enum": ["Now","Today","Tomorrow","DayAfterTomorrow","Week","Forecast"]}},"required":["location","measuringUnit","whichDay"]}}}, {"Type":"function","Function":{"Name":"GetUserLocation","Description":"Use this to get the user current location.","Parameters": {"Type":"object","Properties":{},"required":[]}}}],"Model":"cogito:3b","Stream":true}' Response: {"error":"invalid character '\u003c' looking for beginning of value"} ``` ### OS Windows ### GPU _No response_ ### CPU Intel ### Ollama version 0.8.0
GiteaMirror added the toolsbug labels 2026-05-04 17:29:56 -05:00
Author
Owner

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

Same thing happens for me with cogito:latest on macOS M1 Pro

Request:


curl http://localhost:11434/api/chat -d '{
  "model": "cogito:latest",
  "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:

{
  "error": "invalid character '<' looking for beginning of value"
}
<!-- gh-comment-id:2919684054 --> @rensftw commented on GitHub (May 29, 2025): Same thing happens for me with `cogito:latest` on macOS M1 Pro Request: <details> <pre> <code> curl http://localhost:11434/api/chat -d '{ "model": "cogito:latest", "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"] } } } ] }' </code> </pre> </details> Response: ```json { "error": "invalid character '<' looking for beginning of value" } ```
Author
Owner

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

The template for cogito wraps each ToolCalls item in <tool_call></tool_call> tags, unlike most models that wrap the entire list. Same is true for nemotron-mini:4b-instruct-q4_K_M and some user models like MFDoom/deepseek-r1-tool-calling and maryasov/qwen2.5-coder-cline.

<!-- gh-comment-id:2919989108 --> @rick-github commented on GitHub (May 29, 2025): The template for cogito wraps each `ToolCalls` item in `<tool_call></tool_call>` tags, unlike most models that wrap the entire list. Same is true for nemotron-mini:4b-instruct-q4_K_M and some user models like MFDoom/deepseek-r1-tool-calling and maryasov/qwen2.5-coder-cline.
Author
Owner

@pihapi commented on GitHub (May 30, 2025):

ollama --version
ollama version is 0.9.0

ebdm/gemma3-enhanced:12b

level=ERROR source=routes.go:1530 msg="failed to create tool parser" error="invalid character '<' looking for beginning of value"

Everything worked, but then updates arrived and everything stopped working!

In what version did this work, please?
And is it possible to disable updates?
Or is it better to switch to LMStudio ... ?

<!-- gh-comment-id:2922353468 --> @pihapi commented on GitHub (May 30, 2025): ollama --version ollama version is 0.9.0 ebdm/gemma3-enhanced:12b level=ERROR source=routes.go:1530 msg="failed to create tool parser" error="invalid character '<' looking for beginning of value" Everything worked, but then updates arrived and everything stopped working! In what version did this work, please? And is it possible to disable updates? Or is it better to switch to LMStudio ... ?
Author
Owner

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

You can revert to a version of ollama that doesn't include the tool changes by running OllamaSetup.exe from the Assets section of a previous release.

<!-- gh-comment-id:2922479646 --> @rick-github commented on GitHub (May 30, 2025): You can revert to a version of ollama that doesn't include the tool changes by running [OllamaSetup.exe](https://github.com/ollama/ollama/releases/download/v0.7.1/OllamaSetup.exe) from the Assets section of a previous release.
Author
Owner

@ParthSareen commented on GitHub (May 30, 2025):

Sorry about that! Will check it out today!

<!-- gh-comment-id:2922716935 --> @ParthSareen commented on GitHub (May 30, 2025): Sorry about that! Will check it out today!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69221