Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Address Greptile review: fix SDK auth fallback and remove unused imports

Tomu Hirata020d7699305b
diff --git a/litellm/llms/databricks/responses/transformation.py b/litellm/llms/databricks/responses/transformation.py
index fed2a81d5a1..0d9f433bfd2 100644
--- a/litellm/llms/databricks/responses/transformation.py
+++ b/litellm/llms/databricks/responses/transformation.py
@@ -10,8 +10,6 @@ Reference: https://docs.databricks.com/aws/en/machine-learning/foundation-model-
import os
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
-import litellm
-from litellm._logging import verbose_logger
from litellm.llms.databricks.common_utils import DatabricksBase
from litellm.llms.openai.responses.transformation import OpenAIResponsesAPIConfig
from litellm.types.llms.openai import ResponseInputParam
@@ -50,12 +48,15 @@ class DatabricksResponsesAPIConfig(DatabricksBase, OpenAIResponsesAPIConfig):
api_key = litellm_params.api_key or os.getenv("DATABRICKS_API_KEY")
api_base = litellm_params.api_base or os.getenv("DATABRICKS_API_BASE")
- # Reuse Databricks auth logic (OAuth M2M, PAT, SDK fallback)
- api_base, headers = self.databricks_validate_environment(
+ # Reuse Databricks auth logic (OAuth M2M, PAT, SDK fallback).
+ # custom_endpoint=False allows SDK auth fallback; the appended
+ # /chat/completions suffix is harmless since we discard api_base
+ # here and build the URL separately in get_complete_url().
+ _, headers = self.databricks_validate_environment(
api_key=api_key,
api_base=api_base,
- endpoint_type="chat_completions", # reuse existing type, URL is built separately
- custom_endpoint=True, # prevent appending /chat/completions to api_base
+ endpoint_type="chat_completions",
+ custom_endpoint=False,
headers=headers,
)
diff --git a/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py b/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py
index d73f7cb5bc2..b4a368be81f 100644
--- a/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py
+++ b/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py
@@ -1,4 +1,3 @@
-import json
import os
import sys