AI & Machine Learning
Bug Report
LLM returns invalid JSON 2% of the time: code fences, truncation and structured outputs
About 2% of our LLM extraction calls crashed on JSON.parse: markdown code fences, answers cut off at max_tokens and chatty text after the object. We classified every failure, switched to schema-constrained output, checked stop reasons and added validation with one repair attempt.