t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Model rate table has no bundled fallback, so a fresh offline install has no cost data

Open wezzcoetzee opened this issue 3 months ago • 1 comments

What happens

UsageService seeds its rate table as an empty Map (apps/server/src/usage/UsageService.ts:131) and its only source is a single hardcoded URL (UsageService.ts:56):

https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json

There is no bundled fallback and no env override. If that fetch fails on a machine with no cached usage-model-rates.json, every bucket is priced at zero and the usage page reports no cost at all.

When it bites

Any install that is offline, behind a proxy or TLS inspection, or simply unlucky during a GitHub outage. It is most likely on a fresh install, since there is no cached snapshot to fall back to — the first run is the one most likely to be silently wrong.

The decision

Shipping a bundled LiteLLM snapshot (~3000 models) would make cost work out of the box, at the cost of repo weight and owning a refresh cadence. That tradeoff belongs to whoever owns this feature — happy to implement it whichever way it is called, or for this to be closed if the current behaviour is intended.

Separately: packaging the desktop app with Node's --use-system-ca would remove the corporate-proxy variant of this class of failure entirely. Possibly worth its own discussion.

Related

#5948 covers the fact that this failure is currently invisible on the usage page, fixed by #5947. This issue is about the fragility itself, which neither of those changes.

wezzcoetzee avatar Aug 10 '26 04:08 wezzcoetzee

Not worth implementing

wezzcoetzee avatar Aug 10 '26 04:08 wezzcoetzee