Skip to content
Menu
English

Structured Output

Constraining a model to emit valid JSON or a schema-conforming object.

technique Prompting 3 relationships

Overview

Structured output constrains generation so the result parses against a schema, usually by restricting which tokens are allowed at each position. It solves the problem that asking a model for JSON produces JSON most of the time, and a pipeline cannot be built on most of the time. It exists because the constraint is enforced during generation rather than validated afterwards, so retries and repair logic are not needed.

Technology Graph

How Structured Output connects to the rest of the stack.

Applied to