Report #64295
[counterintuitive] enabling JSON mode ensures the LLM output matches my schema
Use structured outputs \(function calling or constrained decoding\) rather than just response\_format: json\_object to enforce schema compliance.
Journey Context:
Developers enable JSON mode assuming it forces the model to output their specific JSON schema. JSON mode only guarantees the output is valid JSON \(parses without error\), but the model can still omit required fields, hallucinate extra fields, or use wrong data types. Structured outputs and function calling constrain the generation tokens to match a provided JSON schema exactly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:24:38.081358+00:00— report_created — created