instructor

Extract structured data from LLM responses using validated Pydantic schemas.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/JKhyro/HERMES-AGENT --skill instructor-jkhyro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/JKhyro/HERMES-AGENT/tree/main/optional-skills/mlops/instructor
Command: npx skills add https://github.com/JKhyro/HERMES-AGENT --skill instructor-jkhyro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Instructor eliminates unreliable free-form model outputs by converting them into validated structured data that can be trusted, retried, and processed automatically.

Core Features & Use Cases

  • Structured extraction: Turn natural-language responses into Pydantic models for safe downstream use.
  • Automatic validation and retries: Catch schema errors, return feedback to the model, and try again until the output conforms.
  • Streaming and multi-provider support: Handle partial results and work consistently across Anthropic, OpenAI, and local model endpoints.
  • Use case: A product team can extract contacts, classifications, or entity lists from model responses without manually cleaning JSON.

Quick Start

Ask the skill to extract your target fields into a Pydantic schema and keep retrying until the response validates cleanly.

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?

To extract structured data from LLM responses using Pydantic, define a type-safe response model schema, pass it to the extraction request, and the system automatically validates the output, retrying with error feedback until it conforms cleanly.

Why does my LLM structured output fail validation and how can I fix it?

LLM structured output fails validation when responses deviate from your schema. Fix this by enabling automatic retry handling, which catches schema errors, returns feedback to the model, and tries again until the output validates cleanly.

Can I stream partial structured extraction results from OpenAI or Anthropic models?

Yes, you can stream partial structured extraction results from OpenAI or Anthropic models. The system supports streaming partial results consistently across providers, including Anthropic, OpenAI, and local model endpoints.

What is the best way to parse multiple entities from natural language without manually cleaning JSON?

The best way to parse multiple entities from natural language without manually cleaning JSON is using structured extraction with Pydantic models. This converts free-form responses into validated data for safe downstream use.

Does this structured extraction approach work with local models?

Yes, this structured extraction approach works with local models. It provides consistent structured output across providers, supporting Anthropic, OpenAI, and local model endpoints with provider-specific configuration.

When do I need automatic retry handling for LLM data extraction?

You need automatic retry handling for LLM data extraction when outputs must strictly conform to validated Pydantic schemas. This catches schema errors, returns feedback to the model, and retries until the response validates cleanly.