[GH-ISSUE #12200] The data that should be in the tool_calls section comes in the content section #33875

Closed
opened 2026-04-22 17:00:57 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @docjon09 on GitHub (Sep 6, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12200

What is the issue?

When I run the api request with the following body

{
  "model": "hermes-3-8b:latest",
  "messages": [
    {
      "role": "user",
      "content": "List all books"
    }
  ],
  "tools": [
    {
        "type": "function",
        "function": {
            "name": "fetch_product_by_entity_code_and_entity_key_code",
            "description": "Fetch the product with given entity code and given entity key code",
            "parameters": {
                "type": "object",
                "properties": {
                    "entityCode": {
                        "type": "string",
                        "description": "The entity code of the product"
                    },
                    "entityKeyCode": {
                        "type": "string",
                        "description": "The entity key code of the product"
                    }
                },
                "required": ["entityCode", "entityKeyCode"]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "fetch_all_books",
            "description": "Fetch all the books",
            "parameters": {}
        }
    }
  ],
  "options": {
    "temperature": 0
  },
  "stream": false,
}

The output is as follows

{
    "model": "hermes-3-8b:latest",
    "created_at": "2025-09-06T10:53:48.80640778Z",
    "message": {
        "role": "assistant",
        "content": "[\n  {\"name\":\"fetch_all_books\",\"arguments\":{}}\n]"
    },
    "done_reason": "stop",
    "done": true,
    "total_duration": 8895005988,
    "load_duration": 70760242,
    "prompt_eval_count": 266,
    "prompt_eval_duration": 7481875206,
    "eval_count": 15,
    "eval_duration": 1341630906
}

Notice that the model calls the correct tool but the tool requested is mentioned in content instead of tool_calls
This issue doesn't come when the user query is Fetch all books instead of List all books

Relevant log output


OS

Linux

GPU

No response

CPU

No response

Ollama version

0.11.8

Originally created by @docjon09 on GitHub (Sep 6, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12200 ### What is the issue? When I run the api request with the following body ``` { "model": "hermes-3-8b:latest", "messages": [ { "role": "user", "content": "List all books" } ], "tools": [ { "type": "function", "function": { "name": "fetch_product_by_entity_code_and_entity_key_code", "description": "Fetch the product with given entity code and given entity key code", "parameters": { "type": "object", "properties": { "entityCode": { "type": "string", "description": "The entity code of the product" }, "entityKeyCode": { "type": "string", "description": "The entity key code of the product" } }, "required": ["entityCode", "entityKeyCode"] } } }, { "type": "function", "function": { "name": "fetch_all_books", "description": "Fetch all the books", "parameters": {} } } ], "options": { "temperature": 0 }, "stream": false, } ``` The output is as follows ``` { "model": "hermes-3-8b:latest", "created_at": "2025-09-06T10:53:48.80640778Z", "message": { "role": "assistant", "content": "[\n {\"name\":\"fetch_all_books\",\"arguments\":{}}\n]" }, "done_reason": "stop", "done": true, "total_duration": 8895005988, "load_duration": 70760242, "prompt_eval_count": 266, "prompt_eval_duration": 7481875206, "eval_count": 15, "eval_duration": 1341630906 } ``` Notice that the model calls the correct tool but the tool requested is mentioned in content instead of tool_calls This issue doesn't come when the user query is **Fetch all books** instead of **List all books** ### Relevant log output ```shell ``` ### OS Linux ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.11.8
GiteaMirror added the bug label 2026-04-22 17:00:57 -05:00
Author
Owner

@docjon09 commented on GitHub (Sep 6, 2025):

The model used is hermes-3-8b

<!-- gh-comment-id:3261863367 --> @docjon09 commented on GitHub (Sep 6, 2025): The model used is hermes-3-8b
Author
Owner

@rick-github commented on GitHub (Sep 6, 2025):

Where did you get the model from?

<!-- gh-comment-id:3261882160 --> @rick-github commented on GitHub (Sep 6, 2025): Where did you get the model from?
Author
Owner

@docjon09 commented on GitHub (Sep 6, 2025):

From the ollama library https://ollama.com/library/hermes3:8b

<!-- gh-comment-id:3261903724 --> @docjon09 commented on GitHub (Sep 6, 2025): From the ollama library https://ollama.com/library/hermes3:8b
Author
Owner

@rick-github commented on GitHub (Sep 6, 2025):

https://ollama.com/library/hermes3:8b is not the same as hermes-3-8b. At the minimum the model has been renamed and possibly modified. If I use the model from the ollama library, your JSON request works fine.

for i in {1..10} ; do curl -s localhost:11434/api/chat -d @12200.json  | jq -c .message.tool_calls ; done | sort | uniq -c
     10 [{"function":{"name":"fetch_all_books","arguments":{}}}]
<!-- gh-comment-id:3261909473 --> @rick-github commented on GitHub (Sep 6, 2025): https://ollama.com/library/hermes3:8b is not the same as hermes-3-8b. At the minimum the model has been renamed and possibly modified. If I use the model from the ollama library, your JSON request works fine. ```console for i in {1..10} ; do curl -s localhost:11434/api/chat -d @12200.json | jq -c .message.tool_calls ; done | sort | uniq -c 10 [{"function":{"name":"fetch_all_books","arguments":{}}}] ```
Author
Owner

@docjon09 commented on GitHub (Sep 6, 2025):

Hi @rick-github , you were right. This wasn't downloaded from the library but from ModelFile and Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf file (a colleague did the installation so I wasn't aware). I will try with the hermes3:8b model from the library. Thanks a lot for the quick reply!

<!-- gh-comment-id:3262335757 --> @docjon09 commented on GitHub (Sep 6, 2025): Hi @rick-github , you were right. This wasn't downloaded from the library but from ModelFile and Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf file (a colleague did the installation so I wasn't aware). I will try with the hermes3:8b model from the library. Thanks a lot for the quick reply!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#33875