Instructor
non-cncf
First Research Pass
Content Lifecycle & Evolution State
1
Initial Seed
Metadata Loaded
2
First Research
Automated Gathering
3
Tech Writing
Content Structured
4
Approval
Editorial Verified
First Research Pass Completed: Initial facts, key features, and documentation links have been gathered. Detailed technical writing and synthesis are currently in queue.
Overview
Instructor is a library for structured extraction, getting reliable JSON from any LLM, built on Pydantic for validation, type safety, and IDE support.
Key Features
Provides automatic validation, retries, streaming, and nested object support without manual schema writing.
Works with every major provider including OpenAI, Anthropic, Google, and local models like Ollama using the same API.
Stream partial objects as they’re generated.
Automatically retries failed validations with the error message.
Use Cases
Extract complex, nested data structures from natural language with automatic validation and retries, streamlining structured data extraction.
Getting Started
Install Instructor via pip `pip install instructor`, define a Pydantic model for your data, and use `instructor.from_provider()` to extract structured data from any LLM.
Recent Updates
The most recent tag is v1.17.0.
Did You Know?
Instructor is trusted by over 100,000 developers, has over 3 million monthly downloads, and is used by teams at OpenAI, Google, Microsoft, and AWS.