feat(buzz-agent): add databricks_v2 provider for AI Gateway v2#1311
Open
kalvinnchau wants to merge 1 commit into
Open
feat(buzz-agent): add databricks_v2 provider for AI Gateway v2#1311kalvinnchau wants to merge 1 commit into
kalvinnchau wants to merge 1 commit into
Conversation
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.
7e2002a to
932ed78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
databricks_v2provider tobuzz-agentthat routes requests through Databricks AI Gateway v2 instead of the legacy serving-endpoints path.What changed
New provider:
DatabricksV2BUZZ_AGENT_PROVIDER=databricks_v2(ordatabricks-v2) selects the new providerDATABRICKS_HOST,DATABRICKS_MODEL,DATABRICKS_TOKEN/ OAuth PKCE — no new env varsauth databricks_v2subcommand runs the same OAuth PKCE flow asauth databricksModel-family routing (
DatabricksV2Route)The gateway exposes three distinct HTTP dialects. The provider picks the right one by inspecting the model name at request time:
gpt-5/gpt5/ai-gateway/openai/v1/responsesclaude/ai-gateway/anthropic/v1/messages/ai-gateway/mlflow/v1/chat/completionsBody construction and response parsing reuse the existing
responses_body/parse_responses,anthropic_body/parse_anthropic, andopenai_body/parse_openaihelpers — no new wire-format code.Legacy
databricksprovider is unchangedThe serving-endpoints path is untouched.
DatabricksV2is an additive enum variant.Files changed
src/config.rsDatabricksV2variant; shared auth config branch; provider string parsing; unit testsrc/llm.rsDatabricksV2Routeenum;databricks_v2_requesthelper; routing functions; unit + routing testssrc/lib.rsauthsubcommand acceptsdatabricks_v2/databricks-v2README.mdtests/databricks_oauth.rsspawn_provider,run_captured_prompt); added v2 envelope tests for all three routesTesting
databricks_v2_routes_by_model_family— unit test covering all three routing branchesresolve_provider_accepts_explicit_databricks_v2— config parsing for both slug formsdatabricks_v2_gpt5_routes_through_ai_gateway_responses+ two sibling tests covering Anthropic and MLflow pathsdatabricks_envelope_routes_through_serving_endpoints_and_strips_modeltest is preserved and still passes (legacy path unaffected)