$npx skillfedfor your agent

instructor

structured outputs for llm

Worth itPyPI Artificial IntelligenceReleased Jun 202619.9M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — instructor-1.15.4-py3-none-any.whl
v1.15.4 · released 2026-06-28 · Python <4.0,>=3.9 · 11 runtime deps: aiohttp, docstring-parser, jinja2, jiter, openai, pydantic-core, pydantic, requests

Yes. Instructor is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It solves a real problem—reliable structured extraction from LLMs—with a clean API and broad provider support. Install it if you need to extract validated structured data from LLM responses; skip it if you're building agents or need richer observability (the docs suggest PydanticAI for that).AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • You must have an API key for at least one supported LLM provider (OpenAI, Anthropic, Google, Ollama, Groq, etc.) and set it as an environment variable or pass it explicitly.
  • Low friction: pure Python wheel with no compiled dependencies.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects without restriction.

last release 2026-06-28 (47 days) · last repo commit 2026-08-09 · 13,730 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 19,880,373 downloads/mo, #1,053 on PyPI

Verify before relying

pip install instructor

import instructor
from pydantic import BaseModel

class User(BaseModel):
    name: str
    age: int

client = instructor.from_provider("openai/gpt-4o-mini")
user = client.chat.completions.create(
    response_model=User,
    messages=[{"role": "user", "content": "John is 25 years old"}],
)
print(user)
  • Whether all 11 runtime dependencies are truly required for basic use or if some are optional for specific providers.
  • Performance characteristics (latency, token efficiency) compared to raw LLM API calls or alternative extraction libraries.
  • Coverage and reliability of validation retries across different LLM providers and edge cases.
Same gist for agents: .md · .json

What it is and what it does

Instructor is a Python library that bridges Pydantic models and LLM APIs to extract structured, validated data from natural language. Instead of writing JSON schemas, parsing responses, and handling validation errors manually, you define a Pydantic model and pass it to Instructor; the library generates the schema, sends it to the LLM, validates the response, and automatically retries on validation failure. It works with OpenAI, Anthropic, Google, Ollama, Groq, and other providers through a unified interface.

The package is built on Pydantic for type safety and IDE support, includes automatic retries with error feedback, supports streaming partial objects, handles nested data structures, and eliminates boilerplate around JSON parsing and manual validation. It's designed for developers who need reliable structured extraction without the complexity of writing custom parsing logic or managing provider-specific APIs.

Use it for

  • Extract product details (name, price, availability) from unstructured product descriptions or web scrapes.
  • Parse customer feedback into structured fields (sentiment, category, action items) for downstream processing.
  • Convert natural language requirements into typed configuration objects for application setup.
  • Batch-extract entities (people, places, organizations) from documents with automatic validation and retry.
  • Build chatbot intents and slot-filling workflows where LLM responses must conform to a known schema.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Instructor is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It solves a real problem—reliable structured extraction from LLMs—with a clean API and broad provider support. Install it if you need to extract validated structured data from LLM responses; skip it if you're building agents or need richer observability (the docs suggest PydanticAI for that).

Install

instructor on PyPI

Before you install

Low friction: pure Python wheel with no compiled dependencies. Active maintenance—last commit 2026-08-09, 47 days since latest release. Eleven runtime dependencies (aiohttp, pydantic, openai, requests, tenacity, etc.) are all stable, widely-used libraries.

Requires Python 3.9 or later. You must have an API key for at least one supported LLM provider (OpenAI, Anthropic, Google, Ollama, Groq, etc.) and set it as an environment variable or pass it explicitly.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects without restriction.

Quickstart

pip install instructor

import instructor
from pydantic import BaseModel

class User(BaseModel):
    name: str
    age: int

client = instructor.from_provider("openai/gpt-4o-mini")
user = client.chat.completions.create(
    response_model=User,
    messages=[{"role": "user", "content": "John is 25 years old"}],
)
print(user)

Verify before relying

  • Whether all 11 runtime dependencies are truly required for basic use or if some are optional for specific providers.
  • Performance characteristics (latency, token efficiency) compared to raw LLM API calls or alternative extraction libraries.
  • Coverage and reliability of validation retries across different LLM providers and edge cases.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
11 packages
aiohttpdocstring-parserjinja2jiteropenaipydantic-corepydanticrequestsrichtenacitytyper
MaintenanceActively maintained 47 days since the last release
Last repo commit
First released
Downloads19,880,373 / month, #1,053 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: instructor-1.15.4-py3-none-any.whl

Tags

Capabilities
structured output from llmjson extraction from language modelspydantic validation with llmreliable llm structured datallm response validationextract typed objects from textllm schema enforcement
Topics
llm-integrationdata-validationstructured-extraction

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pydantic validation with llm”

  • instructorInstructor wraps LLM APIs to extract validated, typed structured data…
  • guardrails-aiGuardrails is a Python framework that validates and constrains LLM…
  • outlinesOutlines constrains LLM generation to produce structured outputs…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also langextract · outlines · pydantic-ai · pydantic-handlebars · trustcall · vlmrun-hub · landingai-ade · langdiff · lm-format-enforcer · jsonschema-pydantic-converter

Further reading