instructor

Extract structured data from LLM responses into Pydantic models.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/GarrettRoi/open-manus --skill instructor-garrettroi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/GarrettRoi/open-manus/tree/main/skills/mlops/inference/instructor
Command: npx skills add https://github.com/GarrettRoi/open-manus --skill instructor-garrettroi

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of reliably extracting structured data from Large Language Model (LLM) responses, ensuring type safety and validation.

Core Features & Use Cases

  • Structured Data Extraction: Extract data into Pydantic models for type-safe access.
  • Automatic Validation: Pydantic schemas automatically validate LLM outputs.
  • Automatic Retries: Handles validation errors by retrying LLM calls with feedback.
  • Streaming: Supports streaming partial results for real-time processing.
  • Use Case: Extracting detailed user profiles, product specifications, or complex JSON objects from LLM-generated text into a structured Python object.

Quick Start

Use the instructor skill to extract user data into a Pydantic model.

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?

Structured data extraction from LLM responses is achieved by mapping outputs directly to Pydantic models for type-safe access and automatic schema validation. This approach guarantees reliable data parsing and schema enforcement.

What is the best way to validate LLM outputs and handle validation failures?

Validating LLM outputs is best handled by using Pydantic schemas to automatically validate responses and trigger automatic retries on validation failures. This error handling mechanism provides feedback to the LLM to correct subsequent calls.

Does instructor work with OpenAI and Anthropic models for structured output?

Yes, instructor works with both OpenAI and Anthropic models to generate structured output. It integrates these dependencies alongside Pydantic to enforce schemas and ensure type safety across different LLM interactions.

Can I stream partial results while extracting structured data from an LLM?

Yes, you can stream partial results during structured data extraction for real-time processing. This feature allows you to access and interact with components of the Pydantic model as the LLM response is being generated.

When do I need structured output schemas for LLM interactions?

You need structured output schemas for LLM interactions when your task requires reliable data parsing, schema enforcement, and robust error handling. This is essential for extracting detailed user profiles, product specifications, or complex JSON objects into Python objects.