feat: load balancing Google Vertex AI API across US/CA regions #2795
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
Google Vertex AI API provided by Google Cloud has a request limit quota of 1 request per minute per region as of now. If you are having a conversation with Gemini 1.5 Pro / Flash, and you reply more than twice in a minute, you'll hit quota limit, and have to wait. Load balancing across multiple region solves this problem.
It also improves load on Google side, preventing us-central1 region from being flooded by requests from the same app.
The code change is minimal, so that it doesn't impact user experience. The list only includes US/CA regions for now because they are close to the previous option
us-central1
. Those who live close to US central should not see any performance impact. Those who don't connect to US central well may see performance improvement.This is a premature implementation to mitigate #2723.
Change Type
Testing
TBD
Checklist