mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
cost::calculate prices token meters over the typed Prices every row lowers into, with one line per meter and the borrowed rate named in fallback_from. generic_cost_per_token prices through Prices.price and as_main_cost, per-call custom pricing is an overlay that never writes the shared row, and a directly written bad price is unpriced with one log line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
litellm-cost
This crate holds the price data model that litellm-model-catalog lowers each catalog entry into, plus the usage, call context and priced outcome types. calculate prices a call's token usage over a row's Prices and Adjustments, one Line per meter with usage, and names the meter whose rate a line borrowed in fallback_from. Character, second and per-unit meters land in later PRs and are reported as missing until then. UnitPrice is USD per unit and Usd is an amount, and only the operations that make sense between them exist, so a price is never added to an amount. Prices::band picks the prompt band the way Python's _get_token_base_cost does