Every team shipping LLM features builds a per-call log, a daily aggregate and a dashboard, at different times and from different assumptions. Then someone asks "what did last month cost" and you get two numbers four percent apart, with nobody able to say which is right.

In a recent development, this is an audit of that situation: 2.3 million model calls over three months, one line-item table, one rollup table, and a disagreement of ¥2,055.24. The interesting part is not the gap's size but that it decomposes into a deletion and a freeze, while everything else reconciles to the cent. (Related: “Determined” woman completes 7 marathons in a year whil...)

ai_call_logs holds one row per attempt with tokens, cost_yuan and a status. ai_cost_rollup_daily holds one row per day, model family and hour with calls, miss_tok, hit_tok, out_tok, recorded_cost and refreshed_at. (Related: Obsessed fan breaks into YouTuber’s home demanding marr...)

Two grains, one money column each — and the aggregate carries no id, no reference to the rows it summarised. You can compute both totals, but you cannot ask the rollup which calls it saw. That omission is why drift survives.

Totals hide compensating errors, so let the line-item table define the window.

Industry observers note that september and October match to the cent on both calls and money. November is short by ¥2.52 and 44 calls because the month is still being written. August is off by ¥2,057.48, and that plus the ¥2.52 of in-flight November equals the grand-total gap: what is wrong with August?

Industry observers note that three facts stack up. The line-item table starts at id 429,016, not 1, so roughly 429,000 rows no longer exist. The first surviving call is dated 2026-08-24, while the rollup starts 2026-08-08 — sixteen days earlier. Those orphan days hold 140,438 calls and ¥2,015.45 with no rows behind them.

That is 98.0% of the gap, and neither table is broken. A retention job prunes detail; a separate job keeps aggregates; nothing forces the two policies to agree. The rollup is now the only witness to two weeks of spend, and it cannot be itemised or re-derived. On 2026-08-24 itself the rollup says 3,405 calls and ¥104.88 while 1,632 rows and ¥62.85 survive — the cut ran into that day too.

According to recent reports, the useful test is not the average discrepancy but whether it is zero on days nobody touched. Re-running both sides per day, 2026-09-20 gives 17,871 rows and ¥563.52 on both, 2026-10-09 gives 13,703 and ¥229.67, 2026-11-10 gives 8,470 and ¥131.99. Identical to the second decimal, including the 10-09/10-10 boundary where the model mix changed. The rollup job is correct — correct at the moment it runs, which is the second defect.

Recent findings suggest that every August and September bucket was last touched on 2026-10-09 and never again. That is the normal life cycle of a backfill: it runs once and is trusted forever — which makes "the rollup is the source of truth" a claim with an expiry date. A row that arrives late — a retried call, a time-skewed writer, a restored backup — lands in the line-item table and never reaches a bucket frozen five weeks ago.

It has been revealed that the fix is not "refresh more often"; full-history refreshes get more expensive every month and eventually stop. Store source_max_id per bucket instead, and reconciliation becomes a question the schema can answer: is there any line item newer than the newest one this bucket counted?

dedup_skip is a cache decision written into the same log as a call: 50.06% of rows, zero tokens, zero cost. Every dashboard deriving "calls this month" from count(*) overstates volume 2.20× — not because the number is wrong, but because "call" was never defined.

Industry observers note that the three failure statuses total 102,618 rows — 4.47% of real attempts — and carry 30.9 million prompt tokens billed to nobody, since the writer only sets cost_yuan on success. That is about ¥65 of invisible spend at the ledger's blended rate, but the structural cost is worse: failures cluster in the same scenes as successes, so a reliability report built on count(*) never sees them.

Recent findings suggest that of 1,044,063 successful calls, 61,609 have NULL cost and another 8,654 are explicitly zero — 98.2 million tokens the finance column never sees. Divide by count(*) and you average in 70,263 free calls, understating by about 6%; divide by count(cost) and you exclude a sixteenth of the traffic.

cache_hit is worse, because it is named like a flag and typed integer while it holds cached tokens. Among successful calls, 18,800 rows have cache_hit > 0 — 1.80% of rows — but those tokens are 2.38% of all prompt tokens (439,479,898 of 18,445,990,674). One column, two true percentages, 25% apart: a caching strategy judged on the first looks weaker than it is.

Unit cost spans ¥0.0066 to ¥0.1296 across scenes, a 19.6× range driven by context length (3,790 to 63,999 tokens per call). The global mean is ¥0.0419 against a median of ¥0.0165, so "average cost per call" is a statement about traffic mix, not about the system: change the batch schedule and the headline moves while nothing else does. The honest unit is cost per delivered artifact, with the scene breakdown beside it.

Of 1,044,059 successful calls in the window, 564,221 carry a match_id and 479,838 do not — 45.96% of traffic holding ¥9,668.76, or 22.1% of the money. Some is legitimate, but the column cannot distinguish "not about a match" from "forgot to propagate the id". Without a taxonomy of fixture-scoped scenes, cost per prediction divides by a denominator that mixes product work with overhead.

The same hazard applies to the model name. GROUP BY model_name splits one model into 689,209 and 32,804 calls, because it is written both deepseek-v4.1-flash and DeepSeek-V4.1-flash; the -1017 variant has the same pair. A budget alert on the larger spelling misses 4.5% of that model's traffic.

The one artifact worth keeping is the assertion, not the report: run it daily, exit non-zero, and the gap never accumulates for three months.

Recent findings suggest that three details make it work where a dashboard does not. It compares per day, so a cancellation inside a month cannot hide a gap. It tolerates one cent rather than one percent: a 1% tolerance would have passed a ¥18,891 month wrong by ¥180. And it counts a missing bucket as drift rather than zero — absence looks identical to "no traffic" until you assert on it.

The gap was ¥2,055.24 — 4.7% of three months of spend — invisible not because the data was wrong but because nothing compared the two tables. Both were correct. One had simply been edited by a retention policy the other never heard about.

Industry observers note that if you take one thing: an aggregate without a back-reference is a rumour with a decimal point. The moment you can ask a rollup which rows it saw, cost reconciliation stops being archaeology and becomes a one-line assertion.

In a recent development, analytics and research content. Not betting advice. 18+.

→ Read original article