v1.15.0
The popular Python library for structured LLM outputs gets a major update with key fixes and new provider support.
567-labs has rolled out version 1.15.0 of Instructor, a widely-used Python library that helps developers get structured, validated outputs from large language models (LLMs). This release addresses several key issues and adds new functionality, headlined by a fix for the Validator class which now correctly requires an `is_valid` field, ensuring validation logic works as intended. The update also makes the xAI SDK (for Grok models) an optional dependency at runtime, giving developers more flexibility, and introduces a new `--full-id` flag to the command-line interface for viewing complete batch job IDs.
Other notable improvements include handling GEMINI_TOOLS in asynchronous streaming paths for Google's Gemini models, removing a previously opinionated system prompt from JSON mode to give users more control, and bumping various project dependencies. The release also adds missing GENAI and Responses modes to the `tool_modes()` function and provides a canonical starter example for OpenAI in the documentation. These updates collectively enhance the library's stability, flexibility, and developer experience across multiple AI providers including OpenAI, Google Gemini, and now xAI.
- Fixed a critical bug in the Validator class requiring the `is_valid` field for proper validation logic.
- Made xAI's SDK an optional runtime dependency, simplifying integration for users not utilizing Grok models.
- Added a `--full-id` CLI flag and removed an opinionated system prompt from JSON mode for better developer control.
Why It Matters
This update makes the essential Instructor library more robust and flexible for developers building reliable, structured AI applications with multiple model providers.