# Instructor

CreateWithAI Hub page: https://createwithaihub.com/open-source/instructor
Latest version of this file: https://createwithaihub.com/open-source/instructor.md

- Type: Library · Category: Libraries & Open Source
- Publisher: 567 Labs
- Pricing: Free · License: MIT
- Runs on: macOS, Windows, Linux

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

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.

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

## Connection

- Language: Python
- Focus: Structured output

## Install steps from the official documentation

pip:

```
pip install instructor
```

uv:

```
uv add instructor
```

## Limitations

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

## Official links

- Website: https://python.useinstructor.com
- Source repository: https://github.com/567-labs/instructor
- Documentation: https://python.useinstructor.com
- Source: https://github.com/567-labs/instructor (Features, providers, install commands, PydanticAI note; MIT; not archived)
- Source: https://python.useinstructor.com/ (Validation, retries, streaming, providers, other languages)
