What is constrained decoding?
Masking out tokens that would break a grammar or schema at each decoding step, so the output is valid by construction.
Learn it properly in the lesson →
Where it comes up
Lessons that use this term, most mentions first.
- Structured output: JSON schemas and grammars · 12 min · Pro
- Constrained decoding engines: grammars, token masks and jump-forward · 15 min · Pro
- Engines compared from the inside: llama.cpp, vLLM, SGLang, TGI, TensorRT-LLM, Dynamo · 15 min · free
- Fine-tuning for structured output and tool calling: data, grammars and an evaluation harness · 17 min · Pro
- Grammar-constrained decoding inside an engine · 15 min · Pro
- Lab: run a real model with your engine and benchmark it against llama.cpp · 180 min · Pro
- Prompting that works on small local models · 14 min · Pro
- Agent frameworks compared, and when to use none · 15 min · Pro