Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
443bee3
fix(databricks): translate reasoning_effort to thinking for Gemini 2.…
cohml Jun 23, 2026
d7b793c
fix(databricks,base_llm): narrow gemini-2.5 match and guard thinking-…
cohml Jun 23, 2026
2bff743
refactor(databricks): drive anthropic-thinking routing via JSON flag.
cohml Jul 10, 2026
f5e1786
Merge PR #32786 (databricks gemini reasoning_effort) into internal_st…
milan-berri Jul 20, 2026
7a7fea2
style: apply ruff format to databricks transformation
milan-berri Jul 20, 2026
e969eac
test: register supports_anthropic_thinking_payload in model prices js…
milan-berri Jul 20, 2026
d9c9dcf
fix(databricks): guard adaptive thinking to Claude and scope test fix…
milan-berri Jul 20, 2026
4b157ed
Merge litellm_internal_staging into devin/1784568628-databricks-gemin…
milan-berri Aug 23, 2026
38ffa67
fix(types): qualify supports_anthropic_thinking_payload with ReadOnly
milan-berri Aug 23, 2026
896b6dc
ci: regenerate model prices schema and raise unit shard job timeouts
milan-berri Aug 23, 2026
8a5aeed
fix(databricks): add supports_anthropic_thinking_payload to claude op…
milan-berri Aug 23, 2026
58254e8
Merge litellm_internal_staging into devin/1784568628-databricks-gemin…
milan-berri Aug 28, 2026
10a0da7
Merge litellm_internal_staging into devin/1784568628-databricks-gemin…
mateo-berri Sep 12, 2026
c7b607c
fix(databricks): keep the Claude fallback when gating the anthropic t…
mateo-berri Sep 12, 2026
a7ebc12
ci: drop the removed rust bridge test path from the ocr job
mateo-berri Sep 12, 2026
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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Hardcoded capability check

The literal Claude check hardcodes model capability detection. Repository rules require model-specific capabilities to come from model metadata before merging

Rule Used: What: Do not hardcode model-specific flags in the codebase. Instead, put them in model_prices_and_context_window.json and then read them in via get_model_info Why: Prevents need for users to upgrade litellm each time a new model supports this featu... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name check predates this PR and covers user-named Databricks Claude endpoints that have no cost-map entry. Removing it would 400 requests that work today

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right — removing the name check would be a backwards-incompatible change for user-named Databricks Claude endpoints that are absent from the cost map. The metadata flag is the preferred path for mapped models, while "claude" in normalized is a necessary compatibility fallback for unmapped endpoints. I withdraw this comment.

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