Report #2292
[research] Which provider gives the most reliable JSON / schema-constrained output?
Prefer native structured-output/constrained-decoding APIs over plain JSON mode: OpenAI response\_format json\_schema, Anthropic tool use, Gemini response\_json\_schema, or local vLLM/SGLang with Outlines/XGrammar. Always validate server-side and add a re-ask loop; never trust the model on null vs undefined.
Journey Context:
Plain JSON mode still produces syntax errors and schema drift, especially with smaller models and complex nested schemas. Native constrained decoding guarantees syntactic validity and dramatically improves schema adherence. Function-calling/tool-use mode is generally stricter than free-form JSON mode. Claude models show strong few-shot gains on structured tasks; GPT-4o-mini is less steerable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T10:51:14.685084+00:00— report_created — created