MCPcopy Index your code
hub / github.com/simstudioai/sim / getBedrockInferenceProfileId

Function getBedrockInferenceProfileId

apps/sim/providers/bedrock/utils.ts:114–143  ·  view source on GitHub ↗
(modelId: string, region: string)

Source from the content-addressed store, hash-verified

112 * @returns The inference profile ID (e.g., "us.anthropic.claude-sonnet-4-5-20250929-v1:0")
113 */
114export function getBedrockInferenceProfileId(modelId: string, region: string): string {
115 const baseModelId = modelId.startsWith('bedrock/') ? modelId.slice(8) : modelId
116
117 if (/^(us-gov|us|eu|apac|au|ca|jp|global)\./.test(baseModelId)) {
118 return baseModelId
119 }
120
121 if (GEO_PROFILE_UNSUPPORTED_MODEL_IDS.has(baseModelId)) {
122 return baseModelId
123 }
124
125 let inferencePrefix: string
126 if (region.startsWith('us-gov-')) {
127 inferencePrefix = 'us-gov'
128 } else if (region.startsWith('us-') || region.startsWith('ca-')) {
129 inferencePrefix = 'us'
130 } else if (region.startsWith('eu-') || region === 'il-central-1') {
131 inferencePrefix = 'eu'
132 } else if (region.startsWith('ap-') || region.startsWith('me-')) {
133 inferencePrefix = 'apac'
134 } else if (region.startsWith('sa-')) {
135 inferencePrefix = 'us'
136 } else if (region.startsWith('af-')) {
137 inferencePrefix = 'eu'
138 } else {
139 inferencePrefix = 'us'
140 }
141
142 return `${inferencePrefix}.${baseModelId}`
143}

Callers 2

index.tsFile · 0.90
utils.test.tsFile · 0.90

Calls 1

testMethod · 0.80

Tested by

no test coverage detected