Skip to main content

Overview

The Databricks provider connects to models hosted on Databricks AI Gateway, including Claude models and Meta Llama models. It supports both token-based and OAuth authentication. Source: crates/goose/src/providers/databricks.rs

Configuration

Environment Variables

string
required
Your Databricks workspace URL (e.g., https://your-workspace.cloud.databricks.com)
string
Personal access token (optional if using OAuth)
number
default:"3"
Maximum number of retry attempts
number
default:"1000"
Initial retry interval in milliseconds
number
default:"2.0"
Multiplier for exponential backoff
number
default:"60000"
Maximum retry interval in milliseconds

Setup

Authentication

The provider supports two authentication methods:

1. Token Authentication

Use a personal access token:

2. OAuth Authentication

If no token is provided, the provider automatically uses OAuth device code flow:
The OAuth flow:
  1. Displays a device code and URL
  2. Opens your browser to authenticate
  3. Caches the OAuth token for future use
  4. Automatically refreshes expired tokens
Default OAuth configuration:
  • Client ID: databricks-cli
  • Redirect URL: http://localhost
  • Scopes: all-apis, offline_access

Supported Models

Claude Models

  • databricks-claude-sonnet-4 (default) - Claude Sonnet on Databricks
  • databricks-claude-sonnet-4-5 - Latest Sonnet
  • databricks-claude-haiku-4-5 (fast model) - Fast Claude model

Meta Llama Models

  • databricks-meta-llama-3-3-70b-instruct - Llama 3.3 70B
  • databricks-meta-llama-3-1-405b-instruct - Llama 3.1 405B
Documentation: https://docs.databricks.com/en/generative-ai/external-models/

Usage

Basic Usage

Custom Configuration

Using Fast Models

Advanced Features

Embeddings

The Databricks provider supports text embeddings:
Embedding endpoint: serving-endpoints/text-embedding-3-small/invocations

Retry Configuration

Configure retry behavior:
Fast models use a different retry strategy:
  • Max retries: 0 (fail fast)
  • No exponential backoff

Model Endpoints

The provider automatically routes to the correct endpoint:

Implementation Details

Provider Metadata

Authentication Flow

The provider dynamically gets the auth token:

API Format

Requests use OpenAI-compatible format but without the model field:
Note: The model is specified in the endpoint URL, not the request body.

Retry Strategy

Fetching Available Models

Example response:

Error Handling

Programmatic Configuration

OAuth Token Management

Tokens are cached in the system keyring:
  • Service: databricks_oauth
  • Account: {host}_access_token and {host}_refresh_token
Tokens are automatically refreshed when expired.

See Also