Tool calling is completely broken with llama.cpp (+ workaround)

#10
by Sacker96 - opened

Tool calling doesn't work. So any coding agent will fail to work

test prompt;

"analyse the current project and give me some recommendations for cleaning up the code"

The user wants me to analyze the current project and provide code cleanup recommendations. Let me explore the project structure first, then read key files to understand the codebase and identify areas for improvement.

Let me explore the project structure and analyze the codebase for cleanup opportunities.

  ls -la /home/user/workspace/project/

then it just stops

I think it's a known issue with the qwen models, but can be fixed by using following chat template

https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates/tree/main

and passing it to llama-server like so

--jinja \
--chat-template-file ./qwen-chat-template.jinja 

This is interesting; I too am using llama server and haven’t found this behavior. I primarily use Hermes Agent as the harness. Does it stop after every tool call? I found the tool calling to be one of the strengths, especially very long chains.

Sign up or log in to comment