instructor

Convert unstructured LLM responses into validated Pydantic models.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Extract and validate unstructured LLM responses by converting them into typed, Pydantic models, with automatic retries on validation failures and real-time streaming of partial results.

Core Features & Use Cases

  • Structured extraction: convert free-form LLM outputs into Pydantic models with strict validation rules.
  • Automatic retries: retry failed executions with actionable feedback to improve accuracy.
  • Streaming: receive incremental updates as data is built, enabling responsive UI and workflows.
  • Use Case: Build reliable AI assistants that extract user profiles, object attributes, or multi-field records from chat transcripts.

Quick Start

Convert an unstructured LLM reply into a validated Pydantic model.

Frequently Asked Questions about instructor

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

FAQPage Schema
How do I convert unstructured LLM outputs into validated Pydantic models?

Convert unstructured LLM outputs into validated Pydantic models by enforcing strict type safety and customizable cross-field validation rules. This ensures data quality and correctness by transforming free-form chat transcripts into typed, structured records automatically.

What's the best way to handle LLM data validation failures during structured extraction?

Handle data validation failures during structured extraction by utilizing automatic retries. Failed executions are retried with actionable feedback provided back to the LLM, improving accuracy and ensuring the output meets your Pydantic validation rules.

Can I stream partial LLM responses in real-time while validating structured data?

Stream partial LLM responses in real-time while validating structured data by receiving incremental updates as the data is built. This enables responsive UI workflows and provides immediate feedback before the full Pydantic model extraction completes.

Does multi-provider LLM usage work with Pydantic structured output and streaming?

Multi-provider LLM usage works with Pydantic structured output and streaming. This allows you to enforce type safety, apply customizable validators, and maintain data quality across different LLM providers without changing your core validation logic.

Why use Pydantic models for LLM structured extraction instead of parsing raw text?

Use Pydantic models for LLM structured extraction to enforce strict type safety and enable cross-field validation, which parsing raw text lacks. This approach guarantees data correctness by converting free-form responses into reliable, typed records for AI assistants.

When do I need automatic retries for LLM data validation and structured output?

You need automatic retries for LLM data validation when structured extraction fails to meet Pydantic rules. Retrying failed executions with actionable feedback corrects the LLM's output format, ensuring your typed data models remain accurate and reliable.