Tag
The author presents a method using GBNF grammars in llama.cpp to constrain local AI model outputs, ensuring valid JSON. A compiler is built to convert tool schemas into grammar rules, with per-turn narrowing for relevant tools.