Skip to content

feat: add Databricks model provider - #7895

Open
calvinmclean wants to merge 9 commits into
obot-platform:mainfrom
calvinmclean:feat/databricks-model-provider
Open

calvinmclean wants to merge 9 commits into
obot-platform:mainfrom
calvinmclean:feat/databricks-model-provider

Conversation

@calvinmclean

@calvinmclean calvinmclean commented Sep 14, 2026

Copy link
Copy Markdown
Member

Summary

  • add Databricks as a first-class model provider across the gateway, hosted agents, Nanobot, UI, and documentation
  • discover Databricks models through the provider registry and enrich them with models.dev pricing metadata
  • route native OpenAI models through the OpenAI Responses endpoint and Claude, GPT OSS, and other supported models through Open Responses
  • resolve the selected model before choosing the upstream proxy endpoint, while preserving existing provider behavior

Depends on obot-platform/providers#20
Addresses obot-platform/field-issues#61

@calvinmclean
calvinmclean force-pushed the feat/databricks-model-provider branch from 651d115 to 0f29cec Compare September 17, 2026 16:22
@calvinmclean
calvinmclean marked this pull request as ready for review September 17, 2026 18:35
Copilot AI balanced review requested due to automatic review settings September 17, 2026 18:35

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Databricks routing currently bypasses response accounting and policy enforcement in several supported paths.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Databricks as a first-class model provider across gateway routing, hosted agents, Nanobot, UI, pricing metadata, and documentation.

Changes:

  • Adds Databricks model discovery, authentication, and dialect-aware proxy routing.
  • Integrates Databricks with hosted agents, Nanobot, provider selection, and pricing.
  • Documents configuration and gateway usage.
File summaries
File Description
ui/user/src/routes/models/ModelsView.svelte Displays accessible Databricks models.
ui/user/src/routes/models/ModelProvidersView.svelte Enables Databricks provider configuration.
ui/user/src/lib/sort.ts Adds Databricks provider ordering.
ui/user/src/lib/services/llm-gateway/types.ts Defines Databricks gateway connection metadata.
ui/user/src/lib/constants.ts Adds the Databricks provider identifier.
pkg/system/tools.go Defines the backend provider constant.
pkg/hostedagentmodels/models.go Adds hosted-agent capabilities and routing.
pkg/hostedagentmodels/models_test.go Tests hosted-agent Databricks capabilities.
pkg/gateway/server/router.go Registers the Databricks proxy route.
pkg/gateway/server/llmproxy.go Resolves models before selecting upstream URLs.
pkg/gateway/server/llmproxy_test.go Updates proxy backend tests.
pkg/gateway/server/llmproxy_generic_responses.go Adopts the model-aware backend interface.
pkg/gateway/server/llmproxy_databricks.go Implements dialect-aware Databricks routing.
pkg/gateway/server/llmproxy_databricks_test.go Tests Databricks proxy behavior.
pkg/gateway/server/llmproxy_bedrock.go Adopts the model-aware backend interface.
pkg/gateway/server/llmproxy_azure.go Adopts the model-aware backend interface.
pkg/gateway/server/llmproxy_azure_test.go Updates Azure backend tests.
pkg/gateway/server/llmproxy_api_key.go Adopts the model-aware backend interface.
pkg/gateway/databricks/databricks.go Validates workspace URLs and adds authentication.
pkg/gateway/databricks/databricks_test.go Tests URL validation and credential handling.
pkg/controller/handlers/nanobotagent/nanobotagent.go Configures Databricks for Nanobot.
pkg/controller/handlers/nanobotagent/nanobotagent_test.go Tests Nanobot Databricks routes.
pkg/controller/handlers/modelinfosource/modelsdev.go Maps Databricks pricing metadata.
pkg/controller/handlers/modelinfosource/modelinfosource_test.go Tests Databricks pricing enrichment.
docs/docs/functionality/llm-gateway.md Documents Databricks gateway usage.
docs/docs/configuration/model-providers.md Documents Databricks provider setup.
Review details

Suppressed comments (2)

pkg/controller/handlers/nanobotagent/nanobotagent_test.go:125

  • These new table cases use positional struct literals, contrary to the repository's Go test convention that table-driven test fields be named and placed on separate lines. Use keyed fields so future field additions cannot silently reorder these cases.
		{system.DatabricksModelProvider, llmtypes.DialectOpenResponses, "https://obot.example.com/api/llm-proxy/databricks/v1"},
		{system.DatabricksModelProvider, llmtypes.DialectOpenAIResponses, "https://obot.example.com/api/llm-proxy/databricks/v1"},

docs/docs/functionality/llm-gateway.md:127

  • This new Databricks section conflicts with the page's earlier overview: lines 10 and 20 still list supported gateway providers and Models-page providers without Databricks, and the base-URL list also omits its route. Update those introductory lists so the page consistently describes Databricks support.
### Databricks

The Databricks route exposes `/v1/responses` for discovered serving endpoints that support the Databricks Open Responses API or OpenAI Responses API. Chat Completions-only endpoints are not available. Use the serving endpoint name returned by `/v1/models` as the model ID.
  • Files reviewed: 26/26 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/gateway/server/llmproxy_databricks.go
Comment thread pkg/gateway/server/llmproxy_databricks.go
Comment thread pkg/hostedagentmodels/models.go Outdated
Copilot AI review requested due to automatic review settings September 17, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Open Responses routing and response wrapping are incorrect, and redirected requests can disclose the Databricks token.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 28/28 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment thread pkg/gateway/databricks/databricks.go
Comment thread pkg/gateway/databricks/databricks.go Outdated
Comment thread pkg/gateway/server/llmproxy.go
Comment thread pkg/gateway/server/llmproxy_databricks.go
Copilot AI review requested due to automatic review settings September 17, 2026 20:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Hosted-agent and Nanobot paths can accept Databricks dialects that the gateway rejects.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

pkg/hostedagentmodels/models.go:223

  • APIsFor handles the dialect before checking the provider, so Databricks models with Chat Completions or Anthropic dialects are advertised under those APIs; this provider fallback also advertises an empty dialect as Responses-capable. The Databricks proxy only accepts explicitly declared OpenAIResponses and OpenResponses, so hosted agents can select models whose requests are always rejected. Check Databricks before the generic dialect mapping and return no APIs for every other dialect; update the new capability test so an empty dialect is rejected.
		return []string{APIAnthropic}
	case "OpenAIResponses", "OpenResponses":

pkg/controller/handlers/nanobotagent/nanobotagent.go:443

  • Databricks models with an empty dialect are defaulted to OpenResponses, and other declared dialects are accepted here unchanged. However, the Databricks proxy only accepts an explicitly declared OpenAIResponses or OpenResponses dialect. Nanobot can therefore be configured successfully with a model whose inference requests are always rejected. Validate the original manifest dialect for Databricks before emitting the proxy URL.
  • Files reviewed: 28/28 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 17, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes credential handling and routing across multiple execution paths while depending on an external provider change.

Review details
  • Files reviewed: 28/28 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants