AI Glossary Term

What does “Output Parser” mean?

Definition

Logic that validates and converts model output into strongly typed, machine-usable structures.

How Output Parser works

Diagram for Output Parser, steps in order: Model reply text; then Output parser; then Check against schema; then Typed data: name, date, amount; then Retry if invalid.Model reply textOutput parserCheck against schemaTyped data: name, date, amountRetry if invalid

Example

An app asks a model to extract an invoice's total and due date. The parser reads the reply, confirms the total is a number and the date is valid, and asks the model to try again if not.

Why it matters

Software needs predictable data, not free-form text. Parsing and validating protect downstream systems from malformed output.

Common questions

Parser vs structured output?

Structured output constrains the model while it writes. A parser checks and converts what it wrote afterward.

What happens if parsing fails?

Common responses are retrying, repairing the text, or falling back to a default.

Which formats?

JSON is common, but CSV, XML, or custom schemas also work.

Learn more in our free guides

Test yourself

See also