JSON Mode
Also known as: JSON Output Mode, JSON Response Format
Definition
An API setting that constrains model output to be valid JSON, without specifying a particular schema. JSON mode guarantees parseable JSON but not any specific structure—the model chooses the keys and values. It's a weaker guarantee than structured output (which enforces a schema) but simpler to use.
What this is NOT
- Not structured output (JSON mode doesn't enforce a schema)
- Not guaranteed to have specific fields (only guarantees valid JSON syntax)
- Not function calling (that's for tool invocation, not output formatting)
Alternative Interpretations
Different communities use this term differently:
llm-practitioners
An API parameter (e.g., `response_format: { type: "json_object" }`) that ensures the model outputs valid JSON. Introduced before full structured output support as a middle ground between free text and schema constraints.
Sources: OpenAI JSON mode documentation, Anthropic JSON output
Examples
- response_format: { type: 'json_object' } in OpenAI API
- Model outputs {"answer": "Paris", "confidence": 0.95} without schema
- Extracting key-value pairs with flexible structure
Counterexamples
Things that might seem like JSON Mode but are not:
- Structured output with a defined schema (that's stricter)
- Free-form text that happens to contain JSON
- Function calling (different mechanism)
Relations
- specializes structured-output (JSON mode is a weak form of structured output)
- overlapsWith function-calling (Both produce structured data, different purposes)
Implementations
Tools and frameworks that implement this concept:
- GPT-4 Turbo secondary