diff --git a/litellm/llms/oci/chat/transformation.py b/litellm/llms/oci/chat/transformation.py index ddd9836c96a..10baa1019bf 100644 --- a/litellm/llms/oci/chat/transformation.py +++ b/litellm/llms/oci/chat/transformation.py @@ -132,6 +132,7 @@ class OCIChatConfig(BaseConfig): "logit_bias": "logitBias", "n": "numGenerations", "presence_penalty": "presencePenalty", + "reasoning_effort": "reasoningEffort", "seed": "seed", "stop": "stop", "tool_choice": "toolChoice", @@ -150,14 +151,17 @@ class OCIChatConfig(BaseConfig): "response_format": "responseFormat", } - # Cohere param map differs from GENERIC in three ways: + # Cohere param map differs from GENERIC in four ways: # - tool_choice is unsupported # - stop sequences key is "stopSequences" not "stop" # - n (numGenerations) is GENERIC-only + # - reasoning_effort is GENERIC-only (CohereChatRequest v1 has no + # reasoningEffort field; Cohere reasoning models like + # command-a-reasoning use COHEREV2 which is a separate request type) self.openai_to_oci_cohere_param_map = { k: ("stopSequences" if k == "stop" else v) for k, v in self.openai_to_oci_generic_param_map.items() - if k not in ("tool_choice", "max_retries", "n") + if k not in ("tool_choice", "max_retries", "n", "reasoning_effort") } def get_supported_openai_params(self, model: str) -> List[str]: diff --git a/litellm/types/llms/oci.py b/litellm/types/llms/oci.py index ee5228ab123..22ca3fa90cf 100644 --- a/litellm/types/llms/oci.py +++ b/litellm/types/llms/oci.py @@ -103,6 +103,10 @@ class OCIChatRequestPayload(BaseModel): seed: Optional[int] = None frequencyPenalty: Optional[float] = None presencePenalty: Optional[float] = None + # Reasoning-token budget knob (OCI: NONE/MINIMAL/LOW/MEDIUM/HIGH). + # Honoured by GPT-5 family, Gemini 2.5, Grok reasoning variants, + # Cohere Command-A-Reasoning. Ignored by non-reasoning models. + reasoningEffort: Optional[str] = None responseFormat: Optional[Dict[str, Any]] = None toolChoice: Optional[Union[str, Dict[str, Any]]] = None logitBias: Optional[Dict[str, Any]] = None