Skip to content

Pricing comes only from live external sources: no hardcoded prices or price caches in the codebase #16228

Description

@mrveiss

Goal

The owner's requirement (10 Sep 2026): the LLM pricing table is updated dynamically on every install, from update sources that are refreshed regularly. The codebase contains no hardcoded prices and no price caches. Users on monthly subscription plans are supported as well as users billed per token.

#1961 (closed) asked for the same thing in March. Its suggestion to fetch from provider APIs was never implemented: the sources that exist return a hardcoded table.

Measured on base 9771c1006, 10 Sep 2026.

  • Every provider source (autobot-backend/llm_shared/pricing/{anthropic,openai,google,deepseek,vertexai}_source.py) is a BaselinePricingSource. Its fetch() returns a hardcoded _BASELINE list and stamps each entry updated_at=now.
  • The daily pricing-refresh-daily beat task therefore re-copies the same numbers into Redis every night and reports them as fresh. The Redis-based staleness check in llm_cost_tracker._check_pricing_staleness then reads that manufactured date, so it can never fire. The only honest signal left is PRICING_VERSION = "2026-03-22", 172 days old, which only writes a log warning.
  • The prices are already wrong: the code prices claude-haiku-4-5 at $0.80 input / $4.00 output per million tokens, while LiteLLM's price map lists $1.00 / $5.00.
  • Nothing refreshes pricing at install or update time.
  • A sweep of 5,145 non-test source files found numeric price literals in 10 files. Eight hold real prices: autobot_shared/model_pricing.py (per-1M table :109, per-1K table :191, and the MODEL_COSTS_PER_1M_TOKENS alias :210), the five provider sources, the inline fallback {"input": 1.0, "output": 5.0} at autobot-backend/api/analytics_llm_patterns.py:246, and the realtime-audio prices at autobot-backend/services/voice_realtime_telemetry.py:36-47. The other two (service_restart.py, journal_fetch.py) match only on timeout values.

Decisions (owner, 10 Sep 2026)

  • Sources: LiteLLM's community price map (model_prices_and_context_window.json, 3,886 entries, priced per token) is the primary source. OpenRouter's public models API (/api/v1/models, 437 models, priced per token) is an independent cross-check. Disagreements are flagged, never silently resolved.
  • Unknown price: usage is recorded with price unknown, shown as unpriced in the GUI and in reports, and raises a visible warning. It is never counted as $0.

Tasks

Relates to #1961, #15912, #15021, #15030.

Activity

  1. added this to the v0.9.0 milestone on Sep 12, 2026
  2. modified the milestones: v0.9.0, v0.10.0 on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions