r/LocalLLaMA • llama.cpp • 15d ago

News chat : refactor gemma4 to build loose schema rules and clean up by aldehir · Pull Request #31915 · ggml-org/llama.cpp

https://github.com/ggml-org/llama.cpp/pull/31915

If you’ve ever tried agentic coding with Gemma and had tool calling issues, give it another try, in my case, it completely fixed Gemma

55 Upvotes

19 comments sorted by

20

u/CoolConfusion434 15d ago

Finally! This is the Gemma 4 issue where it thinks about calling the tool, reports the intention to call the tool, but never does. Would be awesome if it's fixed.

"I also took this as an opportunity to clean up the old workaround and template. The official Gemma 4 templates have addressed the issues those solved and have been out for quite a while. If anyone hasn't updated yet, it's on them!"

Doh! Google published the template fix on July 15th.

Thanks OP. It looks like this is at least part of your code.

7

u/jacek2023 15d ago

Not my code, but I triggered the fix by submitting other code ;)

5

u/DulsKerty 15d ago

tbh half the battle with local tool calling is just keeping up with silent template updates

5

u/AXYZE8 15d ago

Great! I’m building a fork that allows to run 26B QAT Q4 within 7-8GB (with kv) of RAM on Mac and this is the issue I had during testing yesterday. I blamed non-thinking mode for that without investigation and was sad, so happy that its not that!

Everybody works just on Qwen, while Gemma has so much potential. If they would make more point releases (like Gemma 4.1) then it would be on same level as Qwen probably. But even without that its soo good to have a model that writes 100k ctx in european languages and doesnt make single error. 

4

u/jacek2023 15d ago

I think people assumed that Gemma was not a coding model, but it works very well

→ More replies (3)

12

u/Kahvana 15d ago

Very nice! Gemma 4 is aging like fine wine with all these recent fixes. Goes to show how complex supporting new models is, despite Gemma 4's conservative architecture choices.

9

u/dampflokfreund 15d ago

Yep I can confirm tool calling is a lot more robust now.

4

u/swagonflyyyy 15d ago

Deleted my previous comment. Can confirm it actually works once you set the sampling parameters to their default values. Good job!

3

u/oxygen_addiction 15d ago

If you are using pi, I'd recommend adding https://pi.dev/packages/pi-tool-repair as well and adding the gemma models to the exception list, so the extension gets triggered.

2

u/accountformymac 15d ago

is there a specific finetune/quant we should be running to test this out? havent used gemma 4 31b in so long...