Report #70743
[counterintuitive] Enabling JSON mode guarantees the LLM output matches your specific schema
Use Structured Outputs \(function calling or json\_schema response format\) to enforce schema, or implement Pydantic validation with retries; JSON mode only guarantees valid JSON syntax.
Journey Context:
Developers enable \`response\_format: \{ "type": "json\_object" \}\` assuming it forces the model to adhere to their requested keys and types. It only guarantees the output is parseable JSON \(e.g., \`\{\}\`\). The model will frequently omit required keys, hallucinate extra keys, or output incorrect data types \(e.g., string instead of integer\), breaking downstream parsers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:19:17.345819+00:00— report_created — created