Instructor
Library for getting validated structured outputs from any LLM, built on Pydantic with retries and type safety.
Updated
✨ Try AgentScout's free AI image generator →Good for: building AI agents
Use cases
About Instructor
Instructor is listed in our frameworks category and is aimed at builders. Library for getting validated structured outputs from any LLM, built on Pydantic with retries and type safety. Pricing, as the maker states it: Free and open source (MIT). Maturity: Mature. We last checked the official link on 2026-10-20.
What is Instructor?
Instructor is a popular open-source library for getting reliable structured output (JSON) from LLMs. You define a Pydantic model, and Instructor handles the schema, validation, parsing and automatic retries, feeding validation errors back to the model until the output fits.
The same code works across major providers (OpenAI, Anthropic, Google and others, including local models), with streaming of partial objects and lists, nested models and full type safety and IDE support. Its maintainers suggest Instructor for fast, schema-first extraction and PydanticAI when you need full agent runs.
Sources: the official README and our directory listing, checked 2026-10-20. Official site: python.useinstructor.com.
Who is Instructor for?
Python developers who need clean, validated data out of LLM calls for extraction, classification or agent tool inputs.
Instructor at a glance
- Open source: Yes (MIT License)
- GitHub: 567-labs/instructor · 14,041 stars (as of Oct 21, 2026)
Key features
- Pydantic models as the output schema
- Automatic retries with the validation error fed back
- One interface across many LLM providers
- Streaming partial and list responses
- Type safety and IDE autocompletion
Instructor FAQ
What is Instructor?
Instructor is a popular open-source library for getting reliable structured output (JSON) from LLMs. You define a Pydantic model, and Instructor handles the schema, validation, parsing and automatic retries, feeding validation errors back to the model until the output fits.
Who is Instructor for?
Python developers who need clean, validated data out of LLM calls for extraction, classification or agent tool inputs.
Is Instructor free?
Instructor's pricing, as the maker states it: Free and open source (MIT). Check the official site for current plans.
Is Instructor open source?
Yes. Instructor is released under the MIT License, according to its GitHub repository.
When should I use PydanticAI instead?
Instructor's README recommends PydanticAI when you need richer agent runs, built-in observability or shareable traces, and Instructor for simple, cheap extraction.
What are alternatives to Instructor?
Similar tools include Marvin, Outlines, BAML, TypeChat, Mirascope and LangChain Deep Agents.
Instructor ratings and reviews
Be the first to rate Instructor: tap 1 to 5 stars below. A written review is optional.
Instructor alternatives
Other frameworks tools in our directory. See all frameworks tools →
Marvin
Python library from Prefect for building AI agents and structured LLM workflows.
Outlines
Library from .txt for structured generation that guarantees LLM output matches a JSON schema, regex or grammar.
BAML
Typed programming language for agents and LLM functions, with runtime types, typed errors and structured outputs designed to reduce agent mistakes.
TypeChat
Microsoft library for building natural-language interfaces by using types to constrain and validate LLM responses.
Mirascope
Lightweight Python library for calling any LLM with typed outputs and tools through one interface, without a heavy framework.
LangChain Deep Agents
Library for long-running agents with subagents and skills; 0.7.23 (Oct 7) adds pinned_skills.
Related lists
🏆 See also: AutoGen alternatives · All best-of lists
💲 Estimate API cost: compare per-request and monthly costs for GPT, Claude, Gemini and Grok models.
Badge for makers
Built Instructor? Add this badge to your README or site. It links back to this page. About badges