[PR #7984] feat(opencode): Add Databricks provider support #12583

Open
opened 2026-02-16 18:17:29 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7984

State: open
Merged: No


Summary

Adds Databricks Foundation Model APIs as a new provider, enabling opencode users to connect to their Databricks workspace's pay-per-token LLM endpoints.

Fixes #7983

Changes

  • Provider implementation (provider.ts): Full Databricks provider with OpenAI-compatible endpoint support at /serving-endpoints
  • Auth guidance (auth.ts): Added Databricks to auth login flow with clear authentication instructions
  • Test cleanup (preload.ts): Clear Databricks env vars between tests
  • Unit tests (databricks.test.ts): 12 tests covering config parsing, auth precedence, URL handling, and model capabilities

Authentication Methods

Supports three auth methods (in priority order):

  1. PAT token via DATABRICKS_TOKEN or opencode auth login
  2. OAuth M2M via DATABRICKS_CLIENT_ID + DATABRICKS_CLIENT_SECRET
  3. Azure AD Service Principal via ARM_CLIENT_ID + ARM_CLIENT_SECRET + ARM_TENANT_ID

Default Models

Includes default definitions for common Foundation Model API endpoints (Claude, Llama, GPT-5, Gemini). Users can add custom model endpoints via opencode.json.

Verification

  • All 12 new tests pass: bun test packages/opencode/test/provider/databricks.test.ts
  • Tested locally with PAT authentication against a Databricks workspace
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7984 **State:** open **Merged:** No --- ## Summary Adds Databricks Foundation Model APIs as a new provider, enabling opencode users to connect to their Databricks workspace's pay-per-token LLM endpoints. Fixes #7983 ## Changes - **Provider implementation** (`provider.ts`): Full Databricks provider with OpenAI-compatible endpoint support at `/serving-endpoints` - **Auth guidance** (`auth.ts`): Added Databricks to auth login flow with clear authentication instructions - **Test cleanup** (`preload.ts`): Clear Databricks env vars between tests - **Unit tests** (`databricks.test.ts`): 12 tests covering config parsing, auth precedence, URL handling, and model capabilities ## Authentication Methods Supports three auth methods (in priority order): 1. PAT token via `DATABRICKS_TOKEN` or `opencode auth login` 2. OAuth M2M via `DATABRICKS_CLIENT_ID` + `DATABRICKS_CLIENT_SECRET` 3. Azure AD Service Principal via `ARM_CLIENT_ID` + `ARM_CLIENT_SECRET` + `ARM_TENANT_ID` ## Default Models Includes default definitions for common Foundation Model API endpoints (Claude, Llama, GPT-5, Gemini). Users can add custom model endpoints via `opencode.json`. ## Verification - All 12 new tests pass: `bun test packages/opencode/test/provider/databricks.test.ts` - Tested locally with PAT authentication against a Databricks workspace
yindo added the pull-request label 2026-02-16 18:17:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12583