Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/app/(landing)/models/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('model catalog capability facts', () => {

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

expect(researchModel).not.toBeNull()
expect(generalModel).not.toBeNull()
Expand Down
22 changes: 22 additions & 0 deletions apps/sim/blocks/blocks/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,28 @@ Return ONLY the JSON array.`,
})(),
}),
},
{
id: 'temperature',
title: 'Temperature',
type: 'slider',
min: 0,
max: 1.5,
defaultValue: 0.3,
mode: 'advanced',
condition: () => ({
field: 'model',
value: (() => {
const deepResearch = new Set(MODELS_WITH_DEEP_RESEARCH.map((m) => m.toLowerCase()))
const allModels = Object.keys(getBaseModelProviders())
return allModels.filter(
(model) =>
supportsTemperature(model) &&
getMaxTemperature(model) === 1.5 &&
!deepResearch.has(model.toLowerCase())
)
})(),
}),
},
{
id: 'temperature',
title: 'Temperature',
Expand Down
46 changes: 46 additions & 0 deletions apps/sim/providers/bedrock/utils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* @vitest-environment node
*/
import { describe, expect, it } from 'vitest'
import { getBedrockInferenceProfileId } from '@/providers/bedrock/utils'

describe('getBedrockInferenceProfileId', () => {
it.concurrent('prefixes geo inference profile for models that require it', () => {
expect(
getBedrockInferenceProfileId('bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0', 'us-east-1')
).toBe('us.anthropic.claude-sonnet-4-5-20250929-v1:0')
expect(getBedrockInferenceProfileId('bedrock/amazon.nova-pro-v1:0', 'eu-west-1')).toBe(
'eu.amazon.nova-pro-v1:0'
)
expect(
getBedrockInferenceProfileId('bedrock/meta.llama4-scout-17b-instruct-v1:0', 'us-west-2')
).toBe('us.meta.llama4-scout-17b-instruct-v1:0')
})

it.concurrent('returns already-prefixed inference profile IDs unchanged', () => {
expect(
getBedrockInferenceProfileId('us.anthropic.claude-sonnet-4-5-20250929-v1:0', 'us-east-1')
).toBe('us.anthropic.claude-sonnet-4-5-20250929-v1:0')
expect(getBedrockInferenceProfileId('global.amazon.nova-2-lite-v1:0', 'us-east-1')).toBe(
'global.amazon.nova-2-lite-v1:0'
)
})

it.concurrent('returns the bare model ID for models without geo profile support', () => {
expect(
getBedrockInferenceProfileId('bedrock/mistral.mistral-large-3-675b-instruct', 'us-east-1')
).toBe('mistral.mistral-large-3-675b-instruct')
expect(
getBedrockInferenceProfileId('bedrock/mistral.ministral-3-8b-instruct', 'eu-west-1')
).toBe('mistral.ministral-3-8b-instruct')
expect(getBedrockInferenceProfileId('bedrock/cohere.command-r-plus-v1:0', 'us-east-1')).toBe(
'cohere.command-r-plus-v1:0'
)
expect(
getBedrockInferenceProfileId('bedrock/mistral.mixtral-8x7b-instruct-v0:1', 'ap-southeast-1')
).toBe('mistral.mixtral-8x7b-instruct-v0:1')
expect(
getBedrockInferenceProfileId('bedrock/amazon.titan-text-premier-v1:0', 'us-east-1')
).toBe('amazon.titan-text-premier-v1:0')
})
})
27 changes: 26 additions & 1 deletion apps/sim/providers/bedrock/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,31 @@ export function generateToolUseId(toolName: string): string {
return `${truncatedName}${suffix}`
}

/**
* Models whose AWS model cards state geo/cross-region inference profiles are
* not supported ("Geo inference ID: Not supported"). These must be invoked
* with the bare in-region model ID — prefixing them with a geo profile
* (e.g. us.mistral...) produces an invalid model identifier.
*/
const GEO_PROFILE_UNSUPPORTED_MODEL_IDS = new Set([
'mistral.mistral-large-3-675b-instruct',
'mistral.mistral-large-2411-v1:0',
'mistral.mistral-large-2407-v1:0',
'mistral.magistral-small-2509',
'mistral.ministral-3-14b-instruct',
'mistral.ministral-3-8b-instruct',
'mistral.ministral-3-3b-instruct',
'mistral.mixtral-8x7b-instruct-v0:1',
'amazon.titan-text-premier-v1:0',
'cohere.command-r-v1:0',
'cohere.command-r-plus-v1:0',
])

/**
* Converts a model ID to the Bedrock inference profile format.
* AWS Bedrock requires inference profile IDs (e.g., us.anthropic.claude-...)
* for on-demand invocation of newer models.
* for on-demand invocation of newer models, while some models only accept
* the bare in-region model ID.
*
* @param modelId - The model ID (e.g., "bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0")
* @param region - The AWS region (e.g., "us-east-1")
Expand All @@ -97,6 +118,10 @@ export function getBedrockInferenceProfileId(modelId: string, region: string): s
return baseModelId
}

if (GEO_PROFILE_UNSUPPORTED_MODEL_IDS.has(baseModelId)) {
return baseModelId
}

let inferencePrefix: string
if (region.startsWith('us-gov-')) {
inferencePrefix = 'us-gov'
Expand Down
Loading
Loading