[Fix] Databricks: add provider prefix to response model name

DatabricksConfig.transform_response() was setting model_response.model
to the raw API value (e.g. "dbrx-instruct-071224") without the
"databricks/" prefix. This differs from OpenAILikeChatConfig which
adds custom_llm_provider + "/" + model at lines 119-122.

Previously hidden because databricks-sdk was not in the old poetry
deps, so the test was always skipped with "Databricks SDK not
installed". The uv migration's --all-extras pulls it in transitively.
This commit is contained in:
Yuneng Jiang 2026-04-11 12:16:31 -07:00
parent 92bbf0a0d3
commit e8519b3109
No known key found for this signature in database

View file

@ -615,7 +615,9 @@ class DatabricksConfig(DatabricksBase, OpenAILikeChatConfig, AnthropicConfig):
headers=response_headers,
)
model_response.model = completion_response["model"]
_custom_llm_provider = litellm_params.get("custom_llm_provider") or "databricks"
_response_model = completion_response.get("model") or ""
model_response.model = f"{_custom_llm_provider}/{_response_model}"
model_response.id = completion_response["id"]
model_response.created = completion_response["created"]
setattr(model_response, "usage", Usage(**completion_response["usage"]))