Instructor
Extracts structured data from language-model responses with type validation and automatic retries.
Description
Instructor is an open-source library for obtaining structured responses from language models. Its Python implementation uses Pydantic schemas to define fields and validation rules. It supports nested objects, data validation, retries after validation failures, and streamed responses. The project provides implementations and examples for multiple programming languages and model providers. For example, an application can turn a free-form order message into a typed object containing a product name, price, and availability status. The library is available under the MIT license. Cloud model requests require provider credentials and may incur charges; retries increase token usage. Schema validation does not establish that extracted values are factually correct.