Instructor is the most popular open-source library for getting reliable structured outputs from large language models. Built on Pydantic, it lets you declare the exact shape of data you want, a user, an invoice, a classification, and receive validated Python objects back instead of fragile raw text. The project has earned more than 14,000 stars on GitHub and is maintained actively, with updates through late 2026.
Anyone who has parsed free-form LLM output with regular expressions knows the pain Instructor removes. You define a Pydantic model, pass it as the response model, and Instructor handles prompt construction, JSON parsing, validation, and automatic retries when the model’s answer does not match the schema. Type safety and IDE support come free because results are ordinary Pydantic objects. The library works across providers, including OpenAI, Anthropic, Google, and many open-model endpoints, through a unified provider syntax, and supports streaming of partial objects so UIs can render structured data as it arrives. Beyond extraction, it covers validation hooks, nested models, enums, and data pipelines, which is why it became standard tooling for LLM applications in Python. The maintainers also point agent builders toward PydanticAI for full agent runtimes, while Instructor stays focused on doing structured output simply and cheaply.
Instructor is completely free and open source under the MIT license. You only pay for the underlying LLM API calls you make through your chosen provider; the library itself has no tiers, keys, or usage limits.
Instructor is for Python developers building anything that turns language into data: document extraction, classification pipelines, form filling, agents that call tools, and analytics over text. If your application depends on an LLM returning dependable JSON, Instructor is close to essential infrastructure.