Report #83280
[cost\_intel] Using JSON text completion mode instead of constrained structured output for schema adherence
Use native tool\_use/structured output modes instead of JSON text prompting; they reduce schema violation rates by 80% versus JSON mode, eliminating retry logic costs that often exceed token savings
Journey Context:
Developers force JSON via prompting to 'save tokens' but incur hidden costs from malformed JSON, retries, and validation failures. Native tool use constrains the output grammar at the sampling level \(constrained decoding\), guaranteeing valid JSON. The cost delta is negligible compared to engineer time fixing parse errors. Critical distinction: structured output guarantees schema adherence; JSON mode merely suggests it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:22:25.647863+00:00— report_created — created