src-ggml-2026-llama-cpp-gbnf source
llama.cpp GBNF grammar guide (grammars/README.md)
locator
https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md
notes
GBNF production rules constrain local model output; a JSON Schema subset converts to GBNF via json_schema or response_format. Caveats: known grammar performance problems, many optional items make sampling slow, unsupported schema features (nested $ref, patternProperties, uniqueItems, conditionals) are skipped silently.