Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

style(cost): apply ruff formatting to modality guards

kerry6c9fe6560899
diff --git a/litellm/litellm_core_utils/llm_cost_calc/utils.py b/litellm/litellm_core_utils/llm_cost_calc/utils.py
index a004f46b291..88ea4b602cc 100644
--- a/litellm/litellm_core_utils/llm_cost_calc/utils.py
+++ b/litellm/litellm_core_utils/llm_cost_calc/utils.py
@@ -957,8 +957,7 @@ def _calculate_input_cost(
### AUDIO COST
if prompt_tokens_details["audio_tokens"] and not (
- prompt_tokens_details["audio_length_seconds"]
- and model_info.get("input_cost_per_audio_per_second") is not None
+ prompt_tokens_details["audio_length_seconds"] and model_info.get("input_cost_per_audio_per_second") is not None
):
audio_cost_key: Final = _get_service_tier_cost_key("input_cost_per_audio_token", service_tier)
prompt_cost += calculate_cost_component(model_info, audio_cost_key, prompt_tokens_details["audio_tokens"])
@@ -976,8 +975,7 @@ def _calculate_input_cost(
### VIDEO TOKEN COST
if prompt_tokens_details["video_tokens"] and not (
- prompt_tokens_details["video_length_seconds"]
- and model_info.get("input_cost_per_video_per_second") is not None
+ prompt_tokens_details["video_length_seconds"] and model_info.get("input_cost_per_video_per_second") is not None
):
video_token_cost_key = "input_cost_per_video_token"
if model_info.get(video_token_cost_key) is None: