What problem does it solve?
Instructor removes the guesswork of getting reliable, machine-readable data from LLM responses by validating outputs against your Pydantic schemas and automatically retrying when extraction fails.
Core Features & Use Cases
- Structured extraction with Pydantic validation: Convert free-form model text into strongly typed objects with automatic schema validation.
- Automatic retries on validation errors: When fields don’t match your constraints, Instructor feeds back the validation error and tries again.
- Type-safe parsing of complex JSON: Support nested models, enums, optional fields, and constrained values (e.g., ranges, formats).
- Streaming partial results: Consume output incrementally for real-time UIs and progressive processing.
- Multi-provider consistency: Use Instructor across common LLM providers while keeping the same structured-output workflow.
Quick Start
Use the instructor skill to extract a Person object from a message by providing a Pydantic model and asking the AI to return the needed fields (name, age, email).