-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Description
Setup:
- Release b7361,
- Linux
- Nvidia RTX 3090
- CUDA backend
When running Mistral proposed test #2 - Call tools one at a time subsequently, the output is never what is expected.
Disclaimer: I can't assure my GPU is functionning correctly and am affraid it's currently dying... This because I recently got weird behavior sometimes. Unfortunately my GPU doesn't support ECC (the error correction mechanism newer cards have) so I can't monitor the error counter, and all I could do is to run FurMark in artifacts detection mode, and had zero artifacts during about 10 min of testing. But maybe the issue is intermittent!
I'm still posting this issue but I guess it needs to be reproduced to confirm...
Command:
/home/user/llama.cpp/build/bin/llama-server
--model /mnt/storage/GGUFs/Devstral-Small-2-24B-Instruct-2512/Devstral-Small-2-24B-Instruct-2512-UD-Q4_K_XL.gguf
--mmproj /mnt/storage/GGUFs/Devstral-Small-2-24B-Instruct-2512/mmproj-BF16.gguf
--ctx-size 30000
--no-context-shift
--n-gpu-layers 41
--temp 0.15
--top-p 0.95
--top-k 20
--min-p 0
--repeat-penalty 1
--jinja
--chat-template-file /mnt/storage/GGUFs/Devstral-Small-2-24B-Instruct-2512/template_mistral.jinja #untouched original Mistral template & prompt
--host 0.0.0.0
--port ${PORT}
Payload
{
"model": "Devstral-Small-2-24B-Instruct-2512_50k_vision",
"messages": [
{
"role": "system",
"content": "You are Devstral-Small-2-24B-Instruct-2512, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\nYou power an AI assistant called Le Chat.\nYour knowledge base was last updated on 2023-10-01.\nThe current date is 2025-12-12.\n\nWhen you're not sure about some information or when the user's request requires up-to-date or specific data, you must use the available tools to fetch the information. Do not hesitate to use tools whenever they can provide a more accurate or complete response. If no relevant tools are available, then clearly state that you don't have the information and avoid making up anything.\nIf the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. \"What are some good restaurants around me?\" => \"Where are you?\" or \"When is the next flight to Tokyo\" => \"Where do you travel from?\").\nYou are always very attentive to dates, in particular you try to resolve dates (e.g. \"yesterday\" is 2025-12-11) and when asked about information at specific dates, you discard information that is at another date.\nYou follow these instructions in all languages, and always respond to the user in the language they use or request.\nNext sections describe the capabilities that you have.\n\n# WEB BROWSING INSTRUCTIONS\n\nYou cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.\n\n# MULTI-MODAL INSTRUCTIONS\n\nYou have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.\nYou cannot read nor transcribe audio files or videos.\n\n# TOOL CALLING INSTRUCTIONS\n\nYou may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:\n\n1. When the request requires up-to-date information.\n2. When the request requires specific data that you do not have in your knowledge base.\n3. When the request involves actions that you cannot perform without tools.\n\nAlways prioritize using tools to provide the most accurate and helpful response. If tools are not available, inform the user that you cannot perform the requested action at the moment."
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "Compute the results steps by steps for the equations that involve only numbers displayed in the image. You have to call tools to perform the operations and can do one operation at a time per equation."
},
{
"type": "image_url",
"image_url": {
"url": "https://math-coaching.com/img/fiche/46/expressions-mathematiques.jpg"
}
}
]
}
],
"tools": [
{
"type": "function",
"function": {
"name": "add_number",
"description": "Add two numbers.",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "string",
"description": "The first number."
},
"b": {
"type": "string",
"description": "The second number."
}
},
"required": [
"a",
"b"
]
}
}
},
{
"type": "function",
"function": {
"name": "multiply_number",
"description": "Multiply two numbers.",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "string",
"description": "The first number."
},
"b": {
"type": "string",
"description": "The second number."
}
},
"required": [
"a",
"b"
]
}
}
},
{
"type": "function",
"function": {
"name": "substract_number",
"description": "Substract two numbers.",
"parameters": {
"type": "object",
"properties": {
"a": {
"type": "string",
"description": "The first number."
},
"b": {
"type": "string",
"description": "The second number."
}
},
"required": [
"a",
"b"
]
}
}
},
{
"type": "function",
"function": {
"name": "write_a_story",
"description": "Write a story about science fiction and people with badass laser sabers.",
"parameters": {}
}
},
{
"type": "function",
"function": {
"name": "terminal",
"description": "Perform operations from the terminal.",
"parameters": {
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "The command you wish to launch, e.g `ls`, `rm`, ..."
},
"args": {
"type": "string",
"description": "The arguments to pass to the command."
}
},
"required": [
"command"
]
}
}
},
{
"type": "function",
"function": {
"name": "python",
"description": "Call a Python interpreter with some Python code that will be ran.",
"parameters": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "The Python code to run"
},
"result_variable": {
"type": "string",
"description": "Variable containing the result you'd like to retrieve from the execution."
}
},
"required": [
"code",
"result_variable"
]
}
}
}
],
"tool_choice": "auto"
Respecting the original proposed test prompt (English text + French image)
3 scenarios:
- The model stops calling the tools in the middle of the successive calls, but without error (case
#1,#2and#3) - I get a malformed response (case
#3and#4) - The model calls tools but is stuck in an infinite loop (I don't have the logs for this, sorry)
#1
[
{
"role": "assistant",
"tool_calls": [
{
"id": "feDRqfFRt7EUA28XDdX0w1PpyjcVLWRo",
"function": {
"arguments": "{\"a\": \"2\", \"b\": \"3\"}",
"name": "multiply_number"
},
"type": "function"
}
],
"content": "Pour r\u00e9soudre les \u00e9quations impliquant uniquement des nombres, je vais proc\u00e9der \u00e9tape par \u00e9tape en utilisant les outils disponibles. Voici les \u00e9quations \u00e0 r\u00e9soudre :\n\n1. \\( 6 + 2 \\times 3 \\)\n2. \\( 3a + 7b - 2a \\)\n3. \\( 19 - (8 + 2) + 1 \\)\n4. \\( 5y \\times (6x - 7) \\)\n\nJe vais commencer par la premi\u00e8re \u00e9quation. Pour r\u00e9soudre \\( 6 + 2 \\times 3 \\), je dois d'abord effectuer la multiplication \\( 2 \\times 3 \\). Ensuite, j'ajouterai le r\u00e9sultat \u00e0 6."
},
{
"role": "tool",
"tool_call_id": "feDRqfFRt7EUA28XDdX0w1PpyjcVLWRo",
"name": "multiply_number",
"content": "6.0"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "gIhIsPB5PfxiMkAAmNqmlROeWJtx0Bed",
"function": {
"arguments": "{\"a\": \"6\", \"b\": \"6.0\"}",
"name": "add_number"
},
"type": "function"
}
],
"content": null
},
{
"role": "tool",
"tool_call_id": "gIhIsPB5PfxiMkAAmNqmlROeWJtx0Bed",
"name": "add_number",
"content": "12.0"
},
{
"role": "assistant",
"tool_calls": null,
"content": "Le r\u00e9sultat de la premi\u00e8re \u00e9quation est **12.0**.\n\nPassons maintenant \u00e0 la deuxi\u00e8me \u00e9quation : \\\\( 3a + 7b - 2a \\\\).\n\nPour r\u00e9soudre cette \u00e9quation, je dois d'abord combiner les termes semblables. Je vais calculer \\\\( 3a - 2a \\\\) en utilisant l'outil de soustraction."
}
]
#2
[
{
"role": "assistant",
"tool_calls": null,
"content": "Pour r\u00e9soudre les \u00e9quations impliquant uniquement des nombres, je vais proc\u00e9der \u00e9tape par \u00e9tape en utilisant les outils disponibles. Voici les \u00e9quations \u00e0 r\u00e9soudre :\n\n1. \\( 6 + 2 \\times 3 \\)\n2. \\( 3a + 7b - 2a \\)\n3. \\( 19 - (8 + 2) + 1 \\)\n4. \\( 5y \\times (6x - 7) \\)\n\nJe vais commencer par la premi\u00e8re \u00e9quation."
}
]
#3
Traceback (most recent call last):
File "/home/user/temp_working_dir/devstral_test_2.py", line 241, in <module>
result = MAP_FN[function_name](**json.loads(function_args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/temp_working_dir/devstral_test_2.py", line 35, in multiply_number
a, b = float(a), float(b)
^^^^^^^^
ValueError: could not convert string to float: 'y'
#4
Traceback (most recent call last):
File "/home/user/temp_working_dir/devstral_test_2.py", line 233, in <module>
result = MAP_FN[function_name](**json.loads(function_args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/temp_working_dir/devstral_test_2.py", line 39, in substract_number
a, b = float(a), float(b)
^^^^^^^^
ValueError: could not convert string to float: '3a'
#5
[
{
"role": "assistant",
"tool_calls": [
{
"id": "jHSEVVlFW6wd3V6EJMpkYc0bWvLIM5fg",
"function": {
"arguments": "{\"a\": \"2\", \"b\": \"3\"}",
"name": "multiply_number"
},
"type": "function"
}
],
"content": "Pour r\u00e9soudre les \u00e9quations impliquant uniquement des nombres, je vais proc\u00e9der \u00e9tape par \u00e9tape en utilisant les outils disponibles. Voici les \u00e9quations \u00e0 r\u00e9soudre :\n\n1. \\( 6 + 2 \\times 3 \\)\n2. \\( 3a + 7b - 2a \\)\n3. \\( 19 - (8 + 2) + 1 \\)\n4. \\( 5y \\times (6x - 7) \\)\n\nJe vais commencer par la premi\u00e8re \u00e9quation. Pour r\u00e9soudre \\( 6 + 2 \\times 3 \\), je dois d'abord effectuer la multiplication \\( 2 \\times 3 \\)."
},
{
"role": "tool",
"tool_call_id": "jHSEVVlFW6wd3V6EJMpkYc0bWvLIM5fg",
"name": "multiply_number",
"content": "6.0"
},
{
"role": "assistant",
"tool_calls": null,
"content": "{\n \"tool_calls\": [\n {\n \"name\": \"add_number\",\n \"arguments\": {\n \"a\": \"6\",\n \"b\": \"6.0\"\n },\n \"id\": \"jHSEVVlF224B3V6EJMpkYc0bWvLIM5fg\"\n }\n ],\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Le r\u00e9sultat de \\\\( 2 \\\\times 3 \\\\) est \\\\( 6.0 \\\\). Maintenant, j'ajoute ce r\u00e9sultat \u00e0 6 pour r\u00e9soudre \\\\( 6 + 2 \\\\times 3 \\\\).\"\n }\n ]\n}"
}
]
Translating the image to English using nano-banana (so English text + English image)
- Almost always makes all the tool calls, reaching the final step
- Almost always gets it wrong (but, that said, the "expected output" is wrong too, so...)