Instructor
Structured-output extraction library for LLM responses with Pydantic validation and automatic retries.
- CCM score
- 59 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 14.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers extracting typed data from Claude and OpenAI responses into Pydantic models, with nested models, optional fields, and enums
- Includes built-in and custom validators (regex, model-level date-range checks) that trigger automatic retries with error feedback to the model
- Supports
max_retries(default 3) and streaming viacreate_partialfor partial objects andcreate_iterablefor list items - Designed for Python developers who need consistent structured output across Anthropic and OpenAI providers
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill instructor -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Instructor: Structured LLM Outputs
When to Use This Skill
Use Instructor when you need to:
- Extract structured data from LLM responses reliably
- Validate outputs against Pydantic schemas automatically
- Retry failed extractions with automatic error handling
- Parse complex JSON with type safety and validation
- Stream partial results for real-time processing
- Support multiple LLM providers with consistent API
GitHub Stars: 15,000+ | Battle-tested: 100,000+ developers
Installation
# Base installation
pip install instructor
# With specific providers
pip install "instructor[anthropic]" # Anthropic Claude
pip install "instructor[openai]" # OpenAI
pip install "instructor[all]" # All providers
Quick Start
Basic Example: Extract User Data
import instructor
from pydantic import BaseModel
from anthropic import Anthropic
# Define output structure
class User(BaseModel):
name: str
age: int
email: str
# Create instructor client
client = instructor.from_anthropic(Anthropic())
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- AI Agents & LLM Apps, Python
- First seen
- Jun 3, 2026
Questions
What does the instructor skill do?
The instructor skill extracts structured data from LLM responses using Pydantic validation. It can retry failed extractions automatically, parse complex JSON with type safety, and stream partial results.
How do I install the instructor skill?
Run npx -y skills add orchestra-research/ai-research-skills --skill instructor -y in a project to install the instructor skill. Once installed, the agent can define Pydantic response models and call LLM providers through Instructor.
Which AI Agents & LLM Apps skills lead the instructor skill?
In the AI Agents & LLM Apps category, the instructor skill sits alongside microsoft-foundry, azure-ai and several google-agents-cli skills. The instructor skill focuses on turning LLM output into validated Python objects with automatic retries.
Which LLM providers does the instructor skill support?
The instructor skill supports Anthropic Claude and OpenAI, with a consistent API across both. Its SKILL.md shows client setup through instructor.from_anthropic and instructor.from_openai.
Does the instructor skill need Pydantic and provider packages?
The instructor skill lists instructor, pydantic, openai and anthropic as dependencies. Its SKILL.md shows installing the instructor package with optional anthropic or openai extras.
More from orchestra-research/ai-research-skills
All 92- Long Context1.1K
- Presenting Conference Talks1.1K
- Speculative Decoding1.1K
- Hqq Quantization1.1K
- Model Merging1.1K
- Moe Training1.1K
- Sglang1.1K
- Chroma1.1K
- Nemo Curator1.1K
- Llama Factory1.1K
- Pyvene Interventions1.1K
- Gptq1.1K
- Model Pruning1.1K
- Sentencepiece1.1K
- Evaluating Code Models1.1K
- Distributed Llm Pretraining Torchtitan1.1K
- Mamba Architecture1.1K
- Openrlhf Training1.1K
- Sparse Autoencoder Training1.1K
- Llamaindex1.1K
- Ml Training Recipes1.1K
- Outlines1.1K
- Simpo Training1.1K
- Slime Rl Training1.1K
Similar to Instructor
More AI Agents & LLM AppsoutlinesSkillorchestra-research/ai-research-skills1.1K installsGuaranteed-valid structured generation with Pydantic models, JSON schemas, and local model backends.
guidanceSkillorchestra-research/ai-research-skills1.1K installsConstrained generation framework that forces LLM output into regex, grammar, or selection formats from Microsoft Research.
structured-output-extractorSkillpatricio0312rev/skills324 installsStructured-output extraction from LLM responses via JSON mode, Zod schemas, and function calling for typed parsing.
pydantic-aiPluginanthropics/claude-plugins-official48.1K starsWrite accurate Pydantic AI code from the start. Up-to-date patterns, decision trees, and common gotchas for agents, tools, structured output, streaming, and mul
pydantic-ai-agent-creationSkillexistential-birds/beagle219 installsTyped PydanticAI agent setup covering models, structured outputs, dependency injection, and run modes.