What problem does it solve?
Instructor helps you turn messy LLM text output into reliable, typed JSON by validating against a Pydantic schema and retrying automatically when extraction fails.
Core Features & Use Cases
- Pydantic-validated structured outputs: Enforce strict types, constraints, enums, and nested models so downstream systems can trust the result.
- Automatic retry on validation errors: When the model produces invalid data, Instructor feeds the error back and re-attempts extraction.
- Streaming structured results: Receive partial objects in real time for responsive UIs and incremental processing.
- Multi-provider consistency: Use the same structured extraction pattern across OpenAI and Anthropic (and JSON-mode fallbacks).
Quick Start
Use the instructor skill to extract a User object with fields name, age, and email from the message "John Doe is 30 years old. His email is [email protected]" and return validated Pydantic output.