<h1 align="center">
<a href="https://prompts.chat">
Compare different modes available in Instructor and understand when to use each
Sign in to like and favorite skills
Instructor uses core modes that work across providers. Provider-specific modes still work, but they are deprecated and will show warnings.
Mode handling now lives in provider handlers. The DSL no longer stores mode-specific streaming logic.
TOOLS: Tool or function calling for structured extraction.JSON_SCHEMA: Native schema support when a provider has it.MD_JSON: JSON from text or code blocks for simple or fallback cases.PARALLEL_TOOLS: Multiple tool calls in one response.RESPONSES_TOOLS: OpenAI Responses API tools.These legacy modes map to core modes:
FUNCTIONS -> TOOLSTOOLS_STRICT -> TOOLSANTHROPIC_TOOLS -> TOOLSANTHROPIC_JSON -> MD_JSONGENAI_TOOLS -> TOOLSGENAI_JSON -> JSONMISTRAL_TOOLS -> TOOLSMISTRAL_STRUCTURED_OUTPUTS -> JSON_SCHEMABEDROCK_TOOLS -> TOOLSBEDROCK_JSON -> MD_JSONFIREWORKS_TOOLS -> TOOLSFIREWORKS_JSON -> MD_JSONCEREBRAS_TOOLS -> TOOLSCEREBRAS_JSON -> MD_JSONWRITER_TOOLS -> TOOLSWRITER_JSON -> MD_JSONPERPLEXITY_JSON -> MD_JSONVERTEXAI_TOOLS -> TOOLSVERTEXAI_JSON -> MD_JSONVERTEXAI_PARALLEL_TOOLS -> PARALLEL_TOOLSTOOLS for most structured output cases.JSON_SCHEMA when the provider supports native schema enforcement.MD_JSON if tools are not supported or outputs are simple.PARALLEL_TOOLS for multiple tasks in one response.import instructor from instructor import Mode client = instructor.from_provider( "openai/gpt-4o-mini", mode=Mode.TOOLS, )
import instructor from instructor import Mode client = instructor.from_provider( "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0", mode=Mode.MD_JSON, )
import instructor from instructor import Mode client = instructor.from_provider( "openai/gpt-4o-mini", mode=Mode.JSON_SCHEMA, )
See the Mode Migration Guide for more details.
For complex structures:
import instructor client = instructor.from_provider( "google/gemini-2.5-flash", mode=instructor.Mode.TOOLS, )
For structured outputs with JSON:
import instructor client = instructor.from_provider( "google/gemini-2.5-flash", mode=instructor.Mode.JSON, )
Legacy modes are shown for compatibility only. Prefer core modes in new code.
Start with the recommended mode for your provider
TOOLSANTHROPIC_TOOLS (Claude 3+) or ANTHROPIC_JSONTOOLS or JSONTry JSON modes for simple structures or if you encounter issues
Use provider-specific modes when available
Test and validate