diff --git a/litellm/proxy/management_endpoints/auto_router_endpoints.py b/litellm/proxy/management_endpoints/auto_router_endpoints.py index c440aa51358..61ad998e4b3 100644 --- a/litellm/proxy/management_endpoints/auto_router_endpoints.py +++ b/litellm/proxy/management_endpoints/auto_router_endpoints.py @@ -389,7 +389,9 @@ def _deployment_pricing(raw_deployment: object) -> AutoSetupDeploymentPricing | litellm_params: Final = _MODEL_REFERENCE_MAPPING.validate_python( deployment.get("litellm_params", _EMPTY_MODEL_REFERENCE) ) - if any(litellm_params.get(field) not in (None, False, 0, 0.0, {}) for field in _AUTO_SETUP_UNSUPPORTED_PRICING_FIELDS): + if any( + litellm_params.get(field) not in (None, False, 0, 0.0, {}) for field in _AUTO_SETUP_UNSUPPORTED_PRICING_FIELDS + ): return None published: Mapping[str, object] | None = None published_raw: Mapping[str, object] | None = None @@ -407,8 +409,7 @@ def _deployment_pricing(raw_deployment: object) -> AutoSetupDeploymentPricing | published_raw = _MODEL_REFERENCE_MAPPING.validate_python(raw) break if published_raw is not None and any( - published_raw.get(field) not in (None, False, 0, 0.0, {}) - for field in _AUTO_SETUP_UNSUPPORTED_PRICING_FIELDS + published_raw.get(field) not in (None, False, 0, 0.0, {}) for field in _AUTO_SETUP_UNSUPPORTED_PRICING_FIELDS ): return None values: dict[str, object] = {} diff --git a/litellm/router_strategy/complexity_router/auto_setup.py b/litellm/router_strategy/complexity_router/auto_setup.py index c42a0fb1ce8..9e41a4d25d8 100644 --- a/litellm/router_strategy/complexity_router/auto_setup.py +++ b/litellm/router_strategy/complexity_router/auto_setup.py @@ -226,10 +226,7 @@ def _resolve_groups( {model.benchmark_model_id: model for model in _matching_snapshot_models(snapshot, deployment.model_refs)} for deployment in deployments ] - if any( - len({model.identity.family_id for model in matches.values()}) > 1 - for matches in match_sets - ): + if any(len({model.identity.family_id for model in matches.values()}) > 1 for matches in match_sets): excluded.append(AutoSetupInventoryExclusion(model_name, "mixed_model_group")) continue if any(not matches for matches in match_sets): @@ -354,9 +351,7 @@ def _cost_rank(profiles: Sequence[_AvailableProfile]) -> tuple[_AvailableProfile profiles, key=lambda profile: ( profile.cost_per_completed_task_usd is None, - profile.cost_per_completed_task_usd - if profile.cost_per_completed_task_usd is not None - else math.inf, + profile.cost_per_completed_task_usd if profile.cost_per_completed_task_usd is not None else math.inf, -profile.quality.quality_lower_bound, profile.model_name, ),