An unofficial Databricks-flavored fork of anomalyco/opencode. Adds first-class support for Databricks Model Serving (Foundation Model APIs, custom endpoints, CLI auth) to the open-source opencode CLI coding agent.
This project is not affiliated with, endorsed by, or officially supported by the opencode project or SST. It is a personal fork maintained at github.com/dgokeeffe/opencode-databricks for use by Databricks field engineering.
The upstream opencode CLI supports many model providers (Anthropic, OpenAI, Bedrock, Vertex, etc.) but does not currently ship a first-class Databricks provider. Databricks workspaces can serve Claude, GPT-5, Gemini, Llama, Qwen, and other models through Foundation Model APIs, plus custom fine-tuned endpoints via Model Serving.
This fork adds:
- Native Databricks provider (
databricks/*) with automatic serving-endpoint discovery against your workspace - Auth via Databricks CLI profiles (
~/.databrickscfg), PAT, OAuth, env vars, Azure MSI/CLI, GCP — the full Databricks SDK auth chain - Smart routing per model family — Claude models route through the native Anthropic compatibility path (
/serving-endpoints/anthropic/v1), Gemini through the Google-native path, GPT/Codex through the OpenAI Responses API, and everything else through Chat Completions - Workarounds baked in for Databricks-specific proxy quirks (tool schema
type: objectcoercion, Responses API streaming event fixes, oversizeditemIdtruncation, etc.)
The changes are scoped to the provider system and the TUI auth flow; everything else tracks upstream.
This fork is not published to npm and not intended for general distribution. To try it, clone and run from source:
git clone https://github.com/dgokeeffe/opencode-databricks.git
cd opencode-databricks
bun install
bun dev # run the TUI from sourceYou will need:
bun≥ 1.3.11- Databricks CLI configured (
databricks auth login --host <your-workspace>) orDATABRICKS_HOST+DATABRICKS_TOKENin env - Access to the Databricks npm proxy (
~/.npmrcshould already point at this if you're on the Databricks network)
In the TUI, run /login, pick Databricks, and either:
- Select a profile (reads
databricks auth profilesand~/.databrickscfg) — recommended - Enter a workspace URL and then either use the Databricks CLI browser OAuth flow or paste a Personal Access Token
The provider will auto-discover all ready llm/v1/chat and llm/v1/responses serving endpoints the next time you open the model picker.
| Aspect | Behavior |
|---|---|
| Tracking | dev on this fork is periodically merged from anomalyco/opencode:dev. Expect occasional long-lived feature branches during merges. |
| Upstream PR | Databricks-specific changes are not proposed for merge into upstream opencode. They would pollute that project with vendor-specific code. |
| Issues | File issues against this fork only. Do not open tickets against anomalyco/opencode for Databricks provider behavior. |
| Trademark | "opencode" is the trademark of the opencode project. This fork is published under a distinct name (opencode-databricks) to avoid confusion. |
To pull newer changes from the official opencode project into this fork:
git remote add upstream https://github.com/anomalyco/opencode.git # one-time
git fetch upstream
git checkout dev
git merge upstream/dev # resolve conflicts if any
git push origin devMost conflicts concentrate in packages/opencode/src/provider/provider.ts, packages/opencode/src/provider/transform.ts, and the session/LLM files — the areas this fork modifies.
Source changes are kept small and auditable. Significant files touched:
packages/opencode/src/provider/provider.ts— adds thedatabrickscustom loader and registers@databricks/ai-sdk-provideras a bundled providerpackages/opencode/src/provider/transform.ts— Databricks-specific tool schema fixes, reasoning effort mapping, itemId truncation, cache-control routingpackages/opencode/src/provider/databricks-profile.ts— helpers for parsing~/.databrickscfgand picking an auth flowpackages/opencode/src/auth/auth.ts— adds thedatabricks-profileauth variant to theAuth.Infoschemapackages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx— adds the Databricks profile / host / OAuth / PAT login flowpackages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx— shows Databricks connection status in the session sidebarpackages/opencode/src/session/llm.ts— tool-call remapping middleware for Databricks Responses APIpackages/opencode/src/session/processor.ts— override "other" finish reason to "tool-calls" when Databricks FMAPI returns it
Run git log dev ^anomalyco/dev --no-merges on this repo to see every non-merge delta from upstream.
- Databricks-specific improvements (provider, auth, model routing, known-issue workarounds): PRs welcome on this fork.
- General opencode improvements (TUI, tooling, session management, other providers): submit those to upstream opencode — not here.
Before opening a PR, run:
bun install
bun turbo typecheck
cd packages/opencode && bun test --timeout 30000This fork is distributed under the same MIT License as upstream opencode. See LICENSE for the full text. The MIT license from the upstream project explicitly permits modification, redistribution, and sublicensing, provided the original copyright notice is preserved — which it is.
- Upstream copyright:
Copyright (c) 2025 opencode(unchanged) - Modifications in this fork:
Copyright (c) 2026 David O'Keeffe
The MIT license does not grant trademark rights. "opencode" is the trademark of its project maintainers; this fork is rebranded as opencode-databricks to make the distinction explicit.
All credit for the underlying agent, TUI, session engine, tool system, and plugin architecture belongs to the opencode team and its contributors. This fork is a thin Databricks-specific layer on top of their work.
The original upstream README is preserved at README.upstream.md for reference.