instructor

Enforce structured LLM output with Pydantic validation and automatic retries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill solves the challenge of inconsistent or malformed LLM outputs by enforcing strict schema validation and automatic retries, ensuring your AI agents produce reliable, type-safe data.

Core Features & Use Cases

  • Structured Data Extraction: Convert unstructured text into validated Pydantic models automatically.
  • Automatic Validation & Retries: If the LLM generates invalid data, the skill catches the error and prompts the model to correct itself.
  • Multi-Provider Support: Works seamlessly with OpenAI, Anthropic, and local models via Ollama.

Quick Start

Use the instructor skill to extract user information from the provided text 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 get structured data extraction from LLM outputs?

Structured data extraction from LLMs is enforced by integrating Pydantic schema validation, which automatically catches malformed responses and prompts the model to correct itself through automated retries.

Does instructor work with Anthropic and OpenAI models?

Yes, instructor works seamlessly with Anthropic, OpenAI, and local models via Ollama. This multi-provider support ensures you can enforce structured output and type safety across different LLM environments.

Why does my LLM output fail validation when extracting data?

LLM output fails validation when the generated data does not match the strict Pydantic schema. This skill handles invalid data by catching the validation error and prompting the model to correct itself automatically.

Can I use Pydantic for type safety with real-time streaming LLM responses?

Yes, you can use Pydantic for type safety with real-time streaming. This skill satisfies requirements for real-time streaming and robust validation, ensuring reliable structured outputs even during continuous data generation.

What is the best way to convert unstructured text into validated Pydantic models?

The best way to convert unstructured text into validated Pydantic models is by using automated validation and retries. If the LLM generates invalid data, the skill catches the error and prompts the model to correct itself.