Dev.to
6/29/2026

The LLM Should Never Do the Math
Short summary
Language models confidently emit wrong financial numbers when they compute them. Databricks Cost Leak Hunter demonstrates the architectural fix: SQL joins are the single source of truth for every dollar figure, while the LLM only analyzes and explains. This pattern prevents the failure mode of clean, well-formatted, completely wrong reports.
- •LLMs hallucinate financial figures—never let them do the math
- •Databricks Cost Leak Hunter separates concerns: SQL handles pricing, LLM handles analysis
- •Defines a single priced CTE reused across queries to eliminate calculation variance
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



