#2424th of 242 in Agent frameworks and SDKs

instructor

Python library that returns Pydantic-validated structured output from LLM calls

Stars
14.2k
License
MIT
Last commit
Nov 2026
Last release
Nov 2026
Language
Python
Stars, last 35 weeks+1,676
25 Mar 2026: 12,479 stars1 Apr 2026: 12,553 stars8 Apr 2026: 12,611 stars15 Apr 2026: 12,667 stars22 Apr 2026: 12,714 stars29 Apr 2026: 12,753 stars6 May 2026: 12,824 stars13 May 2026: 12,861 stars20 May 2026: 12,900 stars27 May 2026: 12,967 stars3 Jun 2026: 13,015 stars10 Jun 2026: 13,059 stars17 Jun 2026: 13,113 stars24 Jun 2026: 13,154 stars1 Jul 2026: 13,293 stars8 Jul 2026: 13,384 stars15 Jul 2026: 13,475 stars22 Jul 2026: 13,542 stars29 Jul 2026: 13,598 stars5 Aug 2026: 13,636 stars12 Aug 2026: 13,669 stars19 Aug 2026: 13,703 stars26 Aug 2026: 13,746 stars2 Sept 2026: 13,788 stars9 Sept 2026: 13,832 stars16 Sept 2026: 13,884 stars23 Sept 2026: 13,914 stars30 Sept 2026: 13,940 stars7 Oct 2026: 13,965 stars14 Oct 2026: 13,998 stars21 Oct 2026: 14,034 stars28 Oct 2026: 14,063 stars4 Nov 2026: 14,096 stars11 Nov 2026: 14,111 stars18 Nov 2026: 14,135 stars25 Nov 2026: 14,155 stars

12,479 on 25 Mar 202614,155 on 25 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Instructor wraps LLM provider clients so a chat completion call takes a Pydantic `response_model` and returns a validated, typed object. Failed validations are retried with the error message fed back to the model, and partial objects can be streamed. One `from_provider` interface covers OpenAI, Anthropic, Google, Groq and Ollama, with ports in TypeScript, Ruby, Go, Elixir and Rust.

Who it is for: Python developers who need typed JSON extraction from LLMs

Strengths

  • Same `response_model` call across OpenAI, Anthropic, Google, Groq and Ollama
  • Automatic retries on Pydantic validation failure via `max_retries`
  • Streams partial objects with `Partial[Model]`
  • Installs with pip, uv or poetry; no server to run

Weaknesses

  • Extraction only; README points to PydanticAI for agents, tools and evals
  • No built-in observability or tracing
  • Retries add extra LLM calls, raising cost and latency on failures
  • Other language ports are listed as separate implementations with their own docs

What it needs

  • no GPU
  • Needs Pydantic, LLM provider API or local Ollama
  • Models: OpenAI, Anthropic, Google, Groq, Ollama

What changed

  1. v1.17.0 ↗ (opens in a new tab)BreakingSecurity fix

    “Cached responses use new keys and isolated per-client namespaces. Existing cache entries will miss. Set the same explicit cache_namespace only when clients are intended to share results; keep account…”

    “Async validation policy: Fail closed for @async_field_validator and @async_model_validator response models instead of silently skipping policy checks. The proposed automatic execution in #2588 is def…”

  2. v1.16.0 ↗ (opens in a new tab)Security fix

    “LLM validator isolation: Send validation rules and candidate values as structured JSON data under a fixed trusted instruction to reduce prompt-injection risk, and raise ValueError for rejected values…”

From the release notes. No flag means the note does not say so, not that the upgrade is safe. Releases and problems by RSS

Also in Agent frameworks and SDKs

See all 242
Also in Agent frameworks and SDKs
RankProjectScore
#22adk-pythonCode-first Python framework for building and deploying multi-agent apps22.4k starsApache-2.087 out of 100
#23parlantPython framework for customer-facing agents that follow policies18.4k starsApache-2.087 out of 100
#25sandcastleTypeScript library that runs coding agents in isolated sandboxes on git branches9.3k stars+635 (+7.3%) in 30 daysMIT87 out of 100
#26agent-nativeTypeScript framework for agents that share actions and state with an app UI7.8k starsMIT87 out of 100
#27ag-uiEvent-based protocol connecting agent backends to user-facing apps Live demo ↗ (opens in a new tab)22.1k starsMIT86 out of 100