Class DatabricksClient

All Implemented Interfaces:
com.tnsai.llm.LLMClient

public class DatabricksClient extends AbstractOpenAICompatibleClient
Databricks Mosaic AI Model Serving LLM client.

Databricks hosts foundation models (DBRX, Llama, Mixtral, plus customer-fine-tuned models) behind workspace-scoped serving endpoints. The Foundation Model API exposes an OpenAI-compatible chat-completions surface — same wire format as GroqClient / XAIGrokClient / YiClient.

Workspace-scoped URL. Unlike the multi-tenant cloud providers (xAI, Yi, Hunyuan), Databricks endpoints live on a per-customer hostname: https://{workspace}.cloud.databricks.com/serving-endpoints. There is no universally-correct default — every caller must supply their workspace URL via the DATABRICKS_BASE_URL env var or the constructor's baseUrl argument.

Supported models (built-in catalog at time of writing):

  • databricks-meta-llama-3-3-70b-instruct — frontier Llama 3.3
  • databricks-meta-llama-3-1-405b-instruct — largest Llama 3.1
  • databricks-dbrx-instruct — Databricks's own DBRX
  • databricks-mixtral-8x7b-instruct — Mixtral MoE

Customers can also point this client at their own fine-tuned endpoints by passing the endpoint name as the model argument — Databricks resolves it relative to the workspace.

Configuration via environment variables:

  • DATABRICKS_API_KEY — Required. Either a Personal Access Token (PAT) or a service-principal OAuth token. v1 supports both as opaque bearer tokens; native service-principal OAuth flows can land as a follow-up.
  • DATABRICKS_BASE_URL — Required. The full workspace-scoped URL up to and including /serving-endpoints.
See Also:
  • Constructor Details

    • DatabricksClient

      public DatabricksClient(String model)
    • DatabricksClient

      public DatabricksClient(String model, float temperature)
    • DatabricksClient

      public DatabricksClient(String model, float temperature, Integer maxTokens)
    • DatabricksClient

      public DatabricksClient(String model, float temperature, Float topP, Integer maxTokens)
    • DatabricksClient

      public DatabricksClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey)
    • DatabricksClient

      public DatabricksClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey)