instructor
Extracts structured, validated data from LLM responses using the Instructor Python library with Pydantic response models, including nested models, enums, custom validators, automatic retries with validation error feedback, and streaming of partial objects or iterables. Works with Anthropic, OpenAI, and local Ollama models. Use when pulling typed fields or entities out of free text, when classifying text into fixed categories, when an LLM must return JSON that passes schema validation, when failed extractions need automatic retry, or when streaming partial structured results. Not for prompt optimization (use DSPy) or building multi-step chains (use LangChain).
- Version
- 1.0.0
- License
- MIT
Pinned to revision df088027ff23, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/instructor/SKILL.md
- skills/instructor/references/advanced-features.md
- skills/instructor/references/common-patterns.md
- skills/instructor/references/error-handling.md
- skills/instructor/references/examples.md
- skills/instructor/references/provider-configuration.md
- skills/instructor/references/providers.md
- skills/instructor/references/validation.md
Every link opens the file at its source, pinned to the revision this page describes.