From fb31006cd847d921c9487c326c560dfd537e0f8d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 26 Mar 2025 07:12:25 -0700 Subject: [PATCH] select_model_for_request_transformation --- litellm/main.py | 6 ++++-- litellm/utils.py | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index af0dc1f5b6..8ebf66fd06 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -1097,8 +1097,10 @@ def completion( # type: ignore # noqa: PLR0915 logit_bias=logit_bias, user=user, # params to identify the model - model=model, - base_model=base_model, + model=LitellmCoreRequestUtils.select_model_for_request_transformation( + model=model, + base_model=base_model, + ), custom_llm_provider=custom_llm_provider, response_format=response_format, seed=seed, diff --git a/litellm/utils.py b/litellm/utils.py index bcf22e902c..45fa9fa1fd 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2847,18 +2847,12 @@ def get_optional_params( # noqa: PLR0915 additional_drop_params=None, messages: Optional[List[AllMessageValues]] = None, thinking: Optional[AnthropicThinkingParam] = None, - base_model: Optional[str] = None, **kwargs, ): # retrieve all parameters passed to the function passed_params = locals().copy() special_params = passed_params.pop("kwargs") - # Use `base_model` for paramter mapping if passed in by user - model = LitellmCoreRequestUtils.select_model_for_request_transformation( - model=model, - base_model=base_model, - ) for k, v in special_params.items(): if k.startswith("aws_") and ( custom_llm_provider != "bedrock" and custom_llm_provider != "sagemaker"