instructor

Convert unstructured LLM outputs into validated Pydantic schema data.

Updated Jun 19, 2026
One-click install
npx skills add https://github.com/AnandaAnugrahHandyanto/savarez_agent --skill instructor-anandaanugrahhandyanto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/AnandaAnugrahHandyanto/savarez_agent/tree/main/optional-skills/mlops/instructor
Command: npx skills add https://github.com/AnandaAnugrahHandyanto/savarez_agent --skill instructor-anandaanugrahhandyanto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to convert unstructured LLM outputs into reliable, typed data by validating results against Pydantic schemas and providing robust retry and streaming capabilities.

Core Features & Use Cases

  • Structured extraction with Pydantic validation to ensure outputs meet a defined schema.
  • Automatic retries with error feedback to recover from partial or invalid results.
  • Streaming partial results to support real-time processing and UI updates.
  • Multi-provider support for OpenAI and Anthropic workflows with consistent behavior.

Quick Start

Provide a sample LLM response and a Pydantic model, and ask this skill to extract a validated structure.

Frequently Asked Questions about instructor

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

FAQPage Schema
How do I validate LLM outputs against a Pydantic schema?

To validate LLM outputs against a Pydantic schema, you provide a sample response and a Pydantic model to extract structured data, ensuring the output meets your defined schema requirements.

What is structured output extraction from unstructured LLM responses?

Structured output extraction converts unstructured LLM responses into reliable, typed data by validating results against defined Pydantic schemas for use in production AI applications.

Can I streamline partial streaming outputs from LLMs for real-time UI updates?

Yes, you can streamline partial streaming outputs from LLMs to support real-time processing and UI updates while maintaining structured data validation across multi-provider workflows.

What is the best way to handle invalid LLM generation results automatically?

The best way to handle invalid LLM generation results is using automated retry workflows with error feedback to recover from partial or invalid outputs during structured extraction.

Does this approach work with both OpenAI and Anthropic workflows?

Yes, this approach works with both OpenAI and Anthropic workflows, providing multi-provider support with consistent behavior for structured data validation and streaming.

Do I need Python and the Instructor library to parse LLM responses?

Yes, you need Python, Pydantic, and the Instructor library to parse LLM responses, as these dependencies are required for JSON response models, validation, retry, and streaming features.