Skip to content

Commit 6c18d51

Browse files
authored
fix: permit use of global endpoint for vertex ai (RooCodeInc#3469)
1 parent aabe4ae commit 6c18d51

File tree

6 files changed

+34
-14
lines changed

6 files changed

+34
-14
lines changed

.changeset/spotty-geese-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
adds global endpoint for vertex ai users

docs/custom-model-configs/gcp-vertex-ai.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ This guide is tailored for organizations with established GCP environments (leve
4444

4545
#### 2.1 Choose and Confirm a Region
4646

47-
Vertex AI supports eight regions. Select a region that meets your latency, compliance, and capacity needs. Examples include:
47+
Vertex AI supports multiple regions. Select a region that meets your latency, compliance, and capacity needs. Examples include:
4848

4949
- **us-east5 (Columbus, Ohio)**
50-
- **us-east1 (South Carolina)**
51-
- **us-east4 (Northern Virginia)**
5250
- **us-central1 (Iowa)**
53-
- **us-west1 (The Dalles, Oregon)**
54-
- **us-west4 (Las Vegas, Nevada)**
5551
- **europe-west1 (Belgium)**
52+
- **europe-west4 (Netherlands)**
5653
- **asia-southeast1 (Singapore)**
54+
- **global (Global)**
55+
56+
The Global endpoint may offer higher availability and reduce resource exhausted errors. Only Gemini models are supported.
5757

5858
#### 2.2 Enable the Claude 3.5 Sonnet v2 Model
5959

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
"@aws-sdk/client-bedrock-runtime": "^3.758.0",
320320
"@bufbuild/protobuf": "^2.2.5",
321321
"@google-cloud/vertexai": "^1.9.3",
322-
"@google/genai": "^0.9.0",
322+
"@google/genai": "^0.13.0",
323323
"@grpc/grpc-js": "^1.9.15",
324324
"@grpc/reflection": "^1.0.4",
325325
"@mistralai/mistralai": "^1.5.0",

src/shared/api.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export interface ModelInfo {
114114
outputPrice?: number // Output price per million tokens when budget > 0
115115
outputPriceTiers?: PriceTier[] // Optional: Tiered output price when budget > 0
116116
}
117+
supportsGlobalEndpoint?: boolean // Whether the model supports a global endpoint with Vertex AI
117118
cacheWritesPrice?: number
118119
cacheReadsPrice?: number
119120
description?: string
@@ -403,6 +404,7 @@ export const vertexModels = {
403404
contextWindow: 1_048_576,
404405
supportsImages: true,
405406
supportsPromptCache: true,
407+
supportsGlobalEndpoint: true,
406408
inputPrice: 0.15,
407409
outputPrice: 0.6,
408410
cacheWritesPrice: 1.0,
@@ -413,6 +415,7 @@ export const vertexModels = {
413415
contextWindow: 1_048_576,
414416
supportsImages: true,
415417
supportsPromptCache: false,
418+
supportsGlobalEndpoint: true,
416419
inputPrice: 0.075,
417420
outputPrice: 0.3,
418421
},
@@ -421,6 +424,7 @@ export const vertexModels = {
421424
contextWindow: 32_767,
422425
supportsImages: true,
423426
supportsPromptCache: false,
427+
supportsGlobalEndpoint: true,
424428
inputPrice: 0,
425429
outputPrice: 0,
426430
},
@@ -429,6 +433,7 @@ export const vertexModels = {
429433
contextWindow: 1_048_576,
430434
supportsImages: true,
431435
supportsPromptCache: false,
436+
supportsGlobalEndpoint: true,
432437
inputPrice: 0,
433438
outputPrice: 0,
434439
},
@@ -445,6 +450,7 @@ export const vertexModels = {
445450
contextWindow: 1_048_576,
446451
supportsImages: true,
447452
supportsPromptCache: true,
453+
supportsGlobalEndpoint: true,
448454
inputPrice: 2.5,
449455
outputPrice: 15,
450456
cacheReadsPrice: 0.31,
@@ -468,6 +474,7 @@ export const vertexModels = {
468474
contextWindow: 1_048_576,
469475
supportsImages: true,
470476
supportsPromptCache: false,
477+
supportsGlobalEndpoint: true,
471478
inputPrice: 0.15,
472479
outputPrice: 0.6,
473480
thinkingConfig: {
@@ -480,6 +487,7 @@ export const vertexModels = {
480487
contextWindow: 1_048_576,
481488
supportsImages: true,
482489
supportsPromptCache: false,
490+
supportsGlobalEndpoint: true,
483491
inputPrice: 0,
484492
outputPrice: 0,
485493
},
@@ -549,6 +557,10 @@ export const vertexModels = {
549557
},
550558
} as const satisfies Record<string, ModelInfo>
551559

560+
export const vertexGlobalModels: Record<string, ModelInfo> = Object.fromEntries(
561+
Object.entries(vertexModels).filter(([_k, v]) => v.hasOwnProperty("supportsGlobalEndpoint")),
562+
) as Record<string, ModelInfo>
563+
552564
export const openAiModelInfoSaneDefaults: OpenAiCompatibleModelInfo = {
553565
maxTokens: -1,
554566
contextWindow: 128_000,

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
internationalQwenDefaultModelId,
4242
vertexDefaultModelId,
4343
vertexModels,
44+
vertexGlobalModels,
4445
askSageModels,
4546
askSageDefaultModelId,
4647
askSageDefaultURL,
@@ -933,6 +934,7 @@ const ApiOptions = ({
933934
<VSCodeOption value="europe-west1">europe-west1</VSCodeOption>
934935
<VSCodeOption value="europe-west4">europe-west4</VSCodeOption>
935936
<VSCodeOption value="asia-southeast1">asia-southeast1</VSCodeOption>
937+
<VSCodeOption value="global">global</VSCodeOption>
936938
</VSCodeDropdown>
937939
</DropdownContainer>
938940
<p
@@ -2056,7 +2058,8 @@ const ApiOptions = ({
20562058
<span style={{ fontWeight: 500 }}>Model</span>
20572059
</label>
20582060
{selectedProvider === "anthropic" && createDropdown(anthropicModels)}
2059-
{selectedProvider === "vertex" && createDropdown(vertexModels)}
2061+
{selectedProvider === "vertex" &&
2062+
createDropdown(apiConfiguration?.vertexRegion === "global" ? vertexGlobalModels : vertexModels)}
20602063
{selectedProvider === "gemini" && createDropdown(geminiModels)}
20612064
{selectedProvider === "openai-native" && createDropdown(openAiNativeModels)}
20622065
{selectedProvider === "deepseek" && createDropdown(deepSeekModels)}

0 commit comments

Comments
 (0)