instructor

Extract structured data from LLM responses with Pydantic validation and automatic retries.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/dawsonblock/HERMY --skill instructor-dawsonblock
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/dawsonblock/HERMY/tree/main/hermes-agent-2026.4.23/optional-skills/mlops/instructor
Command: npx skills add https://github.com/dawsonblock/HERMY --skill instructor-dawsonblock

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

LLM responses are often unstructured and error-prone; this skill provides a robust pipeline to extract, validate, and stream data using Pydantic schemas, with automatic retries on validation failures.

Core Features & Use Cases

  • Extract structured data from LLM responses reliably
  • Validate outputs against Pydantic schemas automatically
  • Retry failed extractions with automatic error handling
  • Stream partial results for real-time processing
  • Support multiple providers with consistent API

Quick Start

Configure an Instructor client and extract a validated User model from an LLM response.

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 reliably?

To validate LLM outputs against Pydantic schemas, you apply strict Pydantic-based schemas to the LLM response. The system automatically validates the extracted data and triggers retries on validation failures to ensure correctness.

Can I stream partial results from LLM data extraction for real-time processing?

Yes, you can stream partial results from LLM data extraction for real-time processing. The streaming feature allows you to process and handle incomplete data chunks progressively as the LLM generates them.

Does this data extraction approach support Anthropic, OpenAI, and local providers?

Yes, this data extraction approach supports Anthropic, OpenAI, and local providers. It provides a consistent API across multiple providers, allowing you to extract and validate data uniformly.

What happens when LLM output fails Pydantic validation?

When LLM output fails Pydantic validation, the system handles it through automatic retry mechanisms. It automatically retries failed extractions with error handling to ensure the final output conforms to the strict schema.

Why do I need Pydantic schemas for LLM output extraction?

You need Pydantic schemas for LLM output extraction because LLM responses are often unstructured and error-prone. Pydantic schemas enforce strict data structures, providing type safety and enabling automatic validation of the extracted content.