LiteLLM with Databricks model serving

Connect Databricks serving endpoints to a self-hosted LiteLLM gateway using the databricks/ prefix, OAuth service principals for production and per-team virtual keys over shared credentials.

On this page

How LiteLLM with Databricks model serving keeps callers off shared credentials

Teams often want Databricks-hosted models available through one governed gateway, not by handing every application or notebook a shared workspace token. LiteLLM calls Databricks models with the databricks/ prefix, and for production the recommended pattern is OAuth machine-to-machine authentication with service principal credentials. Personal access tokens are the option LiteLLM documents for development. In this setup, the gateway holds the Databricks credential and callers only receive LiteLLM virtual keys, so no caller ever sees the Databricks secret.

DeployOpen configures the LiteLLM gateway inside your own infrastructure: the model entries that map databricks/ routes to your serving endpoints, the service principal secret stored in your secret manager rather than in a config file, and the virtual keys, budgets and model restrictions that sit in front of it. The Databricks side, including how the service principal is created, which endpoints it can query and how OAuth credentials are issued, is documented by LiteLLM's Databricks provider page. Confirm the exact field names and any version-specific behavior against that page and your LiteLLM release before you write configuration.

Before the build starts, decide which Databricks workspace and endpoints each team may reach, and who owns the service principal. A service principal with access to every endpoint defeats the purpose of per-team keys, so grant it only the serving endpoints the gateway must call. Ask your Databricks administrators to confirm the workspace host, the endpoint names and the permissions the service principal needs, and plan a rotation procedure for its secret so that a single credential change does not break every caller at once.

What you need in place before connecting Databricks to LiteLLM

Five things must be settled before the first databricks/ route answers a request: the LiteLLM deployment, the Databricks workspace and endpoints, the service principal, the network path and the master key. Each card below covers one of them and the check to run before you move on.

LiteLLM deployment on PostgreSQL

Plan the gateway around PostgreSQL as the primary database, because virtual keys, budgets and spend history all depend on it. Keep the database in infrastructure you control and confirm that the gateway can reach it before you add any Databricks settings. Recheck the supported release line before you install, and treat v1.105.1, listed as the latest release on the LiteLLM releases page, as the starting point to verify rather than a fixed pin for your environment.

LiteLLM releases

Redis once you run multiple proxy instances

A single proxy instance can run without Redis, but once more than one instance runs, the production guide requires Redis 7.0 or newer for shared rate limits, router state and cache. Without it, a Databricks endpoint's TPM and RPM limits will be enforced separately on each instance, so a team can exceed its intended ceiling. Decide early whether you will run more than one replica and provision Redis accordingly.

Databricks workspace and serving endpoints

Confirm the workspace host, the model serving endpoints you intend to expose and the model or foundation model each endpoint serves. LiteLLM calls these endpoints through the databricks/ prefix, so the endpoint names must match what the workspace shows. Record which endpoints are approved for each team, since the gateway can restrict keys to specific models only after the route names are settled.

LiteLLM Databricks docs

Service principal with client ID and secret

For production, create a service principal in the workspace and generate an OAuth client ID and secret for machine-to-machine authentication. Give it only the serving endpoint access the gateway needs. Confirm the exact Databricks permissions for this service principal in your own workspace, because role names and entitlement settings vary by workspace configuration. Personal access tokens belong to individuals, so keep them out of the production path.

Network path to the workspace host

Map the route from the gateway's subnet to the Databricks workspace host over HTTPS, including any egress proxy, firewall rule or private connectivity your network team uses. Test it from the same runtime that will run the proxy, not from a workstation. Many failed first calls come from blocked egress rather than from bad credentials, so verify reachability before you debug authentication.

Secret storage for the master key

Set LITELLM_MASTER_KEY before first start, store it in a secret manager and make sure it begins with sk- as the production guide requires. The Databricks client secret belongs in the same managed store, not in the configuration file. Confirm who can read these values, how they rotate, and how a rotation reaches every proxy instance without a manual edit.

LiteLLM production guide

How to configure the Databricks route in LiteLLM step by step

This sequence takes a team from a Databricks service principal with access to the right serving endpoints to a verified LiteLLM route, a model-restricted virtual key and a logged test call. It also separates the personal access token path that is reserved for development.

  1. Confirm endpoint names and workspace access

    Before anything is configured, the platform owner lists the Databricks serving endpoints the gateway should expose and records the workspace host URL for each. Confirm the exact endpoint names in the Databricks workspace, because the LiteLLM model entry must match them. Check that the endpoints are in a state that accepts queries. This step is done when you have a written list of endpoint names, their workspace host and the owner who approved each one.

  2. Create a service principal for production

    A platform administrator creates a dedicated service principal in the Databricks account for the gateway, separate from any named user. Grant it query permission only on the serving endpoints from the approved list, and do not grant workspace admin or unrelated data permissions. Generate an OAuth secret for machine-to-machine access. This step is done when the service principal appears in the access list of each target endpoint and no other endpoints.

  3. Store service principal credentials in the secret manager

    Place the client ID and OAuth client secret in your secret manager, not in the proxy configuration file or a source repository. Give the gateway runtime identity read access to only those secret paths. Record the secret's rotation owner and the date it was issued. This step is done when the gateway can resolve both values from the secret manager in a non-production environment and the values are absent from configuration files.

  4. Add the databricks/ model entry to the proxy configuration

    In the LiteLLM proxy configuration, add a model entry whose provider prefix is databricks/ followed by the serving endpoint name, and give it a public model name that callers will use. Reference the credentials through environment variables or secret manager references rather than literal values. Set the base URL to your workspace host as described in LiteLLM's Databricks documentation, and confirm the exact authentication keys in that page for your LiteLLM version. This step is done when the configuration validates and the proxy starts without errors.

  5. Verify the route with a test completion

    Send a single chat completion request through the proxy to the public model name, using a master or administrative key that is only used for setup. Check that the response comes back from the Databricks endpoint and that the proxy log shows the request was routed to the databricks/ model, not a different provider. If the call fails, check the service principal's endpoint permission and the base URL first. This step is done when a test completion returns successfully and the log entry names the expected model.

  6. Create a team virtual key restricted to the model

    Create a virtual key for the test team with its allowed models limited to the public name of the Databricks route, and set a budget and rate limit appropriate to the team's approved use. Keep the shared Databricks credentials out of the team's hands, since callers only ever receive the gateway key. Then send a request with that key and confirm a request using any other model name is rejected. This step is done when the key succeeds on the permitted model and is refused on others.

  7. Check spend and log entries for the team key

    Repeat a test request with the team key and open the spend and request log for that key. Confirm the entry records the key or team identifier, the model name and token counts, and that spend is attributed to the team rather than to a shared credential. Confirm that prompt and response logging matches the retention rules your organization has approved. This step is done when the log entry shows the team as the caller and the Databricks model as the target.

  8. Use a personal access token for development only

    For local development on a single engineer's machine, a personal access token can be used as the Databricks credential in the same model entry structure, kept in a developer's local secret store. LiteLLM's Databricks documentation recommends personal access tokens for development and service principal OAuth for production, so keep the development entry in a separate configuration file or environment that never reaches the production proxy. Do not add personal access tokens to shared configuration or to the production secret manager path. This step is done when the development entry is confirmed absent from the production configuration and its owner is named.

Why OAuth service principals beat personal access tokens in production

For production, LiteLLM's Databricks guidance points to OAuth machine-to-machine authentication with service principal credentials, and personal access tokens are meant for development. The reason is ownership. A personal access token belongs to a named employee, so every call the gateway makes is attributed to that person in Databricks audit records, and the token stops working when that person's account is disabled. A service principal is a non-human identity owned by the platform team, so the gateway's traffic stays attributed to the gateway even when staff change roles or leave.

