YOU ARE VIEWING ONE ITEM FROM THE AICRIER FEED

Gemma 4 template breaks tool schemas

AICrier tracks AI developer news across Product Hunt, GitHub, Hacker News, YouTube, X, arXiv, and more. This page keeps the article you opened front and center while giving you a path into the live feed.

// WHAT AICRIER DOES

7+

TRACKED FEEDS

24/7

SCRAPED FEED

Short summaries, external links, screenshots, relevance scoring, tags, and featured picks for AI builders.

Gemma 4 template breaks tool schemas
OPEN LINK ↗
// 45d agoPRODUCT UPDATE

Gemma 4 template breaks tool schemas

A user found that Gemma 4's default chat template strips nested JSON Schema constructs from tool definitions, so nullable `$ref`-based parameters lose meaning before the model sees them. A small Jinja patch that preserves schema structure fixed tool calling across the affected setups.

// ANALYSIS

This is a classic "the model isn't the bug, the serialization layer is" failure: if the template flattens schema before the prompt is built, tool calling can look unreliable even when the weights are fine.

  • Common MCP and tool schemas rely on `anyOf`, `$ref`, and `$defs`; dropping those breaks more than just one nullable object
  • The fact that Qwen3.5 and gpt-oss worked on the same tool points to a template fidelity issue, not a general inference-engine problem
  • Preserving `oneOf`, `allOf`, `enum`, `const`, and nullable arrays or objects should make Gemma 4 much less brittle in real agent stacks
  • For developers, the takeaway is to inspect rendered prompts and schema expansion, not just model outputs, when tool calls fail
// TAGS
gemma-4llmagentmcpinferenceprompt-engineering

DISCOVERED

45d ago

2026-04-29

PUBLISHED

45d ago

2026-04-29

RELEVANCE

8/ 10

AUTHOR

EntertainmentBroad43