The Open-Source AI Stack

The Stack · Runtime · Open source

Instructor

Library for getting Pydantic-typed structured output from LLMs across many providers, built on function calling and JSON mode with automatic retries.

Instructor is a library for getting typed, validated objects out of language models. You define the shape you want as a Pydantic model; Instructor turns it into a schema, asks the model to fill it (using the provider's function-calling or JSON-mode support), validates the response, and retries automatically when validation fails. It works across many providers and local engines through a common interface. Its niche is developer ergonomics rather than the decoding mechanism. Outlines, XGrammar, and llguidance guarantee validity by constraining the decoder; Instructor instead leans on the model's own structured-output support plus validate-and-retry, which is simpler to adopt and works even against hosted APIs you cannot constrain directly. Guidance is the closest sibling but is built around scripting generation rather than returning a typed object. For open-source AI it lowers the barrier to treating an open model as a typed function in ordinary application code, which is a large part of how open models get wired into real software.

Sources

Want a follow-up? Ask the chat about Instructor in context. It will compare to siblings at the same layer and ground every claim in the wiki.

Other projects at the Runtime layer

12 siblings · ordered open first