mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-29 01:03:17 +00:00
completion_cost now takes the whole token result from a Rust receipt for every provider, not only the four /v1/messages providers: the prompt and completion sides, the stored token-type breakdown and billed rates, the built-in tool fees Python still prices, the Azure AI Model Router fee, discount and margin. Each provider branch looks its row up as main did and the candidate loop passes the row main's breakdown read beside it, so the stored breakdown matches main even where the two rows differ. The core gains BreakdownRow, tool_fees, RouterFee (on the prompt, or as the "Azure Model Router Flat Cost" part) and TokenRules::GenericTier, quotes the breakdown and savings at the call's tier and endpoint, and folds xAI reasoning into the completion itself, so the Python xAI fold, the Azure AI fee math, _get_additional_costs and the calculate_additional_costs hooks are deleted. Replicate's per-second fallback prices through the bridge. A realtime or Live session's tokens and its response.done turns now price in the same Rust call as its other parts, and the Python candidate order and summing for them is deleted. tokens_parity.json gains the raw prompt and total token counts the adapter now sends, so the xAI case that needed the Python fold runs in Rust. Main's expected outputs are unchanged. |
||
|---|---|---|
| .. | ||
| agents | ||
| anthropic | ||
| chat | ||
| claude | ||
| embed | ||
| image_edit | ||
| image_generation | ||
| passthrough | ||
| rerank | ||
| responses | ||
| vector_stores | ||
| __init__.py | ||
| test_azure_ai_agents_handler.py | ||
| test_azure_ai_cost_calculator.py | ||
| test_azure_ai_entra_auth.py | ||
| test_azure_ai_foundry_catalog_model_metadata.py | ||
| test_azure_ai_fw_models_metadata.py | ||
| test_azure_ai_kimi_k26_metadata.py | ||