instructor

Extract and validate structured data from LLM responses with Pydantic.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/vikrant-project/devil-agent-ai-platform --skill instructor-vikrant-project
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/vikrant-project/devil-agent-ai-platform/tree/main/agent_core/optional-skills/mlops/instructor
Command: npx skills add https://github.com/vikrant-project/devil-agent-ai-platform --skill instructor-vikrant-project

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill extracts structured data from LLM responses, ensuring accuracy and reliability.

Core Features & Use Cases

  • Structured Data Extraction: Extract data with Pydantic validation from LLM responses.
  • Automatic Validation: Validates outputs against predefined schemas.
  • Retry Mechanism: Automatically retries failed extractions.
  • Complex JSON Parsing: Safely parse complex JSON with type safety.
  • Partial Results Streaming: Stream results in real-time for continuous processing.
  • Supports Multiple LLMs: Works with Claude, GPT-4, Gemini, and custom models.
  • Use Case: Utilize this Skill to automate the parsing of user information from chatbot interactions.

Quick Start

Install Instructor and use it to extract user data from an LLM response. For example:

pip install instructor

Then, write a Python script to define a response model and extract data.

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?

To extract structured data from LLM responses, you can use Pydantic validation to ensure accuracy and compliance. This approach automatically validates outputs against predefined schemas and safely parses complex JSON with type safety.

Can I use Pydantic validation with Claude and GPT-4 for JSON parsing?

Yes, Pydantic validation for JSON parsing works with Claude, GPT-4, Gemini, and custom models. It validates extracted data against predefined schemas to ensure accuracy and reliability across multiple LLM platforms.

What's the best way to handle failed data extraction from LLM outputs?

Handling failed data extraction from LLM outputs is best managed through an automatic retry mechanism. This feature automatically retries failed extractions, ensuring reliable structured data retrieval without manual intervention.

Does structured data extraction support partial results streaming?

Yes, structured data extraction supports partial results streaming. This allows you to stream results in real-time for continuous processing, which is ideal for automating data extraction in workflows requiring immediate feedback.

How do I automate parsing user information from chatbot interactions?

To automate parsing user information from chatbot interactions, apply structured data extraction with Pydantic validation to LLM responses. This ensures the extracted user data is accurate, validated, and compliant with your predefined schemas.

Why do I need Pydantic for complex JSON parsing from LLM outputs?

You need Pydantic for complex JSON parsing from LLM outputs because it provides type safety and automatic validation against predefined schemas. This ensures the structured data extracted is accurate and reliable for downstream workflows.