mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
[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:
parent
92bbf0a0d3
commit
e8519b3109
1 changed files with 3 additions and 1 deletions
|
|
@ -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"]))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue