MCPcopy Create free account
hub / github.com/ccusage/ccusage / embedded_models_dev_pricing

Function embedded_models_dev_pricing

rust/crates/ccusage/src/pricing.rs:1183–1191  ·  view source on GitHub ↗

Pricing built from the models.dev snapshot embedded at build time. Unlike the network source this is always available, so it lets offline runs price models that LiteLLM and the built-in table do not cover (for example newly released Anthropic models). It is kept separate from the primary table so it never participates in that table's fuzzy alias matching.

()

Source from the content-addressed store, hash-verified

1181/// Anthropic models). It is kept separate from the primary table so it never
1182/// participates in that table's fuzzy alias matching.
1183fn embedded_models_dev_pricing() -> &'static PricingMap {
1184 static EMBEDDED_MODELS_DEV_PRICING: OnceLock<PricingMap> = OnceLock::new();
1185 EMBEDDED_MODELS_DEV_PRICING.get_or_init(|| {
1186 let mut map = PricingMap::default();
1187 map.load_models_dev_json_missing(BUILD_TIME_MODELS_DEV_JSON)
1188 .expect("embedded models-dev-pricing.json must parse");
1189 map
1190 })
1191}
1192
1193fn load_models_dev_pricing<F>(fetch_json: F) -> Option<PricingMap>
1194where

Callers 3

findMethod · 0.85
context_limitMethod · 0.85

Calls 1