Tech & Coding·3 min read
Constraining a local LLM to valid JSON with GBNF grammars
Prompts ask a model to "return JSON". Grammars make it impossible to return anything else. How I used GBNF + constrained decoding to get reliable structured output on-device.
#llm#ai-agents#developer-experience#design