Gemma 4, llama.cpp, tool calls, and tool results - ChatGPT fixed it for me
r/LocalLLaMA
•
Generative AI
Open Source AI
I have been trying to use Gemma 4 for tool calling but kept getting errors like a lot of people. I asked ChatGPT to help me figure it out. Gave it the chat template, it had me try a few different messages, and the tool calls kept breaking. It could make a tool call but would not take the result (either crash with a 400/500 error or just make another tool call again). ChatGPT suggested I look at the llama.cpp code to figure it out - gave me a few things to search for which I found in common/chat.cpp. I had it review the code and come up with a fix.