llm-engineeringStable

Instructor

Structured LLM outputs via Pydantic validation

View on GitHub

What it solves

Getting reliably structured data out of an LLM without writing validation and retry logic yourself.

Overview

Instructor wraps LLM API clients to enforce structured outputs using Pydantic models. The model generates JSON; Instructor validates it against your schema and retries on failure. Eliminates manual JSON parsing and brittle regex extraction from LLM responses.

Key facts

Language
Python
License
MIT
Maturity
Stable
Maintainer
instructor-ai
Reviewed
2026-06-11

Where to start

Three lines to see how Pydantic schema enforcement works end-to-end.

examples/simple.py

Technologies

instructorpython

More in this domain