Skip to main content
Portkey provides a robust and secure gateway to integrate various Large Language Models (LLMs) into applications, including Databricks Model Serving endpoints. With Portkey, take advantage of features like fast AI gateway access, observability, prompt management, and more, while securely managing API keys through Model Catalog.
Provider Slug: databricks

Quick Start

Get Databricks working in 3 steps:
from portkey_ai import Portkey

# 1. Install: pip install portkey-ai
# 2. Add @databricks provider in model catalog
# 3. Use it:

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.chat.completions.create(
    model="@databricks/databricks-meta-llama-3-1-70b-instruct",
    messages=[{"role": "user", "content": "Say this is a test"}]
)

print(response.choices[0].message.content)
Tip: You can also set provider="@databricks" in Portkey() and use just model="databricks-meta-llama-3-1-70b-instruct" in the request.

Add Provider in Model Catalog

  1. Go to Model Catalog → Add Provider
  2. Select Databricks
  3. Choose existing credentials or create new by entering your Databricks personal access token and workspace name
  4. Name your provider (e.g., databricks-prod)

Configuration Parameters

ParameterDescriptionRequired
apiKeyDatabricks personal access tokenYes
databricksWorkspaceDatabricks workspace name (used to construct the URL: https://<workspace>.cloud.databricks.com)Yes
When using headers directly, pass the workspace name via the x-portkey-databricks-workspace header.

Complete Setup Guide →

See all setup options, code examples, and detailed instructions

Supported Endpoints

EndpointSupport
/chat/completionsSupported
/completionsSupported
/embeddingsSupported
/responsesSupported
/messagesSupported

Supported Features

FeatureSupport
Thinking/ReasoningSupported via thinking and reasoning_effort parameters
StreamingSupported

Embeddings

Generate embeddings using Databricks-hosted embedding models:
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.embeddings.create(
    model="@databricks/databricks-bge-large-en",
    input="The quick brown fox jumps over the lazy dog"
)

print(response.data[0].embedding[:5])

Responses API

Use the OpenAI Responses API format with Databricks models:
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.responses.create(
    model="@databricks/databricks-meta-llama-3-1-70b-instruct",
    input="Tell me a three sentence bedtime story about a unicorn."
)

print(response)

Messages API

Use the Anthropic Messages API format with Databricks models:
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

response = portkey.with_options(
    headers={"x-portkey-anthropic-version": "2023-06-01"}
).post(
    "/v1/messages",
    body={
        "model": "@databricks/databricks-meta-llama-3-1-70b-instruct",
        "max_tokens": 250,
        "messages": [{"role": "user", "content": "Say this is a test"}]
    },
    cast_to=object
)

print(response)

Supported Models

Databricks Model Serving supports a variety of foundation models and custom endpoints:
  • Meta Llama Models: databricks-meta-llama-3-1-70b-instruct, databricks-meta-llama-3-1-405b-instruct
  • DBRX: databricks-dbrx-instruct
  • Embedding Models: databricks-bge-large-en, databricks-gte-large-en
  • Custom Endpoints: Any model deployed as a Databricks serving endpoint
For the complete list of available models, refer to the Databricks Foundation Model APIs documentation.

Next Steps

For complete SDK documentation:

SDK Reference

Complete Portkey SDK documentation
Last modified on February 13, 2026