Instructor

Instructor

Structured outputs for LLMs

Description

Asking LLMs for JSON brings malformed output, missing fields and hand-written parsing and retries. Instructor gets reliable structured data from any LLM using Pydantic: define a model and get typed results.

Validation, type safety and IDE support are built in, with no JSON parsing or retry code, across OpenAI and other providers.

Features



Pydantic models:Define output as classes.

Validation:Automatic retries.

Type safety:IDE completion.

Many models:Major providers.