Skip to content

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
View on GitHub

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 via create_partial for partial objects and create_iterable for 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 -y

Installs 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

Similar to Instructor

More AI Agents & LLM Apps