Skip to content

Class: DatabricksBackend

readonly host: string

Resolved workspace host, e.g. https://my-workspace.cloud.databricks.com/.

authHeaders(): Promise<Record<string, string>>

Mint auth headers for one upstream request. The SDK refreshes the underlying token when needed, so every call gets a valid Authorization header without the proxy tracking expiry.

Promise<Record<string, string>>


invocationsUrl(endpoint): string

OpenAI-compatible chat-completions invocations URL for a resolved endpoint id.

string

string


isResponsesOnly(endpoint): boolean

True when the endpoint rejects Chat Completions and needs Responses.

string

boolean


models(force?): Promise<object[]>

The workspace’s serving-endpoint catalogue, as the minimal ServingEndpointSummary the resolver needs. Loaded lazily and reused; pass force to re-list (used by /v1/models and the resolve-on-miss path).

Deliberately the uncached listing: the cached one runs through AppKit’s CacheManager, which a plain CLI has no app to initialize.

boolean = false

Promise<object[]>


resolve(model, options?): Promise<ResolvedModel>

Snap a (possibly loose) OpenAI-style model name to the best real serving endpoint. resolve.rankModelIdLive owns the policy: rank against the loaded catalogue, and on a miss re-list once and retry so a freshly deployed model resolves without a restart. An unmatched name comes back unchanged so a deliberate endpoint id is never silently rewritten.

string

boolean

Promise<ResolvedModel>


responsesUrl(endpoint): string

Databricks Responses upstream for a resolved endpoint id (/serving-endpoints/responses for OpenAI-family, /open-responses else).

string

string


static create(options?): Promise<DatabricksBackend>

Build a backend: construct a default-auth workspace client (optionally pinned to a profile / host) and resolve the workspace host once, so a bad profile fails at start-up rather than on the first proxied request.

BackendOptions = {}

Promise<DatabricksBackend>