Instructor

Structured outputs from LLMs using Pydantic — patches OpenAI/Anthropic/Cohere/etc. clients to return validated typed objects with retries.

llm-gateway-frameworks
76
Hero Score
Popularity
74
Performance
85
Ecosystem
75
Maturity
69
Dev Experience
75
⭐ 14,006 stars⬇ 2.3M downloads/wkFirst release: Jul 2023Last release: Sep 2026
Async Support: YesPlugin Extensions: HighSpeed: FastDoc Quality: HighLearning Curve: Easy

Pros

  • • Type-safe LLM outputs via Pydantic response_model — validated objects, not strings
  • • Automatic retries with parsing errors fed back to the model
  • • Multi-provider — patches OpenAI, Anthropic, Cohere, Gemini, Mistral, and more

Cons

  • • Works by patching client libraries, which can feel implicit and surprising
  • • response_model feature coverage and reliability vary by underlying provider
  • • Adds parsing/validation latency compared to raw streaming

Alternatives in llm-gateway-frameworks

Compare Python Packages with ease.