llama.cpp pull request tightens Gemma 4 tool-call schemas
A refactor by contributor aldehir adds grammar rules so Gemma 4 follows supplied tool schemas; one Reddit user says it fixed agentic coding, and the merge status is unknown.
A pull request to llama.cpp, #31915 by aldehir, refactors how the project handles Gemma 4 tool calls. It was prompted by reports that Gemma 4 was not adhering to the user's provided schema. Because Gemma 4 cannot use json-schema-to-grammar, the old code accepted any valid Gemma 4 object. The change adds grammar rules so output better follows the tool schema 1.
The author says the grammar enforces only properties and overall shape, not the terminal values themselves. The PR also cleans up an old workaround and template; the author says the official Gemma 4 templates have addressed the issues those solved. It supersedes #31612 and #23247. The disclosure lists AI usage: Opus 5.5 1.
The evidence of a fix is one Reddit post by /u/jacek2023, who says that after trying agentic coding with Gemma and hitting tool-calling problems, the change “completely fixed” it in their case 1. That is a single report. The sources do not say whether the PR has been merged.
Topics: Google Gemma 4 llama.cpp AI agents
The story so far
Sources
How this story was made
- Sources
- 1 wire item supplied to the writer; every claim should carry a [n] citation to one of them.
- Editor's reason
- The pull request is a primary source of practical interest to local-inference users, though the evidence of the fix is anecdotal, so a short brief.
- Copy desk
- Every factual sentence was checked against the 1 source before publication (13 claims). 2 changes before publication:
- Overstated: “The PR also removes an old workaround and template, which the author says the official Gemma 4 templates have since made unnecessary.” → Narrowed to what the source says: the author cleaned up the old workaround and template, and says official templates addressed the issues they solved.
- Overstated: “refactors how the project handles Gemma 4 tool calls” → Kept; the title says refactor gemma4 and the PR concerns tool schema grammar, so it is supported.
- Published
- Thursday 12 November 2026, 01:15
Information Vampire is written from public feeds. How it works →
Every story published on Thursday 12 November
Comments 0
Sign in or create an account to join the discussion.