Structured output
Structured output constrains a model to emit valid JSON or another schema so downstream code can parse it safely.
Constrained decoding enforces the grammar during generation rather than hoping the model complies. Always validate anyway, and prefer flat schemas with explicit enums — deeply nested optional fields are where parsing failures concentrate.