Instructor
12,816Pydantic-typed structured output for LLM APIs with automatic retries.
Maturity tier details
Computed tier: 2B(raw score 4.14). Effective tier: 2B.
Facets:documented_in=0evaluated_on=0integration_surfaces=0.5paper_citations=0recent_commit=2stars=1.64
Source of truth:pipeline/maturity/score.py
Description
Thin Python library that patches LLM clients (OpenAI, Anthropic, Gemini, Cohere, Mistral, etc.) to return Pydantic models. Requests a tool/function-call response shape, parses, validates against the Pydantic schema, and retries with the validation error fed back as context on failure. Post-generation validation, not constrained decoding — relies on the provider's own JSON/tool-call mode for the initial shape.
Why it's included
Detection × post_generation × fully_autonomous exemplar for the "Pydantic schema + reask on ValidationError" pattern. Useful contrast to PydanticAI (full agent framework) and to Outlines (in-generation constraints): Instructor is the minimal library expression of the validate-and-retry paradigm.
Security notes
Open-source (MIT). Ships as a thin client patch — supply-chain surface is small but the library is broadly installed, so pin versions. Does not itself transmit data anywhere; all traffic goes through the underlying provider SDK whose posture applies.
Addresses failure modes
- Fabrication — Generating reference to non-existent APIs, packages, or symbols.
- Logic error — Correct API use, incorrect logic.