Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion litellm/llms/databricks/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ def get_supported_openai_params(self, model: str | None = None) -> list:
"thinking",
]

@staticmethod
def _uses_anthropic_thinking_param(model: str) -> bool:
from litellm.utils import supports_anthropic_thinking_payload

normalized: Final = model.lower().replace(".", "-")
return "claude" in normalized or supports_anthropic_thinking_payload(
model=normalized, custom_llm_provider="databricks"
)

def convert_anthropic_tool_to_databricks_tool(self, tool: AllAnthropicToolsValues | None) -> DatabricksTool | None:
if tool is None:
return None
Expand Down Expand Up @@ -377,7 +386,7 @@ def map_openai_params(
"response_format", None
) # unsupported for claude models - if json_schema -> convert to tool call

if "reasoning_effort" in non_default_params and "claude" in model:
if "reasoning_effort" in non_default_params and self._uses_anthropic_thinking_param(model):
reasoning_effort_value: Final = non_default_params.get("reasoning_effort")
mapped_thinking: Final = AnthropicConfig._map_reasoning_effort(
reasoning_effort=reasoning_effort_value,
Expand Down
18 changes: 18 additions & 0 deletions litellm/model_prices_and_context_window_backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -17597,6 +17597,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-fable-5": {
Expand All @@ -17622,6 +17623,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": false,
Expand Down Expand Up @@ -17651,6 +17653,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
Expand All @@ -17676,6 +17679,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
Expand All @@ -17699,6 +17703,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17722,6 +17727,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17745,6 +17751,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
Expand All @@ -17770,6 +17777,7 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
Expand All @@ -17795,6 +17803,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand Down Expand Up @@ -17822,6 +17831,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand Down Expand Up @@ -17849,6 +17859,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand All @@ -17875,6 +17886,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-sonnet-4-1": {
Expand All @@ -17897,6 +17909,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-sonnet-4-5": {
Expand All @@ -17919,6 +17932,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17943,6 +17957,7 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17969,6 +17984,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand Down Expand Up @@ -18047,6 +18063,7 @@
"output_dbu_cost_per_token": 3.5714e-05,
"source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving",
"supports_function_calling": true,
"supports_anthropic_thinking_payload": true,
"supports_prompt_caching": true,
"supports_tool_choice": true
},
Expand All @@ -18067,6 +18084,7 @@
"output_dbu_cost_per_token": 0.000142857,
"source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving",
"supports_function_calling": true,
"supports_anthropic_thinking_payload": true,
"supports_prompt_caching": true,
"supports_tool_choice": true
},
Expand Down
1 change: 1 addition & 0 deletions litellm/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class ProviderSpecificModelInfo(TypedDict, total=False):
default_reasoning_effort: ReadOnly[Literal["none", "minimal", "low", "medium", "high", "xhigh"] | None]
supports_output_config: bool | None
supports_image_size: bool | None
supports_anthropic_thinking_payload: ReadOnly[bool | None]
supported_audio_formats: ReadOnly[Sequence[Literal["mp3", "wav"]] | None]
vertex_ai_audio_api: ReadOnly[Literal["lyria_predict", "lyria_interactions"] | None]
bedrock_output_config_effort_ceiling: Literal["low", "medium", "high", "max", "xhigh"] | None
Expand Down
7 changes: 7 additions & 0 deletions litellm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2850,6 +2850,12 @@ def supports_reasoning(model: str, custom_llm_provider: str | None = None) -> bo
return _supports_factory(model=model, custom_llm_provider=custom_llm_provider, key="supports_reasoning")


def supports_anthropic_thinking_payload(model: str, custom_llm_provider: str | None = None) -> bool:
return _supports_factory(
model=model, custom_llm_provider=custom_llm_provider, key="supports_anthropic_thinking_payload"
)


def supports_none_reasoning_effort(model: str, custom_llm_provider: str | None = None) -> bool:
"""
Check if the given model accepts reasoning effort "none" and return a boolean value.
Expand Down Expand Up @@ -5996,6 +6002,7 @@ def _get_model_info_helper(
thinking_always_on=_model_info.get("thinking_always_on", None),
supports_tool_search=_model_info.get("supports_tool_search", None),
supports_mid_conversation_system=_model_info.get("supports_mid_conversation_system", None),
supports_anthropic_thinking_payload=_model_info.get("supports_anthropic_thinking_payload", None),
supports_none_reasoning_effort=_model_info.get("supports_none_reasoning_effort", None),
supports_minimal_reasoning_effort=_model_info.get("supports_minimal_reasoning_effort", None),
supports_low_reasoning_effort=_model_info.get("supports_low_reasoning_effort", None),
Expand Down
18 changes: 18 additions & 0 deletions model_prices_and_context_window.json
Original file line number Diff line number Diff line change
Expand Up @@ -17597,6 +17597,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-fable-5": {
Expand All @@ -17622,6 +17623,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": false,
Expand Down Expand Up @@ -17651,6 +17653,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true,
Expand All @@ -17676,6 +17679,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
Expand All @@ -17699,6 +17703,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17722,6 +17727,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17745,6 +17751,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"supports_output_config": true,
"prompt_cache_min_tokens": 4096
Expand All @@ -17770,6 +17777,7 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 4096
},
Expand All @@ -17795,6 +17803,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand Down Expand Up @@ -17822,6 +17831,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand Down Expand Up @@ -17849,6 +17859,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand All @@ -17875,6 +17886,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-sonnet-4-1": {
Expand All @@ -17897,6 +17909,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-sonnet-4-5": {
Expand All @@ -17919,6 +17932,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17943,6 +17957,7 @@
"supports_legacy_thinking": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_tool_choice": true,
"prompt_cache_min_tokens": 1024
},
Expand All @@ -17969,6 +17984,7 @@
"supports_mid_conversation_system": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_anthropic_thinking_payload": true,
"supports_sampling_params": false,
"supports_tool_choice": true,
"supports_vision": true
Expand Down Expand Up @@ -18047,6 +18063,7 @@
"output_dbu_cost_per_token": 3.5714e-05,
"source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving",
"supports_function_calling": true,
"supports_anthropic_thinking_payload": true,
"supports_prompt_caching": true,
"supports_tool_choice": true
},
Expand All @@ -18067,6 +18084,7 @@
"output_dbu_cost_per_token": 0.000142857,
"source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving",
"supports_function_calling": true,
"supports_anthropic_thinking_payload": true,
"supports_prompt_caching": true,
"supports_tool_choice": true
},
Expand Down
3 changes: 3 additions & 0 deletions model_prices_and_context_window.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@
"supports_adaptive_thinking": {
"type": "boolean"
},
"supports_anthropic_thinking_payload": {
"type": "boolean"
},
"supports_assistant_prefill": {
"type": "boolean"
},
Expand Down
Loading
Loading