Skip to main content
All terms
Inference & Serving

Structured Output

Constraining generation so the response is valid structured data like JSON.

Definition

Structured output makes a model's response conform to a predefined schema rather than free-form prose. It is achieved by guided decoding, which at each step blocks any next word that would break the required format and allows only valid ones, or by fine-tuning the model to follow format instructions. JSON (a standard data format) mode and tool-call responses are common examples, and libraries like Outlines and Instructor add it on top of any model. It makes responses safe for a program to read automatically.