instructor

Extract structured data from LLM responses with Pydantic validation.

6|3|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/jonnabio/ace-framework --skill instructor-jonnabio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/jonnabio/ace-framework/tree/main/.ace/packs/ai-research/instructor
Command: npx skills add https://github.com/jonnabio/ace-framework --skill instructor-jonnabio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires instructor, pydantic, openai, anthropic, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps users extract structured data from LLM responses, validate outputs, and stream partial results, solving the challenge of interpreting and utilizing unstructured AI-generated text.

Core Features & Use Cases

  • Structured Data Extraction: Extract structured data from LLM responses with Pydantic validation.
  • Automatic Validation: Validate outputs against Pydantic schemas automatically.
  • Retry Failed Extractions: Retry failed extractions with automatic error handling.
  • Stream Partial Results: Stream partial results for real-time processing.
  • Support for Multiple LLM Providers: Supports multiple LLM providers like OpenAI, Anthropic, and Local Models (Ollama) with consistent API.
  • Use Case: Use the Instructor Skill to parse complex JSON with type safety and validation, ensuring accurate data extraction and processing.

Quick Start

Use the instructor skill to extract user data from the provided text.

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 with Pydantic validation?

To extract structured data with Pydantic validation, define a schema and pass it to the LLM call. The system automatically parses the response, validates it against your types, and retries failed extractions to ensure accurate JSON parsing.

Can I stream partial structured outputs from OpenAI or Anthropic models?

Yes, you can stream partial structured outputs from OpenAI and Anthropic models. The system supports real-time streaming of partial results, allowing you to process validated Pydantic data objects incrementally as the LLM generates them.

What is the best way to handle failed JSON parsing and validation from LLM outputs?

The best way to handle failed JSON parsing is using automatic validation with retry logic. The system validates outputs against Pydantic schemas and automatically retries failed extractions, ensuring robust type safety and accurate data extraction.

Does this approach work with local models like Ollama as well as OpenAI?

Yes, this approach works with local models like Ollama alongside OpenAI and Anthropic. It provides a consistent API for structured data extraction, ensuring type safety and validation across multiple different LLM providers.

Do I need Pydantic installed to validate structured LLM outputs?

Yes, you need Pydantic installed to validate structured LLM outputs. The system relies on the Pydantic, OpenAI, and Anthropic libraries to define schemas, parse JSON, and enforce type safety during data extraction.

Why are my structured data extractions from LLM responses failing validation?

Structured data extractions fail validation when LLM responses do not match your Pydantic schemas. The system addresses this by automatically retrying failed extractions with error handling to enforce type safety and correct the output.