opencode
opencode copied to clipboard
feat(opencode): Add Databricks provider support
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):
- PAT token via
DATABRICKS_TOKENoropencode auth login - OAuth M2M via
DATABRICKS_CLIENT_ID+DATABRICKS_CLIENT_SECRET - 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