]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
common : add gemma 4 specialized parser (#21418)
authorAldehir Rojas <redacted>
Sat, 4 Apr 2026 18:39:00 +0000 (13:39 -0500)
committerGitHub <redacted>
Sat, 4 Apr 2026 18:39:00 +0000 (20:39 +0200)
commitb8635075ffe27b135c49afb9a8b5c434bd42c502
treeea70acd2a73226e1ccfbb612e5902c413af63d4d
parent9c699074c97191754c8a966298f84c79f90fce38
common : add gemma 4 specialized parser (#21418)

* common : add gemma4 dedicated parser

* cont : add '<|tool_response>' as eog

* cont : emit JSON from Gemma4 tool call AST

* cont : more fixes

* cont : refactor convert function

* cont : refine rules and mapping

* cont : add more tests

* cont : clean up

* cont : remove autoparser gemma4 implementation

* cont : more cleanup

* cont : rename gemma4.jinja to match the others

* cont : add custom template to support interleaved thinking

* cont : preserve reasoning in model turns

* cont : fix initializer error

* cont : fix unused vars

* cont : fix accidental static

* cont : fix specialized_template signature

* fix extra semicolon

* remove debug line and extra space [no ci]
14 files changed:
common/chat-auto-parser-generator.cpp
common/chat-auto-parser.h
common/chat-diff-analyzer.cpp
common/chat-peg-parser.cpp
common/chat-peg-parser.h
common/chat.cpp
common/chat.h
common/peg-parser.cpp
common/peg-parser.h
models/templates/gemma4.jinja [deleted file]
models/templates/google-gemma-4-31B-it-interleaved.jinja [new file with mode: 0644]
models/templates/google-gemma-4-31B-it.jinja [new file with mode: 0644]
src/llama-vocab.cpp
tests/test-chat.cpp