mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
completion_cost prices a Claude token call on Anthropic, Bedrock, Vertex AI and Azure AI through NativeModelCostMap.price and stores the receipt's breakdown, rates and adjustments on the logging object as before. Any call Rust leaves to Python (another provider or call kind, built-in tools other than a reported web search, a provider-stated cost, custom per-call prices or a deferred candidate list) keeps the Python candidate loop for that call. The Anthropic speed and geo uplifts and the Bedrock geo uplift now come from the Rust core, and the Python bodies are gone. Discount and margin resolve in Rust for every kind through NativeModelCostMap.adjust, replacing _apply_cost_discount, _apply_cost_margin and resolve_cost_discount. The legacy budget hold calls bound, and the auth checks read token rate keys and positive token rates from rates. Tests that patched deleted internals now drive the public functions, and new cases pin the adapter to main's totals and breakdowns for the captured Claude fixtures. |
||
|---|---|---|
| .. | ||
| native_budgets_golden | ||
| __init__.py | ||
| native_budgets_replica.py | ||
| test_background_interaction_settlement.py | ||
| test_baseline_accounting.py | ||
| test_budget_reservation.py | ||
| test_budget_reservation_redis_failure.py | ||
| test_budget_reservation_rust.py | ||
| test_carried_budget_state.py | ||
| test_cloudzero_endpoints.py | ||
| test_committed_spend.py | ||
| test_compression_savings.py | ||
| test_cost_finalization.py | ||
| test_customer_budget_alerts.py | ||
| test_customer_cost_margin.py | ||
| test_customer_window_accounting.py | ||
| test_customer_window_accounting_rust.py | ||
| test_input_tokens.py | ||
| test_key_metadata_recovery.py | ||
| test_native_budget_checks.py | ||
| test_native_budgets.py | ||
| test_native_budgets_proxy_path.py | ||
| test_performance_alerts.py | ||
| test_ptu_feature_flag.py | ||
| test_ptu_flat_cost_rollup.py | ||
| test_savings.py | ||
| test_search_api_logging.py | ||
| test_session_page.py | ||
| test_session_spend_total.py | ||
| test_spend_capture_rate.py | ||
| test_spend_counter_batch.py | ||
| test_spend_event.py | ||
| test_spend_event_producer.py | ||
| test_spend_log_error_logger.py | ||
| test_spend_management_endpoints.py | ||
| test_spend_query_optimization.py | ||
| test_spend_tracking_utils.py | ||
| test_subscription_billing_periods.py | ||