From 973520255bc881ae38eaeeb9c724eb5b705fad9d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 28 Jun 2025 15:13:54 -0700 Subject: [PATCH] fix for o-series param checks --- .../azure/chat/o_series_transformation.py | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/litellm/llms/azure/chat/o_series_transformation.py b/litellm/llms/azure/chat/o_series_transformation.py index 767f2d46df..778ec5f6de 100644 --- a/litellm/llms/azure/chat/o_series_transformation.py +++ b/litellm/llms/azure/chat/o_series_transformation.py @@ -38,13 +38,38 @@ class AzureOpenAIO1Config(OpenAIOSeriesConfig): "top_logprobs", ] - o_series_only_param = [] - if supports_reasoning(model): - o_series_only_param.append("reasoning_effort") + o_series_only_param = self._get_o_series_only_params(model) + all_openai_params.extend(o_series_only_param) return [ param for param in all_openai_params if param not in non_supported_params ] + + def _get_o_series_only_params(self, model: str) -> list: + """ + Helper function to get the o-series only params for the model + + - reasoning_effort + """ + o_series_only_param = [] + + + ######################################################### + # Case 1: If the model is recognized and in litellm model cost map + # then check if it supports reasoning + ######################################################### + if model in litellm.model_list_set: + if supports_reasoning(model): + o_series_only_param.append("reasoning_effort") + ######################################################### + # Case 2: If the model is not recognized, then we assume it supports reasoning + # This is critical because several users tend to use custom deployment names + # for azure o-series models. + ######################################################### + else: + o_series_only_param.append("reasoning_effort") + + return o_series_only_param def should_fake_stream( self,