Ollama – v0.20.6-rc0: gemma4: update renderer to match new jinja template (#15490)

Ollama – v0.20.6-rc0: gemma4: update renderer to match new jinja template (#15490)

New update for the Ollama crew! ๐Ÿ› ๏ธ

If you’ve been running Google’s Gemma 4 models locally, there is a fresh release candidate (v0.20.6-rc0) ready for testing. This update focuses heavily on keeping Ollama in perfect sync with the latest changes from Google to ensure your local inference stays rock solid.

Whatโ€™s new in this release:

  • Gemma 4 Template Parity: The renderer has been updated to match Google’s new Jinja template. This ensures that how your prompts are structured matches exactly what the model expects, preventing weird formatting issues.
  • Parser Adjustments: Since the upstream parsing logic changed slightly, the Ollama parser has been tweaked to maintain compatibility and prevent broken inputs during model interaction.
  • Improved Type Handling for Tool-Calling:
  • Added special handling for simple `AnyOf` structures by treating them as type unions.
  • Fixed edge cases specifically around type unions to make tool-calling much more robust and reliable.
  • Better Tool Result Logic:
  • The parser now prefers “empty” over “None” for certain results, which is crucial for handling legitimate empty tool calls correctly without crashing the logic.
  • Added extra care when processing tool results that might have missing IDs to prevent errors in complex workflows.

Itโ€™s a great update for anyone doing heavy lifting with tool-calling and complex prompt engineering on Gemma 4! ๐Ÿš€

๐Ÿ”— View Release