feat: add Databricks model provider - #7895
calvinmclean wants to merge 9 commits into
Conversation
651d115 to
0f29cec
Compare
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🔵 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
APIsForhandles 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 declaredOpenAIResponsesandOpenResponses, 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 declaredOpenAIResponsesorOpenResponsesdialect. 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
There was a problem hiding this comment.
🔵 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
Summary
Depends on obot-platform/providers#20
Addresses obot-platform/field-issues#61