Rotation and offboarding are where the difference shows up in practice. A personal access token typically has to be replaced when its owner leaves, which means finding every LiteLLM configuration that embeds it and updating them under time pressure. With OAuth M2M, the client secret is issued to the service principal and can be rotated on the platform team's schedule and stored in a secret manager that the gateway reads at runtime. Confirm in your Databricks workspace how client secrets are issued, how long they remain valid and how many can be active at once, since these details govern your rotation runbook and vary with the account setup.

Be clear about the layer each control sits on. Virtual keys in LiteLLM give each team or application its own gateway credential with budgets, RPM and TPM limits and model restrictions, so the Databricks credential behind the gateway can remain shared without giving every consumer direct access to the workspace. Per-team spend and access are governed at the virtual key, while Databricks audit logs show the service principal as the caller. Keep that split documented, because an auditor will ask which system proves who used a model and which proves what they were allowed to do.

How LiteLLM teams, keys and models map to Databricks identities and endpoints

This table pairs each LiteLLM object with its Databricks counterpart and names who owns it and what to confirm in your environment. Read it before writing the proxy config, so that credentials, consumer identities and limits land in the right system. The main takeaway is that Databricks authenticates the gateway, while LiteLLM decides which internal consumer can spend what.

ItemDatabricks sideLiteLLM sideOwner and what to confirm
Upstream credentialOAuth machine-to-machine service principal used by the gateway for production callsProvider credentials stored in the proxy config or secret manager, referenced by the databricks/ model entryPlatform team owns the service principal. Confirm its workspace, client ID handling and rotation schedule in your environment.
Development credentialPersonal access token tied to one user, intended for development useSeparate model entry for dev traffic, kept out of production configDeveloper owns the token. Confirm that no personal token reaches the shared production gateway.
Internal consumerNo direct object. Databricks sees only the gateway's service principalVirtual key issued to a team or user, with allowed models and identity recorded in LiteLLMGateway admins own keys. Confirm how team membership is kept current and who approves new keys.
Model nameServing endpoint name in the workspacePublic model name in the proxy config that maps to the databricks/ endpointPlatform team owns the mapping. Confirm each endpoint name matches the workspace exactly before publishing the alias.
Access to endpointsService principal permissions on each serving endpointKey-level model restriction limiting which aliases a virtual key can callBoth owners must agree. Confirm that Databricks grants and LiteLLM key restrictions match, since either one alone can be incomplete.
BudgetsNot enforced by Databricks for gateway consumersPer-key, per-user and per-team budgets enforced by LiteLLM against its own spend recordsGateway admins own budgets. Confirm how LiteLLM spend is reconciled with Databricks billing for chargeback.
TPM and RPM limitsWorkspace and endpoint capacity, not per-consumer quotasPer-key and per-team TPM and RPM limits enforced at the gatewayGateway admins own limits. Confirm that endpoint capacity is sized for the sum of all team limits.
Audit and request logsServing endpoint logs and workspace audit records for the service principalRequest logs keyed to virtual key and team, held in the gateway databaseSecurity team owns retention. Confirm which system is the record for each consumer's usage.

Security controls for the Databricks credential path

The Databricks route puts a workspace credential behind every model call, so the gateway becomes the place where that credential is most exposed. The controls below cover where secrets live, how access is scoped, how environments stay apart, and how credentials are rotated and retired. Confirm each one against your own Databricks workspace and secret manager before go-live.

Store secrets in a secret manager

Keep the service principal client secret and LITELLM_MASTER_KEY out of config.yaml and out of container images. The master key must start with sk-, and the production guide recommends holding it in a secret manager. Inject both at runtime through your orchestrator. LiteLLM Enterprise lists integrations with AWS, Azure, Google, HashiCorp Vault and CyberArk, but confirm that the integration matches the secret manager your organization already runs before you design around it.

Production guide

Scope the service principal to serving endpoints

Grant the service principal only the permissions needed to query the specific serving endpoints the gateway will call. Avoid workspace-admin roles, broad catalog access and rights to create or modify endpoints. Review the grants in Databricks, not only in LiteLLM, because the gateway cannot restrict what Databricks itself allows. Ask your Databricks administrator to document the grant set so security reviewers can check it.

Restrict virtual keys to named models

Create virtual keys that can call only the Databricks-backed model names they need. A key that can reach every model multiplies the damage from a leaked key. Model restriction sits in LiteLLM, while the service principal sets what Databricks will accept, so use both layers. Test that a key for one team is refused on a model that belongs to another team.

Separate development and production credentials

Use different service principals, different LiteLLM instances or projects, and different secrets for development and production. Development should not hold production client secrets, and developers should not receive production virtual keys. This keeps a test script, a notebook or a laptop from reaching production endpoints and keeps spend and logs attributable to the right environment.

Keep personal tokens out of production

Personal access tokens tie model calls to one user and stop working when that person leaves or their account changes. LiteLLM's documentation recommends OAuth machine-to-machine credentials for production and personal access tokens for development. Add a configuration check that rejects personal token settings in production manifests, and record which configuration is deployed so the review can confirm it.

Rotate and revoke on a schedule

Set a rotation schedule for the service principal secret and the master key, and document who performs the rotation and how the gateway picks up the new value without downtime. Also plan revocation: disabling a virtual key, deleting a service principal secret and confirming that the old credential no longer succeeds. Test both steps in a non-production environment before relying on them during an incident.

Per-team keys over shared Databricks credentials

The gateway should hold one governed Databricks credential, and every team should call it with its own LiteLLM virtual key. The Databricks service principal or token stays inside LiteLLM's configuration, so application teams never see it. Each virtual key is a separate identity in the gateway with its own spend record, limits and allowed models. Virtual keys require a PostgreSQL database, which is also where per-key, per-user and per-team budgets are stored and enforced.

Per-key controls are what make Databricks access reviewable. For each team you can set a budget, TPM and RPM limits, and a list of models the key may call, so a key meant for one Databricks serving endpoint cannot quietly reach others. Budgets can also attach to a user or a team, which helps when several keys belong to one group. Confirm in the virtual keys documentation how each budget scope interacts with the others in your LiteLLM version before you design the hierarchy, because the answer determines whose spend hits which limit.

Temporary budget increases let you raise one key's ceiling for a defined period without editing the shared Databricks configuration or issuing a new credential. Use this for a planned project push, and record who approved the increase and when it should expire. Before rollout, test a key that has reached its budget and a key that is blocked from a model, and confirm the calls fail as your policy expects. Spend shown per key then becomes the basis for reviewing each team's Databricks usage against your own records.

What usually breaks and what buyers ask before hiring help

What drives the cost of connecting LiteLLM to Databricks model serving?

The cost depends mostly on how many endpoints, teams and environments the gateway must serve, and on how much of the surrounding platform your team has to build. The main components are the Databricks side (service principal setup, endpoint permissions, workspace networking), the LiteLLM side (key layout, team budgets, model routing, logging) and the testing that proves each team's key reaches only the endpoints it should. Most of this is one-time work, while ongoing costs come from credential rotation, endpoint changes and upgrades. Ask any partner for a quote built from a written scope that lists endpoints, environments, teams and the logging destination. No public price list is available from DeployOpen, so the quote follows from that scope.

How long does it take to connect one Databricks serving endpoint through LiteLLM?

Duration depends on the workspace, not only on LiteLLM. Connecting one endpoint is quick when the workspace is reachable, the endpoint name is known, and a service principal with the right permissions already exists. Delays usually come from access approvals, network paths from the gateway to the workspace, and agreeing on how keys map to teams. No duration figure is supplied for this work, so ask for a timeline in the written scope and confirm the approval steps with your Databricks administrator before the work starts.

What does the client team need to provide for this work?

The work needs a named owner on each side and access that the implementation can use. Expect to provide:

  • A Databricks workspace administrator who can create service principals and grant endpoint permissions
  • A list of serving endpoints, with the environment each one belongs to
  • Network routes from the LiteLLM host to the workspace, and any proxy or firewall rules
  • A PostgreSQL database and Redis, plus a secret manager for LITELLM_MASTER_KEY
  • Decisions on teams, budgets and the logging destination

