instructor

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

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/1thirteeng3/greenmoire --skill instructor-1thirteeng3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/1thirteeng3/greenmoire/tree/main/integrations/hermes-agent/skills/mlops/inference/instructor
Command: npx skills add https://github.com/1thirteeng3/greenmoire --skill instructor-1thirteeng3

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Extract structured data from LLM responses with type-safe validation, automatic retries on validation errors, and streaming partial results across providers.

Core Features & Use Cases

  • Structured extraction with Pydantic validation
  • Automatic retries on validation failures
  • Parse complex JSON with type safety
  • Stream partial results for real-time processing
  • Multi-provider support (OpenAI, Anthropic)

Quick Start

Install Instructor and provide a simple prompt to 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 with validation?

To extract structured data from LLM responses, this Skill applies Pydantic models to validate outputs and automatically retries requests when validation fails, ensuring type-safe JSON parsing.

Can I stream partial structured data results from multiple LLM providers?

Yes, you can stream partial structured data results for real-time processing across multiple LLM providers like OpenAI and Anthropic, handling complex JSON parsing as responses generate.

How do I parse complex nested JSON from an LLM output using Pydantic?

You can parse complex nested JSON from LLM output by defining nested Pydantic models, which enforce strict validation rules and provide clear error messages for invalid data structures.

What is the best way to handle LLM validation errors automatically?

The best way to handle LLM validation errors is using automatic retries, which re-prompt the model with clear error messages until generated structured data passes Pydantic validation.

Does this approach work with both OpenAI and Anthropic models?

Yes, this structured data extraction approach supports multiple providers, allowing you to apply Pydantic validation, automatic retries, and streaming across both OpenAI and Anthropic models.