instructor

Extract and validate structured data from LLM outputs using Pydantic schemas.

228|35|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/kaminocorp/hermes-alpha --skill instructor-kaminocorp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/kaminocorp/hermes-alpha/tree/main/hermes-agent/skills/mlops/inference/instructor
Command: npx skills add https://github.com/kaminocorp/hermes-alpha --skill instructor-kaminocorp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Instructor library helps teams extract structured data from LLM responses, validate outputs with Pydantic schemas, automatically retry failed extractions, and stream results in real time.

Core Features & Use Cases

  • Structured data extraction with strict validation using Pydantic models.
  • Automatic retry on validation errors to improve reliability.
  • Streaming partial results for interactive workflows and dashboards.
  • Multi-provider compatibility with Claude, OpenAI, and local models.
  • Use Case: Build data-entry assistants that convert unstructured chat outputs into validated records.

Quick Start

Run an example to parse a sample LLM reply into a validated Pydantic model.

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 outputs using Pydantic?

You can extract structured data from LLM outputs by defining a Pydantic schema and passing it to the Instructor library, which enforces type-safe parsing to ensure the LLM response matches your validated data model.

What is the best way to validate LLM responses and automatically retry on failures?

The best way to validate LLM responses is using the Instructor library with Pydantic schemas, which automatically retries failed extractions when validation errors occur, improving overall data pipeline reliability.

Can I stream partial structured outputs from an LLM in real time?

Yes, you can stream partial structured outputs from an LLM in real time using the Instructor library, enabling interactive workflows and live dashboards to display data as it is parsed and validated.

Does Instructor work with Claude, OpenAI, and local models for data extraction?

Yes, Instructor offers multi-provider compatibility, allowing you to extract and validate structured data from diverse LLMs including Claude, OpenAI, and local models within the same data extraction pipeline.

How do I convert unstructured chat outputs into validated records for data entry?

You can convert unstructured chat outputs into validated records by applying Pydantic schemas to LLM responses via the Instructor library, enforcing type-safe parsing to create structured data-entry assistants.

Why should I use Pydantic schemas for parsing API responses from LLMs?

Using Pydantic schemas for parsing API responses from LLMs enforces strict type validation, ensuring extracted data conforms to expected formats while automatically retrying failed validation attempts for reliable results.