CreateWithAIHub

Library 567 Labs

Instructor

Python library for getting validated, typed structured output from LLMs using Pydantic models.

Visit website ↗
Save

What it is

Instructor extracts structured data from large language models by letting you define the output as a Pydantic model and handling schema generation, validation and parsing. When validation fails it retries automatically with the error message, and it can stream partial objects. The same interface works across many providers including OpenAI, Anthropic, Google, Mistral, Ollama and DeepSeek.

What it's useful for

Turning free-form text such as emails, documents or chat logs into clean typed records, or enforcing a schema on model output in a data pipeline.

Key features

  • Pydantic models as the output schema
  • Automatic retries when validation fails
  • Streaming of partial objects and lists
  • from_provider interface across 15+ LLM providers
  • Ports in TypeScript, Go, Ruby, Elixir and Rust

How to use it

pip
pip install instructor
uv
uv add instructor

Commands are copied from the official documentation. Check the docs for the latest version before running them.

Limitations to know

  • Focused on extraction; the maintainers point to PydanticAI for full agent runtimes

Alternatives

Python library from .txt that constrains LLM generation so outputs match JSON schemas, regexes, choices or grammars.

FreeOpen source

Boundary's open-source language for type-safe LLM functions and structured outputs, callable from Python, TypeScript, Go and more.

FreeOpen source

MCP servers for this

MCP reference server that gives an AI client controlled read/write access to chosen local directories.

FreeOpen source

Open-source MCP server that gives coding agents simplified Figma layout and styling data to implement designs.

Free plan + paidOpen source

Community MCP server and Blender addon that let an AI agent model, light and render scenes in a running Blender.

Free plan + paidOpen source

Skills for this

Hugging Face's Agent Skills for the Hub CLI, datasets, model training, evaluation, Spaces and SageMaker deployment.

FreeOpen source

Anthropic skill that guides Claude through designing, building and evaluating MCP servers in TypeScript or Python.

FreeOpen source

Related resources

Coding agent that runs each thread in a cloud sandbox, with a CLI, web, desktop and mobile apps.

Free plan + paid

Arize's source-available, self-hosted AI observability tool for OpenTelemetry tracing, evals, datasets and prompts.

Free

Open-source Python library for building AI agents that browse and act on websites, with an optional hosted cloud.

FreeOpen source

Anthropic's family of proprietary large language models (Opus, Sonnet, Haiku tiers) for reasoning, coding and agents.

Paid

Type to search. Use ↑ ↓ and Enter.