Report #52949
[cost\_intel] Using verbose JSON mode without schema constraints causing 40-60% token bloat
Enforce strict JSON schemas \(or use constrained decoding libraries like Outlines/Guidance\) to eliminate whitespace and repetitive key names. For extraction of 1000-row datasets, this reduces output tokens by 50%, cutting costs from $12 to $5 per batch by preventing 'pretty printing' and explanatory prose.
Journey Context:
Default JSON mode outputs human-readable formatting \(indentation, newlines\) and often includes explanatory text before the JSON block \('Here is the result:'\). Unconstrained models also hallucinate verbose key descriptions. Strict schema constraints force the model to emit only the syntactic minimum. This is critical for structured data pipelines where a 1000-item array with whitespace is 30k tokens vs 12k compressed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:22:19.152525+00:00— report_created — created