Devtoolwatch BoardGet it every Monday

Instructor review

Instructor is a Python library for getting validated, structured outputs from LLMs using Pydantic models, with retries and streaming.

Updated Nov 1, 2026. Review written Oct 22, 2026 from the project's own sources; usage data refreshed every Monday.

TL;DR

Instructor is a library that extracts structured, typed data from LLM responses using Pydantic models. It is for developers who need validated JSON from providers like OpenAI, Anthropic, Google, or local Ollama models. It focuses on schema-first extraction rather than agents, and offers automatic validation retries, partial streaming, and one API across providers.

Instructor at a glance

Category
Model SDKs and gateways
Maintained by
567-labs (organization, @567-labs on GitHub)
License
MIT
Language
Python, Shell
Repository
github.com/567-labs/instructor
Website
python.useinstructor.com
PyPI package
instructor 1.17.0
Latest release
v1.17.0 on GitHub, Sep 9, 2026
First published
Jun 14, 2023

What Instructor does

  • Instructor turns natural language into typed Pydantic objects by passing a response_model to client.chat.completions.create.
  • Instructor automatically retries failed validations, sending the validation error message back, controlled with max_retries.
  • Instructor streams partial objects as they are generated using Partial response models with stream=True.
  • Instructor extracts nested data structures, such as lists of nested Pydantic models.
  • Instructor uses the same code across providers including OpenAI, Anthropic, Google, Ollama, Groq, Mistral, Cohere, and DeepSeek.
  • Instructor supports native structured outputs on Bedrock through Mode.JSON_SCHEMA and Mode.TOOLS_STRICT as of v1.16.0.
  • Instructor caches responses using per-client namespaces, with an explicit cache_namespace option for sharing results.

How it works

Instructor runs as a library inside your Python code. You create a client with instructor.from_provider and a provider/model string such as "openai/gpt-4o-mini", optionally passing an API key directly. You define a Pydantic model and pass it as response_model. Instructor calls the provider, validates the response against the model, and retries on validation failure. Implementations also exist for TypeScript, Ruby, Go, Elixir, and Rust.

How to install and start using Instructor

With pip

pip install instructor

With uv

uv add instructor

With Poetry

poetry add instructor

Requirements

  • Python 3.9 or later, below 4.0.
  • An API key for your chosen hosted LLM provider, set in the environment or passed as api_key.
  • Bedrock native structured outputs require boto3 1.42.42 or later.

First steps

  1. Install Instructor with pip, uv, or Poetry.
  2. Define a Pydantic BaseModel describing the fields you want, such as name and age.
  3. Create a client with instructor.from_provider, for example "openai/gpt-4o-mini".
  4. Call client.chat.completions.create with response_model and your messages to get a validated object.

Who Instructor is for

  • Python developers extracting structured data from text with LLMs.
  • Teams that want one extraction API across multiple LLM providers, including local Ollama models.
  • Apps needing validated, typed LLM output without manual JSON parsing and retry code.

Limitations to know

  • Instructor focuses on structured extraction; the README points to PydanticAI for agents, observability, and shareable traces.
  • Since v1.17.0, response models with Instructor async-validator decorators are rejected; use Pydantic validators instead.
  • Upgrading to v1.17.0 changes cache keys, so existing cache entries will miss.
  • On Bedrock, remote HTTP(S) image and PDF URLs are blocked; only data URLs, base64, or s3:// sources are accepted.

Is Instructor growing? Usage data

In the week of Oct 25–31, 2026, Instructor ranked #309 on the Devtoolwatch Board and #19 in Model SDKs and gateways, with a momentum score of 30 out of 100. Its main package had 2.2M downloads that week, +3% against its own 4-week average.

New GitHub stars per week for Instructor12 weeks from Aug 9, 2026: 35, 40, 39, 37, 53, 45, 26, 26, 34, 33, 36, 29 new stars, an average of 36 a week.Aug 9week of Oct 25
New GitHub stars per week for the last 12 weeks, from GitHub's stargazer history (today's stargazers by the week they starred).
Show the weekly numbers
New GitHub stars per week for Instructor
Week ofNew stars
Aug 9, 202635
Aug 16, 202640
Aug 23, 202639
Aug 30, 202637
Sep 6, 202653
Sep 13, 202645
Sep 20, 202626
Sep 27, 202626
Oct 4, 202634
Oct 11, 202633
Oct 18, 202636
Oct 25, 202629

