Back to Skills

instructor

Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream partial results with Instructor - battle-tested structured output library

3,579stars289forksUpdated 2/18/2026

Security Assessment

Low Risk(70/100)

Detected risks:

Secret Exposure([SKILL.md] api_key=)
Security Score70/100

About instructor

Instructor is a powerful AI skill designed to streamline the extraction and validation of structured data from LLM responses. It provides a reliable way to handle data parsing, validation, and extraction from language models, using Pydantic schemas for validation and type safety. This skill is ideal for projects requiring structured data outputs from natural language inputs, ensuring that responses are consistent, well-defined, and meet the necessary requirements. With automatic error handling and retry mechanisms, Instructor offers a robust solution for developers working with LLMs in production environments.

FAQ

How does Instructor handle invalid data during extraction?

Instructor automatically retries failed extractions, ensuring that invalid data is handled efficiently and consistently.

Can Instructor be used with multiple LLM providers?

Yes, Instructor supports multiple LLM providers, including OpenAI and Anthropic, and ensures consistent output extraction across them.

What are the installation requirements for using Instructor?

Instructor requires Python and can be installed using pip. For additional provider support, you can install with options like 'instructor[openai]' or 'instructor[anthropic]'.

Is Instructor compatible with Pydantic models?

Yes, Instructor uses Pydantic models for defining and validating structured data outputs, ensuring type safety and automatic validation.

Install instructor

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill