instructor

Extract structured data from LLM outputs using Pydantic models.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/thisismynewfmail-ui/Monika-agent --skill instructor-thisismynewfmail-ui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/thisismynewfmail-ui/Monika-agent/tree/main/optional-skills/mlops/instructor
Command: npx skills add https://github.com/thisismynewfmail-ui/Monika-agent --skill instructor-thisismynewfmail-ui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Extract structured data from LLM responses with type-safe validation and automatic retries.

Core Features & Use Cases

  • Extract structured data from natural language outputs using Pydantic models for strict validation.
  • Automatically retry failed extractions with contextual feedback to improve accuracy.
  • Stream partial results for real-time processing across multiple providers.

Quick Start

Install the Instructor package, define a Pydantic model, and call the client with your prompt to obtain validated results.

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 outputs reliably?

To extract structured data from LLM outputs reliably, you use Pydantic models for strict type validation and automatic retries with contextual error feedback to ensure accurate, safe parsing across different providers.

What is the best way to validate JSON generated by an LLM?

The best way to validate LLM-generated JSON is applying type-checked schemas via Pydantic models, which automatically handles validation and triggers retries with error feedback to correct malformed structures.

Can I stream partial structured outputs from OpenAI and Anthropic models?

Yes, you can stream partial structured outputs for real-time processing across multiple providers like OpenAI and Anthropic, enabling consistent data pipelines as the response generates.

Why does my LLM structured output fail validation and need retries?

LLM structured output fails validation when responses do not match the defined Pydantic schema, triggering automatic retries that feed validation errors back to the model to improve accuracy.

Do I need Pydantic models to parse structured LLM responses?

Yes, you need Pydantic models to parse structured LLM responses because they provide the type-checked schemas required for strict validation, cross-model JSON parsing, and reliable data extraction.

How to handle cross-model JSON parsing for robust data pipelines?

To handle cross-model JSON parsing for robust data pipelines, apply type-checked schemas that normalize outputs across different providers, using validation and automatic retries to deliver consistent results.