From 491401c7fa699817c6cdb0ddcf4595837e244f00 Mon Sep 17 00:00:00 2001 From: pfolex Date: Sun, 25 Oct 2026 11:00:48 -0400 Subject: [PATCH] style: format modified files with ruff --- litellm/cost_calculator.py | 8 ++------ litellm/llms/openai_like/chat/transformation.py | 4 +--- tests/unit/llms/groq/test_groq_cost_calculator.py | 1 - 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 8d8e83f5edd..a17c40b3438 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -1659,9 +1659,7 @@ def completion_cost( ) requested_model: Final = model request_pricing_provider: Final = ( - custom_llm_provider - if isinstance(custom_llm_provider, str) - else _get_provider_for_cost_calc(model) + custom_llm_provider if isinstance(custom_llm_provider, str) else _get_provider_for_cost_calc(model) ) raw_candidates: Final = ( ( @@ -1686,9 +1684,7 @@ def completion_cost( for idx, (model, candidate_pricing_provider) in enumerate(potential_model_names): try: - candidate_custom_llm_provider: str | None = ( - candidate_pricing_provider or request_pricing_provider - ) + candidate_custom_llm_provider: str | None = candidate_pricing_provider or request_pricing_provider if verbose_logger.isEnabledFor(logging.DEBUG): verbose_logger.debug("selected model name for cost calculation: %s", model) diff --git a/litellm/llms/openai_like/chat/transformation.py b/litellm/llms/openai_like/chat/transformation.py index 03bdd623e60..23a47db9947 100644 --- a/litellm/llms/openai_like/chat/transformation.py +++ b/litellm/llms/openai_like/chat/transformation.py @@ -151,9 +151,7 @@ class OpenAILikeChatConfig(OpenAIGPTConfig): json_mode: bool | None = None, ) -> ModelResponse: resolved_custom_llm_provider = ( - litellm_params.get("custom_llm_provider") - if isinstance(litellm_params, dict) - else None + litellm_params.get("custom_llm_provider") if isinstance(litellm_params, dict) else None ) or ( getattr(model_response, "_hidden_params", {}).get("custom_llm_provider") if hasattr(model_response, "_hidden_params") and isinstance(getattr(model_response, "_hidden_params"), dict) diff --git a/tests/unit/llms/groq/test_groq_cost_calculator.py b/tests/unit/llms/groq/test_groq_cost_calculator.py index 0ddee5ed2ec..eab925b53c9 100644 --- a/tests/unit/llms/groq/test_groq_cost_calculator.py +++ b/tests/unit/llms/groq/test_groq_cost_calculator.py @@ -122,4 +122,3 @@ def test_groq_openai_aliased_completion_cost(): ) c_raw = litellm.completion_cost(completion_response=raw_resp, model="groq/openai/gpt-oss-120b") assert c_raw == pytest.approx(2.295e-05) -