Prompting

Structured Output

Forcing an LLM to return data in a specific format — usually JSON matching a schema — so downstream code can parse it reliably.

01 ——

In plain English

Structured output is the capability for an LLM to return data in a strict, parseable format (most commonly JSON, sometimes XML or a custom format). Instead of free-form text you have to regex out, you get a predictable object you can hand straight to the next step in a pipeline.

Why it matters:

  • Reliability — production systems need predictable shapes
  • Tool use — every function call is a structured output under the hood
  • Less prompt engineering — the schema does most of the work
  • Easier testing — structured outputs are easy to validate

How providers implement it:

  • OpenAI — Structured Outputs (guaranteed schema compliance via constrained decoding)
  • Anthropic — tool-use schema + JSON mode
  • Google GeminiresponseSchema parameter
  • Open-source — Outlines, Instructor, BAML, JSONFormer enforce schemas on any model

Common patterns:

  • Extracting structured fields from unstructured text (resumes, invoices, emails)
  • Returning multiple candidate options as an array of objects
  • Building agent action schemas (the model picks an action + fills in arguments)

Most production LLM pipelines lean heavily on structured output.

02 ——

Related terms

Back to glossaryLast reviewed May 2026
Vol. 4 · Issue 19 · Last reviewed 2026-05-30

Sign up for our newsletter

Receive weekly updates so you can stay up-to-date with the world of AI