On Hacker News

The Board ranks tools by four signals each week: new stars, new stars for the repo's size, added downloads and download growth beyond the market. How the ranking works.

Instructor alternatives

Other LLM SDKs and gateways on the Board in the week of Oct 25–31, 2026, by momentum:

Model SDKs and gateways ranked by momentum, the week of Oct 25–31, 2026
RankToolStarsDownloads/wk
#1thinking-orbsthinking-orbs is a React library of dotted, animated thought-orb loading indicators for AI and agent user interfaces.3.9k1.4M
#2HeadroomHeadroom compresses tool outputs, logs, files, and RAG chunks locally before they reach the LLM, as a library, proxy, or MCP server.78.5k125.8k
#3LiteLLMLiteLLM is an open source AI gateway and Python SDK that calls 100+ LLM providers through one OpenAI-format interface.62.5k23.1M
#4Honcho Memory library for building stateful agents7.9k–
#5Anthropic SDKAnthropic SDK is the official Python library for calling the Claude API from Python applications.4k111M
#6Hugging Face HubHugging Face Hub is the official CLI and Python client for downloading, uploading and managing models, datasets and Spaces on the…4k68.3M

All LLM SDKs and gateways, ranked

Recent Instructor releases

Instructor FAQ

Is Instructor free and open source?

Yes. Instructor's source code is on GitHub (567-labs/instructor) under the MIT license, so you can use it for free.

How do I install Instructor?

Run pip install instructor. The instructor package needs Python 3.9 or newer, below 4.0. The install section above has the other options from the project's README.

Is Instructor still maintained?

Yes. The 567-labs/instructor repository was last updated on Oct 20, 2026, and the latest release, v1.17.0 on GitHub, came out on Sep 9, 2026.

How popular is Instructor?

Instructor has 14.1k GitHub stars as of Nov 1, 2026. It gained 29 new stars in the week of Oct 25–31, 2026, against a 12-week average of 36 a week. Its main package had 2.2M downloads that week, +3% against its own 4-week average. That made it #19 among LLM SDKs and gateways on the Devtoolwatch Board.

What are the best alternatives to Instructor?

Other LLM SDKs and gateways on the Devtoolwatch Board in the week of Oct 25–31, 2026, by momentum: thinking-orbs (#1), Headroom (#2), LiteLLM (#3), Honcho (#4), Anthropic SDK (#5). The alternatives table above has their numbers.

What is a Python Instructor alternative for agents?

Instructor's own docs recommend PydanticAI when you need agents. PydanticAI is the Pydantic team's agent runtime, adding typed tools, replayable datasets, evals, and dashboards while using the same Pydantic models.

Which LLM providers does Instructor support?

Instructor supports OpenAI, Anthropic, Google, Mistral, Cohere, Ollama, DeepSeek, Groq, Bedrock, and more, with 15+ providers listed. The same from_provider API is used for all of them.

Can Instructor work with local open source models?

Instructor works with local models through Ollama, for example instructor.from_provider("ollama/llama3.2").

What happens when the LLM output fails validation in Instructor?

Instructor automatically retries the request, including the validation error message, up to the max_retries you set.

Is Instructor only for Python?

Instructor started in Python, and implementations also exist for TypeScript, Ruby, Go, Elixir, and Rust.

Sources

  1. 567-labs/instructor on GitHub
  2. Instructor README
  3. instructor on PyPI
  4. Instructor website
  5. Release v1.17.0 (Sep 9, 2026)
  6. Release v1.16.0 (Aug 27, 2026)
  7. Release v1.15.4 (Jun 28, 2026)
  8. Hacker News: Show HN: Instructor v1, for LLM structured output and streaming
  9. Devtoolwatch Board, the week of Oct 25–31, 2026

Instructor README badge

Maintainers can show the tool's weekly Board rank in their README:

Devtoolwatch badge for Instructor

[![Devtoolwatch](https://index.devtoolwatch.com/badge/instructor.svg)](https://index.devtoolwatch.com/tools/instructor/)

How this page is made: Devtoolwatch writes each review from the project's README, releases, package metadata and website, with an AI model, then checks every claim against the source it cites and drops what the sources don't support. The numbers come from Devtoolwatch's daily GitHub snapshots, GitHub's stargazer history, and the npm and PyPI download APIs. Spotted an error? Email [email protected].