Skip to content

Pricing table can go stale silently: add PRICES_AS_OF date + --prices override file #7

Description

@cognis-digital

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

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions