What problem does it solve?
Instructor helps you turn messy LLM responses into reliable, schema-validated structured data by using Pydantic models, automatic retries on validation failures, and optional streaming of partial results.
Core Features & Use Cases
- Pydantic-based response schemas: Define the exact output structure with types, constraints, nested models, optionals, and enums for safe parsing.
- Automatic validation + retry: Detect invalid outputs and re-prompt with validation error feedback until the response conforms to your schema.
- Streaming for real-time pipelines: Receive partial objects while generation is in progress, enabling incremental UI updates or progressive downstream processing.
- Provider support with consistent behavior: Use Instructor with multiple LLM providers (e.g., Anthropic Claude and OpenAI) while keeping your extraction contract stable.
Use Instructor when you need to extract entities, generate classifications, normalize complex JSON, or build structured research artifacts from LLM output with robust failure recovery.
Quick Start
Use the instructor skill to extract user data from a prompt into a Pydantic schema and automatically retry until the output validates.