structured output
Model output that must match a given schema, usually JSON Schema, either by asking in the prompt or by a provider feature that constrains decoding.
In more detail
Provider structured outputs constrain decoding to the schema, so they guarantee the shape, not the content: a value can still be wrong, and a reply cut off by max tokens or refused falls outside the guarantee. Validate every reply in code, check the stop reason first, and repair with the exact validation errors.
Related terms
- JSON Schema — A standard vocabulary for describing the allowed shape of JSON data: which fields exist, their types, which are required and what values are allowed.
- repair loop — Sending a model its invalid reply together with the precise validation errors and asking it to fix them.
- strict tool use — A tool or schema setting that makes the provider guarantee a model's tool inputs or output match the given JSON Schema.
Taught in
- Reasoning Techniques — AI Engineering: LLM Apps, RAG & Agents
- Structured Output — AI Engineering: LLM Apps, RAG & Agents
- Grounded Answers With Citations — AI Engineering: LLM Apps, RAG & Agents
- Function Calling — AI Engineering: LLM Apps, RAG & Agents
- The Agent Loop — AI Engineering: LLM Apps, RAG & Agents