Closed
Description
Name and Version
latest
Operating systems
No response
Which llama.cpp modules do you know to be affected?
libllama (core library)
Command line
llama-cli -hf bartowski/DeepSeek-R1-Distill-Llama-8B-GGUF:Q4_K_M --grammar 'root ::= "{"' -p hey -no-cnv
Problem description & steps to reproduce
With the following extremely simple grammar somehow at the time we reach the grammar sampler, there's only 1 candidate (@
) and it hard crashes.
First Bad Commit
cc/ @ggerganov could this be related to any recent refactoring? (#10803 maybe? I'll try and bissect)
Relevant log output
hey/tmp/llama.cpp-20250131-5280-k2rjfn/src/llama-grammar.cpp:1216: GGML_ASSERT(!grammar.stacks.empty()) failed