Skip to content

feat: Use LiteLLM pricing database for auto-updating model costs #83

Description

@sagarsrc

Scope

backend

What do you want?

Integrate LiteLLM's community-maintained pricing database instead of hardcoded prices.

Source:

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

Implementation:

  • Fetch pricing from LiteLLM URL
  • Cache locally (e.g., ~/.quickcall/cache/pricing.json) for 24 hours
  • Fall back to hardcoded DEFAULT_PRICING if fetch fails
  • Parse and map model names to our pricing structure

Comparison:

Aspect Current (Hardcoded) With LiteLLM
Pricing source Hardcoded in code Fetched from LiteLLM
When Anthropic changes prices Requires code update & deploy Auto-updates within 24h
New model released Manual addition needed Already in database
Maintenance burden On us On LiteLLM community

Why?

  • Never out of date when Anthropic changes prices
  • Covers all models automatically (100+ LLM APIs)
  • Zero maintenance - community-maintained
  • Reliable fallback for offline use with hardcoded defaults

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status
Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions