Skip to content

Commit 47e8baf

Browse files
committed
fix(providers): apply full re-validation pass across model catalog with per-provider justification docs
1 parent 768ef94 commit 47e8baf

18 files changed

Lines changed: 2629 additions & 199 deletions

File tree

apps/sim/app/(landing)/models/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('model catalog capability facts', () => {
3838

3939
it.concurrent('keeps best-for copy for clearly differentiated models only', () => {
4040
const researchModel = getModelBySlug('google', 'deep-research-pro-preview-12-2025')
41-
const generalModel = getModelBySlug('xai', 'grok-4-latest')
41+
const generalModel = getModelBySlug('mistral', 'mistral-medium-latest')
4242

4343
expect(researchModel).not.toBeNull()
4444
expect(generalModel).not.toBeNull()

apps/sim/blocks/blocks/agent.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,28 @@ Return ONLY the JSON array.`,
412412
})(),
413413
}),
414414
},
415+
{
416+
id: 'temperature',
417+
title: 'Temperature',
418+
type: 'slider',
419+
min: 0,
420+
max: 1.5,
421+
defaultValue: 0.3,
422+
mode: 'advanced',
423+
condition: () => ({
424+
field: 'model',
425+
value: (() => {
426+
const deepResearch = new Set(MODELS_WITH_DEEP_RESEARCH.map((m) => m.toLowerCase()))
427+
const allModels = Object.keys(getBaseModelProviders())
428+
return allModels.filter(
429+
(model) =>
430+
supportsTemperature(model) &&
431+
getMaxTemperature(model) === 1.5 &&
432+
!deepResearch.has(model.toLowerCase())
433+
)
434+
})(),
435+
}),
436+
},
415437
{
416438
id: 'temperature',
417439
title: 'Temperature',
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* @vitest-environment node
3+
*/
4+
import { describe, expect, it } from 'vitest'
5+
import { getBedrockInferenceProfileId } from '@/providers/bedrock/utils'
6+
7+
describe('getBedrockInferenceProfileId', () => {
8+
it.concurrent('prefixes geo inference profile for models that require it', () => {
9+
expect(
10+
getBedrockInferenceProfileId('bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0', 'us-east-1')
11+
).toBe('us.anthropic.claude-sonnet-4-5-20250929-v1:0')
12+
expect(getBedrockInferenceProfileId('bedrock/amazon.nova-pro-v1:0', 'eu-west-1')).toBe(
13+
'eu.amazon.nova-pro-v1:0'
14+
)
15+
expect(
16+
getBedrockInferenceProfileId('bedrock/meta.llama4-scout-17b-instruct-v1:0', 'us-west-2')
17+
).toBe('us.meta.llama4-scout-17b-instruct-v1:0')
18+
})
19+
20+
it.concurrent('returns already-prefixed inference profile IDs unchanged', () => {
21+
expect(
22+
getBedrockInferenceProfileId('us.anthropic.claude-sonnet-4-5-20250929-v1:0', 'us-east-1')
23+
).toBe('us.anthropic.claude-sonnet-4-5-20250929-v1:0')
24+
expect(getBedrockInferenceProfileId('global.amazon.nova-2-lite-v1:0', 'us-east-1')).toBe(
25+
'global.amazon.nova-2-lite-v1:0'
26+
)
27+
})
28+
29+
it.concurrent('returns the bare model ID for models without geo profile support', () => {
30+
expect(
31+
getBedrockInferenceProfileId('bedrock/mistral.mistral-large-3-675b-instruct', 'us-east-1')
32+
).toBe('mistral.mistral-large-3-675b-instruct')
33+
expect(
34+
getBedrockInferenceProfileId('bedrock/mistral.ministral-3-8b-instruct', 'eu-west-1')
35+
).toBe('mistral.ministral-3-8b-instruct')
36+
expect(getBedrockInferenceProfileId('bedrock/cohere.command-r-plus-v1:0', 'us-east-1')).toBe(
37+
'cohere.command-r-plus-v1:0'
38+
)
39+
expect(
40+
getBedrockInferenceProfileId('bedrock/mistral.mixtral-8x7b-instruct-v0:1', 'ap-southeast-1')
41+
).toBe('mistral.mixtral-8x7b-instruct-v0:1')
42+
expect(
43+
getBedrockInferenceProfileId('bedrock/amazon.titan-text-premier-v1:0', 'us-east-1')
44+
).toBe('amazon.titan-text-premier-v1:0')
45+
})
46+
})

apps/sim/providers/bedrock/utils.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,31 @@ export function generateToolUseId(toolName: string): string {
8181
return `${truncatedName}${suffix}`
8282
}
8383

84+
/**
85+
* Models whose AWS model cards state geo/cross-region inference profiles are
86+
* not supported ("Geo inference ID: Not supported"). These must be invoked
87+
* with the bare in-region model ID — prefixing them with a geo profile
88+
* (e.g. us.mistral...) produces an invalid model identifier.
89+
*/
90+
const GEO_PROFILE_UNSUPPORTED_MODEL_IDS = new Set([
91+
'mistral.mistral-large-3-675b-instruct',
92+
'mistral.mistral-large-2411-v1:0',
93+
'mistral.mistral-large-2407-v1:0',
94+
'mistral.magistral-small-2509',
95+
'mistral.ministral-3-14b-instruct',
96+
'mistral.ministral-3-8b-instruct',
97+
'mistral.ministral-3-3b-instruct',
98+
'mistral.mixtral-8x7b-instruct-v0:1',
99+
'amazon.titan-text-premier-v1:0',
100+
'cohere.command-r-v1:0',
101+
'cohere.command-r-plus-v1:0',
102+
])
103+
84104
/**
85105
* Converts a model ID to the Bedrock inference profile format.
86106
* AWS Bedrock requires inference profile IDs (e.g., us.anthropic.claude-...)
87-
* for on-demand invocation of newer models.
107+
* for on-demand invocation of newer models, while some models only accept
108+
* the bare in-region model ID.
88109
*
89110
* @param modelId - The model ID (e.g., "bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0")
90111
* @param region - The AWS region (e.g., "us-east-1")
@@ -97,6 +118,10 @@ export function getBedrockInferenceProfileId(modelId: string, region: string): s
97118
return baseModelId
98119
}
99120

121+
if (GEO_PROFILE_UNSUPPORTED_MODEL_IDS.has(baseModelId)) {
122+
return baseModelId
123+
}
124+
100125
let inferencePrefix: string
101126
if (region.startsWith('us-gov-')) {
102127
inferencePrefix = 'us-gov'

0 commit comments

Comments
 (0)