Class: DatabricksBackend
Properties
Section titled “Properties”
readonlyhost:string
Resolved workspace host, e.g. https://my-workspace.cloud.databricks.com/.
Methods
Section titled “Methods”authHeaders()
Section titled “authHeaders()”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.
Returns
Section titled “Returns”Promise<Record<string, string>>
invocationsUrl()
Section titled “invocationsUrl()”invocationsUrl(
endpoint):string
OpenAI-compatible chat-completions invocations URL for a resolved endpoint id.
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Returns
Section titled “Returns”string
isResponsesOnly()
Section titled “isResponsesOnly()”isResponsesOnly(
endpoint):boolean
True when the endpoint rejects Chat Completions and needs Responses.
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Returns
Section titled “Returns”boolean
models()
Section titled “models()”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.
Parameters
Section titled “Parameters”force?
Section titled “force?”boolean = false
Returns
Section titled “Returns”Promise<object[]>
resolve()
Section titled “resolve()”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.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”requiresTools?
Section titled “requiresTools?”boolean
Returns
Section titled “Returns”Promise<ResolvedModel>
responsesUrl()
Section titled “responsesUrl()”responsesUrl(
endpoint):string
Databricks Responses upstream for a resolved endpoint id
(/serving-endpoints/responses for OpenAI-family, /open-responses else).
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Returns
Section titled “Returns”string
create()
Section titled “create()”
staticcreate(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.
Parameters
Section titled “Parameters”options?
Section titled “options?”BackendOptions = {}
Returns
Section titled “Returns”Promise<DatabricksBackend>