Repository: ollama
Issue: The <toolcall> in nemotron-mini. Again.
Labels: bug

### What is the issue?

# The problem

I am trying to implement the agent swarm for ollama from scratch. I made the triage agent: the intent navigator. It should call the `navigate_to_refund_agent_tool` or `navigate_to_sales_agent_tool` depends on user's choose. Both tools got empty arguments like

```tsx
function navigate_to_refund_agent_tool(/* no arguments */) {

}

function navigate_to_sales_agent_tool(/* no arguments */) {

}
```

When I send the following curl request it return the nasty XML output.

```bash
curl --location 'http://localhost:11434/api/chat' \
--header 'Content-Type: application/json' \
--data '{
    "model": "nemotron-mini",
    "messages": [
        {
            "role": "system",
            "content": "You are to triage a users request, and call a tool to transfer to the right agent. There are two agents you can transfer to: navigate_to_refund_agent_tool and navigate_to_sales_agent_tool. Untill calling any function, you must ask the user for their agent. Before navigation make sure you choose well. Do not spam function executions"
        },
        {
            "role": "user",
            "content": "Navigate me to sales agent"
        }
    ],
    "stream": false,
    "options": {
        "top_k": 20,
        "top_p": 0.4,
        "temperature": 0.5
    },
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "navigate_to_sales_agent_tool",
                "description": "Navigate to sales agent",
                "parameters": {
                    "type": "object",
                    "required": [
                    ],
                    "properties": {
                    }
                }
            }
        },
        {
            "type": "function",
            "function": {
                "name": "navigate_to_refund_agent_tool",
                "description": "Navigate to refund agent",
                "parameters": {
                    "type": "object",
                    "required": [
                    ],
                    "properties": {
                    }
                }
            }
        }
    ]
}'
```

Time-to-time the output is 

```
<toolcall> {\"type\": \"function\", \"arguments\": { \"name\": \"navigate_to_sales_agent_tool\" }} </toolcall>
```

Also, sometimes the JSON in `<toolcall>` tag is invalid

# To solve the problem

1. **How do I hardcode the model version? I am seeing you are updating models without publishing the new tag**

![image](https://github.com/user-attachments/assets/ac357882-5803-40d0-9c6f-f4b3b1fc6d8f)

This is definitely going to break the AI prompts, I need to fetch exactly the defined model version even if it was uploaded 10 years ago

2. **When are you planning to clear all fake labels with tools support?**

![image](https://github.com/user-attachments/assets/155d1fad-aa3f-47bd-b01c-66c8742f5d2e)

The XML output is a real common for all models with tools in the list. This is a fake. Give me the truly information about the state of the framework: without tools it unusable and pointless waste of time


### OS

Linux

### GPU

Nvidia

### CPU

Intel

### Ollama version

0.5.4