instructor

Extract structured data from LLM responses into Pydantic models.

3|1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/HouseGarofalo/claude-code-base --skill instructor-housegarofalo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/HouseGarofalo/claude-code-base/tree/main/.claude/skills/instructor
Command: npx skills add https://github.com/HouseGarofalo/claude-code-base --skill instructor-housegarofalo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of extracting structured, type-safe data from Large Language Model (LLM) responses, eliminating manual parsing and validation errors.

Core Features & Use Cases

  • Structured Data Extraction: Extract data into Pydantic models for guaranteed type safety.
  • Type-Safe LLM Responses: Ensure LLM outputs conform to predefined schemas.
  • Use Case: Automatically extract user details (name, age, address) from a natural language prompt into a Pydantic model, ensuring the data is correctly formatted and validated before use in your application.

Quick Start

Use the instructor skill to extract a User object with name and age from the text 'John is 25 years old'.

Frequently Asked Questions about instructor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract structured data from LLM responses using Pydantic?

Structured data extraction from LLM responses is achieved by mapping outputs directly to Pydantic models, ensuring type safety and automatic validation. This eliminates manual parsing errors and guarantees the retrieved data conforms to your predefined schemas.

Why do I need type-safe structured outputs for my LLM application?

Type-safe structured outputs are needed to ensure LLM responses conform to predefined schemas before use in your application. This mechanism guarantees data validation, facilitates nested object parsing, and prevents runtime errors caused by malformed LLM outputs.

Does structured data extraction work with Anthropic and Ollama models?

Structured data extraction works with multiple LLM providers including OpenAI, Anthropic, and Ollama. It integrates with these platforms to provide reliable, schema-compliant data retrieval and validation across different model environments.

What is the best way to validate nested objects from natural language prompts?

The best way to validate nested objects from natural language prompts is by using Pydantic models for structured data extraction. This approach automatically parses and validates complex nested structures, ensuring extracted user details are correctly formatted.

Can I automatically extract user details like name and age into a schema?

You can automatically extract user details like name and age into a schema by defining a Pydantic model and processing the text through structured extraction. This ensures the natural language input is correctly formatted and validated into your target object.

What are the limitations of using Pydantic for LLM data extraction?

Limitations of using Pydantic for LLM data extraction include dependency on the LLM provider's ability to generate schema-compliant responses. Complex or deeply nested schemas may require multiple validation attempts if the LLM output deviates from the expected type-safe structure.