Caches model pricing data and exposes it to other plugins for cost awareness.
- Loads pricing catalogs and keeps them fresh via the update task
- Publishes a
pricingservice in the plugin registry for dependents - Tracks cache health, age, and failures for health reporting
PricingConfigtoggles enablement, refresh cadence, and startup behavior- Auto-update schedules can force refresh on launch or run periodically
- Generate defaults with
python3 scripts/generate_config_from_model.py \ --format toml --plugin pricing --config-class PricingConfig
[plugins.pricing]
# enabled = true
# cache_dir = "~/.cache/ccproxy"
# cache_ttl_hours = 24
# source_url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
# download_timeout = 30
# auto_update = true
# memory_cache_ttl = 300
# update_interval_hours = 6.0
# force_refresh_on_startup = false
# fallback_to_embedded = false
# pricing_provider = "all"service.py: pricing lookup and cache managementtasks.py: asynchronous cache refresh taskplugin.py: runtime lifecycle and service registration