instructor

Extract and validate LLM responses into Pydantic schemas with automatic retries.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/handsomelong922/my-codex-skills --skill instructor-handsomelong922
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/handsomelong922/my-codex-skills/tree/main/skills/instructor
Command: npx skills add https://github.com/handsomelong922/my-codex-skills --skill instructor-handsomelong922

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Instructor enables developers to convert unstructured LLM outputs into validated, typed data using Pydantic, with automatic retries to fix invalid results and streaming updates for real-time processing.

Core Features & Use Cases

  • Validate and structure LLM responses using Pydantic schemas.
  • Automatic retry on validation errors with actionable feedback.
  • Support streaming partial results and multi-provider setups (OpenAI, Anthropic).

Quick Start

Parse an unstructured LLM response into a typed, validated model with automatic retries and streaming progress.

Frequently Asked Questions about instructor

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

FAQPage Schema
How do I validate structured data extracted from LLM responses using Pydantic?

You can validate structured data from LLM responses by applying Pydantic schemas to enforce type-safe outputs, ensuring the extracted information strictly matches your defined data models.

What is the best way to handle validation failures when parsing LLM outputs?

The best way to handle validation failures is using automatic retries that feed actionable error feedback back to the LLM, prompting it to correct and regenerate the invalid structured output.

Does structured output validation work with both OpenAI and Anthropic models?

Yes, structured output validation works across multiple providers including OpenAI and Anthropic, allowing you to extract and validate typed data consistently regardless of the underlying LLM.

Can I stream partial structured data results while the LLM is still generating?

Yes, you can stream partial results to process structured data updates in real-time as the LLM generates the response, enabling progressive data extraction before the full output completes.

Do I need Python and Pydantic to extract typed data from LLM responses?

Yes, you need Python and the Pydantic library to define the schemas required for extracting typed data, with optional configurations for streaming and multi-provider LLM setups.

Why does my LLM data extraction workflow return unstructured or invalid results?

LLM data extraction workflows return unstructured results because raw text lacks inherent validation, requiring Pydantic schemas to parse the text into strictly typed, validated models.