diff --git a/litellm/utils.py b/litellm/utils.py index 6d64368f8..b0cca2cb3 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -4551,6 +4551,21 @@ def get_optional_params( optional_params["temperature"] = temperature if max_tokens is not None: optional_params["max_tokens"] = max_tokens + elif "mistral" in model: + supported_params = ["max_tokens", "temperature", "stop", "top_p", "stream"] + _check_valid_arg(supported_params=supported_params) + # mistral params on bedrock + # \"max_tokens_to_sample\":300,\"temperature\":0.5,\"top_p\":1,\"stop_sequences\":[\"\\\\n\\\\nHuman:\"]}" + if max_tokens is not None: + optional_params["max_tokens"] = max_tokens + if temperature is not None: + optional_params["temperature"] = temperature + if top_p is not None: + optional_params["top_p"] = top_p + if stop is not None: + optional_params["stop"] = stop + if stream is not None: + optional_params["stream"] = stream elif custom_llm_provider == "aleph_alpha": supported_params = [ "max_tokens", @@ -9657,4 +9672,4 @@ def _get_base_model_from_metadata(model_call_details=None): base_model = model_info.get("base_model", None) if base_model is not None: return base_model - return None + return None \ No newline at end of file