Report #94358
[counterintuitive] Does enabling JSON mode ensure the LLM output matches my specific schema
Use structured outputs / function calling / schema enforcement \(like \`response\_format\` with a specific JSON schema\) rather than just basic JSON mode, and always validate the output on the server side.
Journey Context:
Developers enable 'JSON mode' thinking it forces the model to output their exact Pydantic schema. JSON mode only guarantees the output is syntactically valid JSON \(i.e., it parses without errors\), but it does not guarantee it matches your required keys, types, or structure. The model might output \`\{'response': '...'\}\` instead of \`\{'data': \[...\]\}\`. Structured outputs / grammar-constrained generation are required for schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:58:00.043823+00:00— report_created — created