« All posts

LiteLLM's AI pricing table's only test is jq empty

LiteLLM's widely-reused AI pricing table is validated only by jq empty — no source checks, no dates, no history. Here's what engineers should know.

Most AI cost-tracking tools follow the same pattern: count tokens locally, then multiply by a shared price table. For much of the ecosystem, that table is a single JSON file in the LiteLLM repo (~51k stars, ~2,783 models priced), reused directly or copied by tools like ccusage, tokencost, and ccost. The catch: the file's only automated check is 'jq empty' — confirming the JSON parses. There's no value validation, no cross-check against provider pricing pages, no protection against swapped input/output rates, and no date or provenance fields.

While building BudgetClaw, a spend monitor for Claude Code, the author audited this table and found concrete issues: several Grok model rows carry incorrect prices alongside a source URL that itself shows the correct, different price; only about 31% of records cite any source at all; price history is overwritten rather than preserved, so past usage gets billed at today's rates; and merged fixes can be silently reverted by later bulk syncs from an internal staging branch. A submitted correction sat open for weeks, reviewed only by automated bots, no human sign-off.

The takeaway for engineers: parsing usage logs is the easy part — the real risk is that the price multiplying those tokens often has no traceable source, no effective date, and no verification trail. The author open-sourced an alternative, provenance-first pricing index that tracks source, effective date, validation date, and confidence, preserving history instead of deleting it.