mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-17 08:18:09 +00:00
Pre-resolve CallTypes enum values into module-level frozensets to avoid repeated .value attribute access in the elif chain. Inline the hot-path _store_cost_breakdown_in_logging_obj as a direct dict literal. Remove unnecessary cast(CallTypesLiteral, call_type) call. Guard _get_additional_costs() with azure_ai-only check since no other provider implements additional costs. Line profile shows 20.5% reduction in completion_cost() total time (7.14s → 5.68s across 6,006 calls). The four targeted bottlenecks dropped from 2.82s to 0.28s combined.
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.