Skip to content

instructor

What's new in Instructor v2?

Instructor's public job is simple: pass a Pydantic model to an LLM client and get validated Python data back. Instructor v2 keeps that API, but changes how the library implements it. Provider packages, or an explicitly shared wire-compatible implementation, now own the SDK construction, wire format, streaming events, tool schema, and validation reask payload.

This is not only a directory move. It changes the unit of correctness. In v2, support for a feature is declared for a provider, registered by that provider's handlers, and exercised by tests generated from the same declaration.

Announcing Responses API support

We're excited to announce Instructor's integration with OpenAI's new Responses API. This integration brings a more streamlined approach to working with structured outputs from OpenAI models. Let's see what makes this integration special and how it can improve your LLM applications.

Announcing unified provider interface

We are pleased to introduce a significant enhancement to Instructor: the from_provider() function. While Instructor has always focused on providing robust structured outputs, we've observed that many users work with multiple LLM providers. This often involves repetitive setup for each client.

The from_provider() function aims to simplify this process, making it easier to initialize clients and experiment across different models.

This new feature offers a streamlined, string-based method to initialize an Instructor-enhanced client for a variety of popular LLM providers.