Affiliate link. Joute earns a commission at no extra cost to you. Our verdict stays independent.
Le cron de tracking demarre lundi prochain a 6h UTC. Joute scrape hebdomadairement les pricing pages de cet outil et trace les variations sur 12 mois.
Donnees disponibles des la premiere capture. Revenez lundi.

Instructor in brief
Instructor is a must-have library for anyone building LLM pipelines that need reliable structured outputs. Simple, robust, and well-maintained.
- PriceFree
- CategoryCode
- RecommendedYes
The essentials in 20 seconds
- Python library that wraps LLM calls to guarantee structured outputs validated by Pydantic
- Automatic retry if the LLM output doesn't match the expected schema
- Compatible with OpenAI, Anthropic, Google, and any OpenAI-compatible LLM
- Price: free, open source MIT
Verdict: Instructor is the simplest and most reliable way to extract structured data from an LLM. If you use Pydantic (and you should), the integration is natural. Essential.
What is Instructor?
Instructor is a Python library created by Jason Liu that radically simplifies structured data extraction from LLMs. You define a Pydantic model, call the LLM, and get back a validated Python object.
If the LLM returns something that doesn't match the schema, Instructor automatically retries the call with the error message in context.
from instructor import patch
from openai import OpenAI
from pydantic import BaseModel
client = patch(OpenAI())
class Person(BaseModel):
name: str
age: int
person = client.chat.completions.create(
model="gpt-4",
response_model=Person,
messages=[{"role": "user", "content": "Jason Liu, 30 ans"}]
)
# person.name == "Jason Liu", person.age == 30
Strengths
Native Pydantic validation
Your existing Pydantic models work directly. No need to learn a new schema format.
Smart retry
When the LLM produces invalid output, Instructor reinjects the validation error into the prompt so the LLM can correct itself. The success rate climbs significantly.
Multi-LLM support
OpenAI, Anthropic (Claude), Google (Gemini), Mistral, and any OpenAI-compatible endpoint.
Limits
Python only
No native JavaScript/TypeScript version (BAML covers this need on the TypeScript side).
Strong Pydantic dependency
If your project doesn't use Pydantic, you need to adopt it. In practice this isn't a limitation since Pydantic has become a standard.
Pricing
- Free, open source MIT
Alternatives
- BAML for TypeScript-first structured extraction
- DSPy for a more complete approach to LLM pipeline programming
- Outlines for structured generation with local models
Verdict
Instructor is one of the most useful libraries in the Python LLM ecosystem. If you're building pipelines that extract data from texts or documents, install Instructor immediately.
FAQ
Does Instructor work with local models via Ollama?
Yes. Instructor supports any OpenAI-compatible endpoint, including Ollama.
Can you extract lists of objects?
Yes. List[Person] in your Pydantic model works perfectly.
How many retries does Instructor do?
By default, 3 attempts. Configurable via the max_retries parameter.
Instructor is open source and free. Joute doesn't earn a commission on this tool. Learn more about our affiliate policy.
Screenshots Instructor
7






Instructor : 0/10.
Instructor is a must-have library for anyone building LLM pipelines that need reliable structured outputs. Simple, robust, and well-maintained..
Test Instructor yourself
A free trial is available. Plan thirty minutes to form your own opinion.
Affiliate link. Joute earns a commission at no extra cost to you. Our verdict stays independent.
Instructor
Free
