# Instructor

> Python library that steers LLMs into validated, structured outputs using type hints.

- Website: https://useinstructor.com
- Category: Coding & Development
- Source page: https://opendirs.com/en/tools/instructor
- Pricing: Open source
- Starting price: $0
- Public API: Yes
- Open source: Yes
- Chinese language: No
- Accessible from mainland China: Unknown
- Platforms: Unknown
- Country: Unknown
- Last verified: Nov 28, 2026

## Overview

Instructor is an open-source Python library that makes large language models return structured, validated data. You define a Pydantic model, and it handles the prompting, parsing, and retries needed to get objects that match that schema. It is a favorite among developers who want LLM calls to look like ordinary typed functions instead of fragile string parsing.

**Best for:** Python developers who need reliable structured output from LLM APIs.

## Key features

- Pydantic-based schemas for structured LLM responses
- Automatic retries and validation when the model misses the schema
- Works with popular model providers and OpenAI-compatible APIs
- Keeps LLM calls looking like typed Python functions

## Use cases

- Extracting invoices, tickets, or form fields into a schema
- Forcing an agent tool call to return a valid JSON object
- Replacing fragile regex or manual JSON parsing around LLM output

## Pros

- Very practical and widely adopted in Python LLM apps
- Validation and retries reduce broken downstream code
- Simple mental model if you already use Pydantic

## Cons

- It is a library, not a full agent framework
- Schema design and edge cases are still your responsibility

## Alternatives

- [Qwen Code](https://opendirs.com/en/tools/qwen-code.md)
- [LangChain4j](https://opendirs.com/en/tools/langchain4j.md)
- [Poolside](https://opendirs.com/en/tools/poolside.md)
- [OpenCode](https://opendirs.com/en/tools/opencode.md)
- [Repomix](https://opendirs.com/en/tools/repomix.md)

## FAQ

### What is Instructor?

Instructor is an open-source Python library that makes large language models return structured, validated data. You define a Pydantic model, and it handles the prompting, parsing, and retries needed to get objects that match that schema. It is a favorite among developers who want LLM calls to look like ordinary typed functions instead of fragile string parsing.

### Is Instructor free?

Instructor uses a Open source pricing model (verified Nov 28, 2026).

### Does Instructor have an API?

Yes. Instructor offers an API for developers.

### Does Instructor support Chinese, and is it available in China?

Instructor does not support Chinese, and it has unverified availability in mainland China.

### What are the best alternatives to Instructor?

Popular alternatives to Instructor include Qwen Code, LangChain4j, Poolside, OpenCode.

_Last verified: Nov 28, 2026_