]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
common : enable reasoning budget sampler for gemma4 (#21697)
authorBerk Idem <redacted>
Fri, 10 Apr 2026 09:49:14 +0000 (05:49 -0400)
committerGitHub <redacted>
Fri, 10 Apr 2026 09:49:14 +0000 (11:49 +0200)
commitd7ff074c87ecacd57d5760e2f678866ba9fe7149
treecad1a630f41696ab96be92a5ff1b81c911ecbf7c
parent3f8752b5592fdef6fe58fb23a8d468f603095154
common : enable reasoning budget sampler for gemma4 (#21697)

* fix: enable reasoning budget sampler for gemma4

Add thinking_start_tag and thinking_end_tag to
common_chat_params_init_gemma4(). Without these, the reasoning
budget sampler never activates for gemma4.

Make the newline after "thought" optional in the PEG parser to
handle budget=0 (sampler forces end tag before the newline).

Add test case for empty thinking block.

Fixes #21487

* use p.space() instead of p.optional(p.literal("\n")) in gemma4 thought parser
common/chat.cpp
tests/test-chat.cpp