Back to directory

Instructor

A Python library for getting reliable, typed structured output from any large language model, built on Pydantic for validation and automatic retries instead of hand-written JSON parsing.

Visit website (opens in a new tab)python.useinstructor.com
Instructor

Instructor gets structured, validated output from a large language model by defining a Pydantic model and asking for it back as that type, without writing a JSON schema, parsing the response by hand, or writing custom retry logic. The same client code works across every major LLM provider, selected through a single provider string.

When the model returns output that fails validation, Instructor automatically retries the request with the validation error included, so the model can correct itself. It also supports streaming partial objects as they are generated, so an application can display fields as they arrive, and it extracts nested, complex data structures such as a user record containing a list of addresses.

The maintainers describe Instructor as suited to fast, schema-first extraction, and recommend the related PydanticAI project, which shares the same Pydantic models, for applications that need richer agent runs with built-in observability and replayable evaluation datasets.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.