[GH-ISSUE #9947] llama3.2 always uses tool even when the message is not related to the tool #6512

Closed
opened 2026-04-12 18:06:16 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @nikeshkedlaya on GitHub (Mar 22, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9947

What is the issue?

Llama 3.2 automatically picks tool even when the prompt does not require or request the use of such a tool. This leads to unnecessary tool activation and responses that are not aligned with the user’s request.

The tool I have used

TOOLS = [ { "type": "function", "function": { "name": "get_invoice", "description": "get the invoice or invoices of the customers who purchased the items or materials from the company", "parameters": { "type": "object", "properties": { "customer_name": { "type": "string", "description": """Customer or vendor name who purchases or purchased materials or items from a company. some example for the customer names are google, amazon, flipkart, facebook, meta etc. Customer name can also have spaces for example alphabet llc, amadeus pvt ltd, amadeus labs """ }, "invoice_number": { "type": "string", "description": """Invoice number for the purcahse of item or items or material or materials Example for the invoice number can be 1234, INV1234, inv4563 etc. """ }, "from_date": { "type": "string", "description": """from date of the invoice or invoice. date can be of any format like 01-01-1681, 01/01/1681, January 01 1681, 01 Janaury 1681, 01 Jan 1681 etc. """ }, "to_date": { "type": "string", "description": """from date of the invoice or invoice. date can be of any format like 01-01-1681, 01/01/1681, January 01 1681, 01 Janaury 1681, 01 Jan 1681 etc. """ }, "product": { "type": "string", "description": """Name of the product in the invoice. Example for the product names are Television, laptop, refrigerators, washing machine, mobile, phone etc. Product names can also have spaces """ }, "quantity": { "type": "string", "description": """quantity of the invoice items or materials or products. Example for the quantity are 5, 10, 100, 3, 8, 11, 63 etc. Quantiy can be of any numerical number """ }, "price": { "type": "string", "description": """price of the invoice items or materials or products. Example for the quantity are 5, 10, 100, 3, 8, 11, 63, 1.2, 654.6 etc. Quantiy can be of any numerical number and can also contain decimal values. """ }, "comparision_flag": { "type": "string", "description": """This is the flag which holds the comparision values. Example for this is greater than, less than, equals to, total etc. This can also have spaces """ } }, } } } ]

The promt from the user: "what is the capital of France?"

Response from the API /api/chat

{"model":"llama3.2-tool","created_at":"2025-03-22T19:20:37.137633Z","message":{"role":"assistant","content":"","tool_calls":[{"function":{"name":"get_invoice","arguments":{"comparision_flag":"","customer_name":"","from_date":"","invoice_number":"","price":"","product":"","quantity":"","to_date":""}}}]},"done_reason":"stop","done":true,"total_duration":3363648167,"load_duration":742118708,"prompt_eval_count":810,"prompt_eval_duration":1688000000,"eval_count":51,"eval_duration":932000000}

Sometimes, I have also observed that, it returns with the functions which is not even defined. It comes with its own random function names and argument lists.

Relevant log output


OS

macOS

GPU

Apple

CPU

Apple

Ollama version

ollama version is 0.6.0

Originally created by @nikeshkedlaya on GitHub (Mar 22, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9947 ### What is the issue? Llama 3.2 automatically picks tool even when the prompt does not require or request the use of such a tool. This leads to unnecessary tool activation and responses that are not aligned with the user’s request. The tool I have used `TOOLS = [ { "type": "function", "function": { "name": "get_invoice", "description": "get the invoice or invoices of the customers who purchased the items or materials from the company", "parameters": { "type": "object", "properties": { "customer_name": { "type": "string", "description": """Customer or vendor name who purchases or purchased materials or items from a company. some example for the customer names are google, amazon, flipkart, facebook, meta etc. Customer name can also have spaces for example alphabet llc, amadeus pvt ltd, amadeus labs """ }, "invoice_number": { "type": "string", "description": """Invoice number for the purcahse of item or items or material or materials Example for the invoice number can be 1234, INV1234, inv4563 etc. """ }, "from_date": { "type": "string", "description": """from date of the invoice or invoice. date can be of any format like 01-01-1681, 01/01/1681, January 01 1681, 01 Janaury 1681, 01 Jan 1681 etc. """ }, "to_date": { "type": "string", "description": """from date of the invoice or invoice. date can be of any format like 01-01-1681, 01/01/1681, January 01 1681, 01 Janaury 1681, 01 Jan 1681 etc. """ }, "product": { "type": "string", "description": """Name of the product in the invoice. Example for the product names are Television, laptop, refrigerators, washing machine, mobile, phone etc. Product names can also have spaces """ }, "quantity": { "type": "string", "description": """quantity of the invoice items or materials or products. Example for the quantity are 5, 10, 100, 3, 8, 11, 63 etc. Quantiy can be of any numerical number """ }, "price": { "type": "string", "description": """price of the invoice items or materials or products. Example for the quantity are 5, 10, 100, 3, 8, 11, 63, 1.2, 654.6 etc. Quantiy can be of any numerical number and can also contain decimal values. """ }, "comparision_flag": { "type": "string", "description": """This is the flag which holds the comparision values. Example for this is greater than, less than, equals to, total etc. This can also have spaces """ } }, } } } ]` The promt from the user: "what is the capital of France?" Response from the API /api/chat `{"model":"llama3.2-tool","created_at":"2025-03-22T19:20:37.137633Z","message":{"role":"assistant","content":"","tool_calls":[{"function":{"name":"get_invoice","arguments":{"comparision_flag":"","customer_name":"","from_date":"","invoice_number":"","price":"","product":"","quantity":"","to_date":""}}}]},"done_reason":"stop","done":true,"total_duration":3363648167,"load_duration":742118708,"prompt_eval_count":810,"prompt_eval_duration":1688000000,"eval_count":51,"eval_duration":932000000}` Sometimes, I have also observed that, it returns with the functions which is not even defined. It comes with its own random function names and argument lists. ### Relevant log output ```shell ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version ollama version is 0.6.0
GiteaMirror added the bug label 2026-04-12 18:06:16 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 22, 2025):

https://github.com/ollama/ollama/issues/6127

<!-- gh-comment-id:2745699909 --> @rick-github commented on GitHub (Mar 22, 2025): https://github.com/ollama/ollama/issues/6127
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#6512