Summary
Prices in MODELS (tokenmeter/core.py) are hard-coded list prices captured at authoring time. LLM vendors change prices regularly, so a checkout can silently produce stale cost estimates — the one thing a cost tool must not do quietly.
Proposal
- Stamp the table with a date. Add a
PRICES_AS_OF = "YYYY-MM-DD" constant and surface it in models --format json and --version, so a user can see how old the numbers are.
- Allow overrides from a file. Support
--prices prices.json (and/or a TOKENMETER_PRICES env var) that merges/overrides MODELS at startup via the existing add_model(), so teams can pin their negotiated/committed rates without editing the package.
Why
add_model() already exists for runtime overrides; this just wires a documented, file-based path to it and makes staleness visible. Keeps the built-in table as a sane default while letting cost-conscious users be authoritative about their own pricing.
Summary
Prices in
MODELS(tokenmeter/core.py) are hard-coded list prices captured at authoring time. LLM vendors change prices regularly, so a checkout can silently produce stale cost estimates — the one thing a cost tool must not do quietly.Proposal
PRICES_AS_OF = "YYYY-MM-DD"constant and surface it inmodels --format jsonand--version, so a user can see how old the numbers are.--prices prices.json(and/or aTOKENMETER_PRICESenv var) that merges/overridesMODELSat startup via the existingadd_model(), so teams can pin their negotiated/committed rates without editing the package.Why
add_model()already exists for runtime overrides; this just wires a documented, file-based path to it and makes staleness visible. Keeps the built-in table as a sane default while letting cost-conscious users be authoritative about their own pricing.