Report #92997
[counterintuitive] Does enabling JSON mode ensure the LLM output matches my specific schema?
Use structured outputs with a strict JSON schema \(e.g., OpenAI's Structured Outputs or tool/function calling\) rather than basic JSON mode, and always validate the output server-side.
Journey Context:
Devs turn on \`response\_format=\{ "type": "json\_object" \}\` assuming it will output the exact keys they asked for. JSON mode only guarantees the output \*parses\* as valid JSON \(no syntax errors\); it does not guarantee adherence to a specific schema \(it might output \`\{\}\` or omit required keys\). It also often degrades instruction following because the model prioritizes JSON syntax over semantic correctness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:40:59.829805+00:00— report_created — created