Confirm these items with your platform and security teams before the scope is signed.

Can an internal team connect LiteLLM to Databricks without outside help?

Yes, a capable internal team can connect one endpoint using the LiteLLM Databricks documentation, which describes the databricks/ prefix and the recommended authentication paths. The harder part is the surrounding governance: separating production and development credentials, giving each team its own key, setting budgets, and proving access is limited correctly. Teams that have run LiteLLM in production and manage Databricks identities usually find that setup is manageable. Teams without those skills often benefit from a fixed-scope engagement that covers the design, the build and a documented handover.

Why does a call fail with an unknown model or wrong route after adding a Databricks endpoint?

The most common cause is a missing or wrong databricks/ prefix in the model name, so LiteLLM sends the request to the wrong provider or does not recognize the endpoint. Check that the model entry in the LiteLLM configuration uses the prefix followed by the exact serving endpoint name from Databricks, with no extra spaces or case changes. Then send a single test request with a restricted key before routing team traffic. The LiteLLM Databricks documentation describes the expected format.

What happens when a Databricks service principal secret expires?

Calls that rely on an expired OAuth client secret fail with authentication errors, and every team routed through that credential stops working at once. To prevent this, record the secret's expiry date, store it in your secret manager, and schedule rotation before it lapses. Rotate the secret in Databricks, update the stored value, and confirm a test call from each environment. Ask the implementer to document this runbook and to add an alert on authentication failures.

Why does LiteLLM return permission errors even though the endpoint exists?

The service principal or personal access token usually lacks permission to query that specific serving endpoint, even when the endpoint is visible in the workspace. Grant the principal query access to each endpoint it needs in Databricks, and avoid broad workspace-wide grants. Then test each team's key against its allowed models to confirm the grant and the LiteLLM model restriction both work. If a call still fails, collect the endpoint name, principal name and error text before escalating.

Why can the LiteLLM gateway not reach the Databricks workspace?

The gateway host often cannot reach the workspace URL because of outbound firewall rules, a missing proxy setting, private networking that is not routed, or DNS that resolves to the wrong address. Test reachability from the same host and network namespace the gateway runs in, not from a laptop. If the workspace uses private connectivity, confirm the route with your network team before debugging LiteLLM itself. Include the workspace hostname and the exact error in any support request.

How a request flows from a team key through LiteLLM to Databricks

A calling application presents a team virtual key to the LiteLLM proxy, which checks budgets, rate limits and model restrictions against state held in PostgreSQL and Redis. The proxy then forwards the request on the databricks/ route using a service principal credential held in the client's own network. The trust boundary sits between that network and the Databricks workspace, so check which credential crosses it and which team keys never do.

Team keys stay inside the client network; only the service principal credential crosses into the workspace.

Common Databricks routing failures, their causes and fixes

This table pairs each common failure in a LiteLLM to Databricks route with its likely cause and the first fix to try. Read it by matching the error you see at the gateway to a row, then checking the cause before changing credentials or routing. Before escalating any row, collect the proxy logs and the exact Databricks endpoint name.

