instructor

Extract and validate structured data from LLM responses using Pydantic.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of working with unstructured data from Large Language Models (LLMs), allowing users to extract and validate structured information with ease.

Core Features & Use Cases

  • Structured Data Extraction: Extract and validate data from LLM outputs using Pydantic.
  • JSON Parsing: Safely parse complex JSON responses with type safety and validation.
  • Streaming Results: Stream partial results for real-time processing.
  • Use Case: When you need to analyze customer feedback, this Skill can parse and categorize reviews, ensuring that important insights are not missed.

Quick Start

Create a user object by extracting data from a LLM response:

from instructor import User

user = User(name="John Doe", age=30, email="[email protected]")

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 models to define the expected schema, enabling the Skill to parse unstructured text and validate the output into reliable JSON formats.

Does this structured data extraction approach work with both OpenAI and Anthropic models?

Yes, structured data extraction is compatible with multiple LLM providers, including OpenAI and Anthropic, allowing you to validate JSON parsing and extract entities across different language models.

What is the best way to parse complex JSON from LLM output safely?

The best way to safely parse complex JSON from LLM output is by applying Pydantic type safety and validation, ensuring the extracted structured data meets your defined schema before processing.

How do I validate sentiment analysis and entity recognition results from unstructured text?

You validate sentiment analysis and entity recognition results by defining Pydantic schemas that enforce type safety, ensuring the extracted structured data from unstructured text is accurate and reliable.

Can I stream partial structured data results for real-time processing?

Yes, you can stream partial structured data results for real-time processing, allowing you to handle JSON parsing and data transformation incrementally as the LLM generates the response.

Why do I need Pydantic to parse unstructured LLM output into JSON?

You need Pydantic to parse unstructured LLM output because it provides type safety and validation, ensuring the extracted structured data conforms to your schema and preventing JSON parsing errors.