Instructor
Structured outputs from LLMs with validation built in
Instructor is profiled here as a LLM tool for engineering teams. Read about features, pricing, and how it compares to related options in the tools directory.
Description
Instructor is an open-source library by Jason Liu for getting typed, validated data out of language models. A developer defines a schema, and Instructor handles the prompting, parses the model response into that schema, and retries automatically when validation fails. Built on Pydantic in Python with ports to several other languages, it has become a default way to make model output safe to pass into downstream code. The library reached wide adoption for structured extraction in Python and inspired ports to other language ecosystems. Its small footprint and reliance on familiar typing tools make it straightforward to add to an existing codebase.
Key Capabilities:
Schema-defined structured outputs validated through Pydantic
Automatic retries with error feedback on validation failure
Streaming of partial objects as the model generates them
Provider support across OpenAI, Anthropic, Gemini, and local models
Ports for TypeScript, Go, Elixir, Rust, and other languages
MIT license with a small, dependency-light footprint
Alternative tools
- Kong AI Gateway
AI traffic governance built on the Kong gateway
- Eden AI
One API for many AI models across providers and modalities
- Reka
Multimodal models that reason across text, image, and video
- Moonshot AI
Open-weight Kimi models tuned for agentic and coding tasks
- xAI Grok
Grok model family with real-time search through one API
- LLM Guard
Open-source security toolkit for LLM interactions
