Icon for Instructor

Instructor

Structured data extraction from LLMs using Pydantic models with automatic validation and retries

Open Source

Instructor is a Python library for extracting structured, validated data from Large Language Models. It uses Pydantic models to define output schemas and automatically handles validation, retries, and streaming. Define a Pydantic model for the shape of data you want, and Instructor handles getting the LLM to return matching data with no manual JSON parsing needed. It supports 15+ providers including OpenAI, Anthropic, Google Gemini, Mistral, Cohere, and Ollama. With 11k+ GitHub stars and 6M+ monthly PyPI downloads, it is one of the most widely used structured output libraries.

Pricing: Free

Screenshot of Instructor webpage

Is your product missing? 👀 Add it here →