@@ -2,7 +2,13 @@ import { useCallback, useState, useEffect } from "react"
22import { Checkbox } from "vscrui"
33import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
44
5- import { type ProviderSettings , type ModelInfo , BEDROCK_REGIONS , BEDROCK_1M_CONTEXT_MODEL_IDS } from "@roo-code/types"
5+ import {
6+ type ProviderSettings ,
7+ type ModelInfo ,
8+ BEDROCK_REGIONS ,
9+ BEDROCK_1M_CONTEXT_MODEL_IDS ,
10+ BEDROCK_GLOBAL_INFERENCE_MODEL_IDS ,
11+ } from "@roo-code/types"
612
713import { useAppTranslation } from "@src/i18n/TranslationContext"
814import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue , StandardTooltip } from "@src/components/ui"
@@ -23,6 +29,11 @@ export const Bedrock = ({ apiConfiguration, setApiConfigurationField, selectedMo
2329 const supports1MContextBeta =
2430 ! ! apiConfiguration ?. apiModelId && BEDROCK_1M_CONTEXT_MODEL_IDS . includes ( apiConfiguration . apiModelId as any )
2531
32+ // Check if the selected model supports Global Inference profile routing
33+ const supportsGlobalInference =
34+ ! ! apiConfiguration ?. apiModelId &&
35+ BEDROCK_GLOBAL_INFERENCE_MODEL_IDS . includes ( apiConfiguration . apiModelId as any )
36+
2637 // Update the endpoint enabled state when the configuration changes
2738 useEffect ( ( ) => {
2839 setAwsEndpointSelected ( ! ! apiConfiguration ?. awsBedrockEndpointEnabled )
@@ -138,6 +149,17 @@ export const Bedrock = ({ apiConfiguration, setApiConfigurationField, selectedMo
138149 </ SelectContent >
139150 </ Select >
140151 </ div >
152+ { supportsGlobalInference && (
153+ < Checkbox
154+ checked = { apiConfiguration ?. awsUseGlobalInference || false }
155+ onChange = { ( checked : boolean ) => {
156+ // Enabling Global Inference should disable cross-region inference
157+ setApiConfigurationField ( "awsUseGlobalInference" , checked )
158+ if ( checked ) setApiConfigurationField ( "awsUseCrossRegionInference" , false )
159+ } } >
160+ { t ( "settings:providers.awsGlobalInference" ) }
161+ </ Checkbox >
162+ ) }
141163 < Checkbox
142164 checked = { apiConfiguration ?. awsUseCrossRegionInference || false }
143165 onChange = { handleInputChange ( "awsUseCrossRegionInference" , noTransform ) } >
0 commit comments