instructor

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

1|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/Monjyu1101/AiDiy2026 --skill instructor-monjyu1101
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/Monjyu1101/AiDiy2026/tree/main/backend_hermes/optional-skills/mlops/instructor
Command: npx skills add https://github.com/Monjyu1101/AiDiy2026 --skill instructor-monjyu1101

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you extract and validate structured data from LLM responses by enforcing Pydantic schemas, automatic retries on validation failures, and streaming partial results for real-time processing.

Core Features & Use Cases

  • Structured Output Validation: Validate LLM outputs against Pydantic models to ensure type-safe, machine-friendly results.
  • Auto Retry & Error Feedback: Automatically retry on validation errors with actionable feedback to guide the LLM.
  • Streaming & Real-time Processing: Stream partial results as the model generates data for responsive UIs and pipelines.
  • Multi-provider Support: Works with OpenAI, Anthropic, and local/alternative providers using a uniform interface.
  • Use Cases: Data extraction, entity recognition, and structured analyses with deterministic outputs.

Quick Start

Validate an LLM response by defining a Pydantic model and using Instructor to parse and stream the result.

Frequently Asked Questions about instructor

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

FAQPage Schema
How do I get structured JSON output from LLMs and validate it with Pydantic?

You get structured JSON output by defining a Pydantic model and using this Skill to extract and validate the LLM response against that schema, ensuring type-safe, machine-friendly results.

What happens when LLM structured output fails Pydantic validation?

When validation fails, the Skill automatically retries the LLM request with actionable error feedback, guiding the model to correct its output and satisfy the schema requirements.

Can I stream partial Pydantic model results from an LLM in real-time?

Yes, you can stream partial results. The Skill streams partial results as the model generates data, enabling responsive UIs and real-time processing pipelines.

Does this work with both OpenAI and Anthropic providers for structured data extraction?

Yes, it works with OpenAI and Anthropic. The Skill provides multi-provider support, allowing structured data extraction using a uniform interface across different LLM providers.

What is the best way to extract entities from LLM responses with deterministic outputs?

The best way to extract entities with deterministic outputs is applying Pydantic schema enforcement to LLM responses. This ensures strict type safety and validated structured analysis for data extraction.