Skip to content

llama : add token matching support to llama-grammar#1220

Merged
ikawrakow merged 2 commits intomainfrom
fcp/token_match
Feb 3, 2026
Merged

llama : add token matching support to llama-grammar#1220
ikawrakow merged 2 commits intomainfrom
fcp/token_match

Conversation

@firecoperana
Copy link
Collaborator

Port mainline's latest grammar change.

Details in ggml-org/llama.cpp#17816 and ggml-org/llama.cpp#18342
Closes #1163

With this PR, it's possible to ban tokens and enforce reasoning budget through grammar and more, which is very useful for thinking models.

firecoperana added 2 commits February 2, 2026 10:25
llama : add token matching support to llama-grammar (#17816)

common/grammar : replace problematic backtracking regex `[\s\S]*` (#18342)
@ikawrakow ikawrakow merged commit 7e8d444 into main Feb 3, 2026
@firecoperana firecoperana deleted the fcp/token_match branch February 7, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Token-based grammar rules fail to parse in ik_llama.cpp (but work in llama.cpp)

2 participants