-
Notifications
You must be signed in to change notification settings - Fork 777
feat: add support for vertex-ai global region endpoints #1171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary By MatterAI
🔄 What Changed
🔍 Impact of the ChangeThis change allows users to connect to Vertex AI's global region endpoints, expanding the service's compatibility with Google's AI platform infrastructure. The global endpoint can be used for certain Vertex AI services that are not region-specific. 📁 Total Files Changed
🧪 Test AddedN/A - No tests were included in this PR 🔒Security VulnerabilitiesN/A - No security vulnerabilities detected MotivationTo support Google Vertex AI's global region endpoints, allowing users to access services that are available through the global API endpoint. Type of Change
How Has This Been Tested?
Screenshots (if applicable)N/A Checklist
Related IssuesN/A Tip Quality Recommendations
Sequence DiagramsequenceDiagram
participant Client
participant VertexAIProvider
participant API
participant GoogleVertexAI
Client->>VertexAIProvider: Request with vertexRegion='global'
VertexAIProvider->>API: getBaseUrl(vertexRegion)
Note over API: New condition added for global region
alt vertexRegion === 'global'
API-->>VertexAIProvider: https://aiplatform.googleapis.com
else vertexRegion is specific region
API-->>VertexAIProvider: https://{vertexRegion}-aiplatform.googleapis.com
end
VertexAIProvider->>GoogleVertexAI: API request with correct endpoint
GoogleVertexAI-->>VertexAIProvider: Response
VertexAIProvider-->>Client: Processed response
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds support for Vertex AI global region endpoints, which is a valuable addition. The implementation is clean and straightforward. I have one suggestion to improve code documentation.
| } | ||
|
|
||
| if (vertexRegion === 'global') { | ||
| return `https://aiplatform.googleapis.com`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just adding as a note, I've just tested this endpoint with normal regions like us-east5 as well and it works, so I think we can make this as the default instead of ln:63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on their docs, it only works for some models. So partner models like anthropic and meta models might not work if we change the url.
https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#supported_models
Description
Motivation
Type of Change
How Has This Been Tested?
Screenshots (if applicable)
Checklist
Related Issues
Closes #1172