FailureLikely causeFix
Model not found or endpoint not resolvedThe model name lacks the databricks/ prefix, or the part after the prefix does not match the serving endpoint name exactlyConfirm the endpoint name in the Databricks serving console, then set the model to databricks/ followed by that exact name and redeploy the proxy config
403 or permission denied from DatabricksThe service principal or user has no query permission on the serving endpoint, or the endpoint sits in a workspace the identity cannot reachGrant the service principal query access on the specific endpoint, then retest with a direct call using the same credentials before changing LiteLLM
401 or authentication failure after a period of workingThe OAuth client secret or personal access token has expired, was rotated in Databricks without updating the secret store, or the proxy has not reloaded the new valueCheck the secret's expiry in its source, update the value in your secret manager, and restart or reload the proxy so it reads the new credential
Personal token working in development but failing or flagged in productionA personal access token tied to one person is in use on a production route, so it breaks when that person leaves or their access changesReplace it with OAuth machine-to-machine credentials for a service principal, which LiteLLM recommends for production, and keep personal tokens for development only
Connection refused, timeout or TLS errorThe gateway cannot reach the workspace URL because of an egress rule, proxy setting, DNS entry, or a private connectivity path that is not configuredConfirm the workspace base URL from the gateway host with a plain HTTPS request, then open the egress path or fix DNS and certificate trust for that host
Key rejected for a model it should reachThe LiteLLM virtual key is restricted to a list of models that does not include the databricks/ model name, or the team's model group uses a different aliasAdd the exact model name to the key or team allowlist, and check that the caller requests the alias defined in the proxy config
429 or budget error reported as a provider faultThe virtual key, user or team has reached its budget or an RPM or TPM limit, so LiteLLM blocks the call before it reaches DatabricksCheck spend and limit status for the key in LiteLLM, then raise the budget or limit or use a temporary increase, and confirm the error text originates from the gateway
Shared Databricks credential exhausted or throttled for all teamsEvery team routes through one Databricks identity, so one team's volume consumes limits meant for everyoneIssue per-team virtual keys with their own budgets and limits over the shared Databricks identity, and review usage by key in the logs

How a DeployOpen engagement scopes the Databricks connection

Most DeployOpen engagements are fixed-scope: the scope, deliverables and timeline are agreed in writing before any work starts, and the quote follows from that written scope. For a Databricks connection, the scope is set by a short list of inputs that you can gather before the first conversation. The first is the number of serving endpoints the gateway must reach, since each endpoint needs a databricks/ model entry, a tested request, and a documented owner. The second is the number of teams that will receive keys, because per-team virtual keys, budgets and model restrictions are configured and reviewed for each team rather than once for the whole gateway.

The third input is your identity setup. Production calls are expected to use OAuth machine-to-machine authentication with a service principal, so the engagement depends on whether service principals already exist in your Databricks workspace, who can create and rotate their secrets, and where those secrets will be stored. Your secret manager integration, and whether your organization already has an identity provider the LiteLLM admin UI can use, both affect the effort. The fourth input is whether development credentials must also be configured. Personal access tokens are the development path, so a scope that covers both production and development needs separate credential handling, separate keys and a clear rule that developers never receive production service principal secrets.

Ask each bidder to state which of these inputs their quote assumes and what would change the price if a value differs at kickoff. Confirm with your Databricks administrator which workspaces, endpoints and service principal permissions are in place, because gaps there are the most common reason a fixed scope is revised. Scope also needs to say who is responsible for testing against your real endpoints, how retests are handled, and what documentation and handover you receive. Those answers, written down before work starts, are what keeps a quote comparable across partners.

How DeployOpen works on this

DeployOpen plans, implements, hardens, documents and supports self-hosted LiteLLM gateways inside your own infrastructure. For Databricks, that means agreeing in writing which serving endpoints, workspace identities and teams the gateway will cover before any configuration starts.

How we scope

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • We list the Databricks workspaces, serving endpoints and identities the gateway will call, and which teams get keys.
  • We confirm where credentials are stored, who owns the service principal, and which environments are development versus production.

How we build

  • We configure the databricks/ routes, OAuth machine-to-machine service principal credentials for production and tested personal access tokens for development only.
  • We set up per-team virtual keys with budgets, rate limits and model restrictions so no team shares the Databricks credential directly.
  • We test each endpoint through the gateway, including failure cases, and document the routing, retry and cooldown settings used.

How we hand over

  • You receive configuration as code, a record of the service principal and secret locations, and the key and budget ownership map.
  • We deliver runbooks covering credential rotation, adding a new serving endpoint and checking spend against Databricks billing.
  • Handover includes a walkthrough with your platform, security and data teams so they can review the setup against your own controls.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, agreed separately from the original scope.
  • Upgrades to a supported LiteLLM release line are planned with database migration steps and tested against your Databricks routes first.
  • Retainers can include periodic retesting of keys, permissions and routes after changes to your Databricks workspace or identity setup.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.