Auto-discover AI Gateway host from DATABRICKS_WORKSPACE_ID#104
Merged
datasciencemonkey merged 2 commits intomainfrom Apr 8, 2026
Merged
Auto-discover AI Gateway host from DATABRICKS_WORKSPACE_ID#104datasciencemonkey merged 2 commits intomainfrom
datasciencemonkey merged 2 commits intomainfrom
Conversation
Add get_gateway_host() helper to utils.py that resolves the gateway URL with a 3-tier priority: explicit DATABRICKS_GATEWAY_HOST env var > auto-constructed from DATABRICKS_WORKSPACE_ID > empty (fallback to DATABRICKS_HOST/serving-endpoints). Remove DATABRICKS_GATEWAY_HOST from app.yaml since Databricks Apps auto-inject DATABRICKS_WORKSPACE_ID into every container. Closes #103
15 tests covering get_gateway_host() priority logic (explicit override > workspace ID > empty fallback) and endpoint URL construction for all 4 service paths (anthropic, openai/v1, gemini, mlflow/v1). Ref #103
ff1bd35 to
47bd16a
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
get_gateway_host()helper toutils.pywith 3-tier priority: explicitDATABRICKS_GATEWAY_HOST> auto-constructed fromDATABRICKS_WORKSPACE_ID> empty fallbackapp.py,setup_claude.py,setup_codex.py,setup_gemini.py,setup_opencode.py,setup_proxy.py)DATABRICKS_GATEWAY_HOSTfromapp.yaml— no longer needed since Databricks Apps auto-injectDATABRICKS_WORKSPACE_IDhttps://{workspace_id}.ai-gateway.cloud.databricks.comTest plan
get_gateway_host()priority logic (override, auto-construct, fallback, edge cases)setup_claude.py(gateway, override, fallback)/anthropic,/openai/v1,/gemini,/mlflow/v1)Closes #103