
About Instructor
Instructor is an open source library for pulling structured data out of large language model output. It uses typed schemas and retries when the output does not match what you asked for.
What it does
Instructor wraps model calls so the response fits a schema you define. If the result fails validation, the library can send the request again. It is built on Pydantic models, so you describe the output shape with ordinary Python classes and get back clean objects.
Key features
- Typed output based on schemas
- Automatic retries on failed validation
- Streaming and nested object support
- Works with many LLM providers
- Available in several programming languages
Who it's for
Developers who pull fields out of documents, emails or chat logs and need reliable data for a database or API. It fits teams that want extraction without building a full agent system.
Pricing and good to know
The library is open source under the MIT licence. The model provider you call charges for usage, so that cost is separate from the library. The project also points to PydanticAI for agent work, which is a separate tool with its own docs.
Highlights
- Get output that matches a typed schema
- Retry automatically when validation fails
- Stream results and handle nested objects
- Use with many LLM providers
- Use the same pattern in several languages












