All glossary terms
Cross-cutting

Structured output

Structured output is the LLM feature that guarantees the response matches a provided schema (JSON Schema, Zod, Pydantic) — eliminating the parsing failures and format drift that plagued early LLM applications. Modern APIs (OpenAI Structured Outputs, Anthropic JSON mode, Gemini response_schema) implement this via constrained decoding or grammar-aware sampling.

Structured output is the bridge between LLM outputs and downstream code. Without it, applications had to parse free-form text and handle the inevitable cases where the model returned text-with-JSON-inside, JSON-with-extra-text, or malformed JSON entirely. With guaranteed schema conformance, the application can typed-dispatch on the response without defensive parsing. The cost: slightly less flexibility (the model can't deviate from the schema even when deviation would help) and occasional quality degradation on tasks where the schema is too restrictive. The wins almost always outweigh the costs in production applications.

Related terms