From 381557cb8f218702c86769e75f361d683515e25e Mon Sep 17 00:00:00 2001 From: kriptoburak Date: Thu, 27 Aug 2026 04:27:43 +0200 Subject: [PATCH] fix(search): preserve deployment pricing isolation --- litellm/llms/azure/passthrough/transformation.py | 2 +- litellm/router.py | 8 ++------ litellm/types/utils.py | 1 + ui/litellm-dashboard/src/lib/http/schema.d.ts | 4 ++++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/litellm/llms/azure/passthrough/transformation.py b/litellm/llms/azure/passthrough/transformation.py index 898852e645f..e3622490579 100644 --- a/litellm/llms/azure/passthrough/transformation.py +++ b/litellm/llms/azure/passthrough/transformation.py @@ -62,7 +62,7 @@ class AzurePassthroughConfig(BasePassthroughConfig): ) -> dict: return BaseAzureLLM._base_validate_azure_environment( headers=headers, - litellm_params=GenericLiteLLMParams(**{**litellm_params, "api_key": api_key}), + litellm_params=GenericLiteLLMParams.model_validate({**litellm_params, "api_key": api_key}), ) @staticmethod diff --git a/litellm/router.py b/litellm/router.py index f0ebb539bb7..99b67c831ed 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -8156,12 +8156,8 @@ class Router: if ptu_error is not None and is_ptu_cost_attribution_enabled(): raise ValueError(ptu_error) zeroed_pricing: Final = zeroed_ptu_pricing(_model_info, _litellm_params) if config_sourced else None - litellm_params: Final[LiteLLM_Params] = LiteLLM_Params( - **( - _litellm_params - if zeroed_pricing is None - else MappingProxyType({**_litellm_params, **zeroed_pricing}) - ) + litellm_params: Final[LiteLLM_Params] = LiteLLM_Params.model_validate( + _litellm_params if zeroed_pricing is None else MappingProxyType({**_litellm_params, **zeroed_pricing}) ) warn_on_provider_credential_mismatch(model_name=_model_name, litellm_params=_litellm_params) deployment = Deployment( diff --git a/litellm/types/utils.py b/litellm/types/utils.py index db4504515b4..ca2c13da7f4 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -3358,6 +3358,7 @@ class MirroredPricingParams(BaseModel): class CustomPricingLiteLLMParams(MirroredPricingParams): ## CUSTOM PRICING ## + input_cost_per_result: float | None = None input_cost_per_second: float | None = None output_cost_per_second: float | None = None output_cost_per_second_1080p: float | None = None diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts index 4ccf7b59fbc..b7b3f952b96 100644 --- a/ui/litellm-dashboard/src/lib/http/schema.d.ts +++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts @@ -27604,6 +27604,8 @@ export interface components { input_cost_per_pixel?: number | null; /** Input Cost Per Query */ input_cost_per_query?: number | null; + /** Input Cost Per Result */ + input_cost_per_result?: number | null; /** Input Cost Per Second */ input_cost_per_second?: number | null; /** Input Cost Per Token */ @@ -36828,6 +36830,8 @@ export interface components { input_cost_per_pixel?: number | null; /** Input Cost Per Query */ input_cost_per_query?: number | null; + /** Input Cost Per Result */ + input_cost_per_result?: number | null; /** Input Cost Per Second */ input_cost_per_second?: number | null; /** Input Cost Per Token */