Skip to content

feat(buzz-agent): add databricks_v2 provider for AI Gateway v2#1311

Merged
kalvinnchau merged 2 commits into
mainfrom
kalvin/buzz-agent-databricks-v2
Jun 29, 2026
Merged

feat(buzz-agent): add databricks_v2 provider for AI Gateway v2#1311
kalvinnchau merged 2 commits into
mainfrom
kalvin/buzz-agent-databricks-v2

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a databricks_v2 provider to buzz-agent that routes requests through Databricks AI Gateway v2 instead of the legacy serving-endpoints path.

What changed

New provider: DatabricksV2

  • BUZZ_AGENT_PROVIDER=databricks_v2 (or databricks-v2) selects the new provider
  • Reuses all existing Databricks auth config: DATABRICKS_HOST, DATABRICKS_MODEL, DATABRICKS_TOKEN / OAuth PKCE — no new env vars
  • auth databricks_v2 subcommand runs the same OAuth PKCE flow as auth databricks

Model-family routing (DatabricksV2Route)

The gateway exposes three distinct HTTP dialects. The provider picks the right one by inspecting the model name at request time:

Model name contains Route Path
gpt-5 / gpt5 OpenAI Responses API /ai-gateway/openai/v1/responses
claude Anthropic Messages API /ai-gateway/anthropic/v1/messages
anything else MLflow Chat Completions /ai-gateway/mlflow/v1/chat/completions

Body construction and response parsing reuse the existing responses_body/parse_responses, anthropic_body/parse_anthropic, and openai_body/parse_openai helpers — no new wire-format code.

Legacy databricks provider is unchanged

The serving-endpoints path is untouched. DatabricksV2 is an additive enum variant.

Files changed

File Change
src/config.rs DatabricksV2 variant; shared auth config branch; provider string parsing; unit test
src/llm.rs DatabricksV2Route enum; databricks_v2_request helper; routing functions; unit + routing tests
src/lib.rs auth subcommand accepts databricks_v2 / databricks-v2
README.md Provider table updated; minor wording fixes
tests/databricks_oauth.rs Refactored harness (spawn_provider, run_captured_prompt); added v2 envelope tests for all three routes

Testing

  • databricks_v2_routes_by_model_family — unit test covering all three routing branches
  • Integration tests: databricks_v2_gpt5_routes_through_ai_gateway_responses + two sibling tests covering Anthropic and MLflow paths
  • Existing databricks_envelope_routes_through_serving_endpoints_and_strips_model test is preserved and still passes (legacy path unaffected)

@kalvinnchau kalvinnchau force-pushed the kalvin/buzz-agent-databricks-v2 branch from 7e2002a to 932ed78 Compare June 26, 2026 18:06
add an explicit databricks_v2 provider that routes ai gateway requests by model family while preserving legacy databricks serving endpoint behavior.

reuse databricks auth config for static tokens and oauth, and cover the v2 gateway paths with envelope tests.
@kalvinnchau kalvinnchau force-pushed the kalvin/buzz-agent-databricks-v2 branch from 932ed78 to f6d9169 Compare June 29, 2026 20:55
clarify databricks dispatch comments and document model routing assumptions.

use fnonce for the single-use databricks v2 request builder.
@kalvinnchau kalvinnchau merged commit 15a73aa into main Jun 29, 2026
29 checks passed
@kalvinnchau kalvinnchau deleted the kalvin/buzz-agent-databricks-v2 branch June 29, 2026 22:46
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