Instructor iconInstructor

MIT library for structured, validated LLM output with Pydantic: automatic retries, streaming partial objects and one API for 15+ providers

14.1k+ GitHub Stars
15+ LLM Providers
1.17.0 Latest (Sep 2026)

Overview

Instructor is an open-source library for getting structured, validated data out of LLMs: "Extract structured data from any LLM with type safety, validation, and automatic retries." You describe the output as a Pydantic model; Instructor sends it to the model, validates the reply, and retries with the validation error when it fails. It streams partial objects and lists, and one from_provider call covers 15+ providers, including OpenAI, Anthropic, Google, Mistral, Cohere, DeepSeek and local models through Ollama, llama-cpp-python or vLLM. Jason Liu created it; the Python version is MIT-licensed and has ports in TypeScript, Go, Ruby, Elixir and Rust. There is no paid tier. Version 1.17.0 shipped in September 2026, after 1.16.0 added native structured outputs on Amazon Bedrock and retry token budgets.

The Verdict

Who Should Use Instructor?

Best For

  • Python teams extracting typed data from documents or chats
  • Apps that switch between hosted providers
  • Adding validation and retries to existing LLM calls

Not Ideal For

  • Full agent workflows with tools and memory
  • Cases that need output guaranteed at the token level

What's Great

  • Simplest way to get typed output; wraps the client you already use
  • Works with hosted APIs, unlike decoding-based tools
  • Active releases through 2026

Watch Out For

  • Relies on retries, so failures cost extra tokens
  • Native structured outputs from providers cover more of the same need
  • Extraction only; agents need a framework such as Pydantic AI

Pricing

View all features & details

Key Features

  • Pydantic models as the output schema
  • Validation with automatic retries
  • Streaming of partial objects and lists
  • from_provider unified client, sync and async
  • Local models via Ollama, llama-cpp-python or vLLM

Project

  • Created by Jason Liu; repo under the 567-labs org
  • Ports: TypeScript, Go, Ruby, Elixir, Rust
  • Python 3.9 or later

Real-World Usage

Adoption

  • The project reports over 3 million monthly downloads
  • 100+ contributors, per the docs

Releases

  • 1.15.4 (Jun), 1.16.0 (Aug), 1.17.0 (Sep 2026)
  • 1.17.0 tightened cache isolation and async validation

How It Compares

Feature Instructor Outlines Pydantic AI
Approach Validate and retry Constrained decoding Agent framework
Hosted APIs Yes, 15+ providers Needs local decoding Yes
Best for Typed extraction Guaranteed formats on local models Agents with tools

Sources: Instructor · GitHub · PyPI (1.17.0, Sep 2026) · DEV comparison · see also Outlines, Guidance and Pydantic AI

Is this your tool? Add a badge