Skip to content
Merged
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
40 changes: 23 additions & 17 deletions packages/cdk/lambda/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,21 @@ export const defaultVideoGenerationModel: Model = {
};

// Model Params
const CLAUDE_4_5_DEFAULT_PARAMS: ConverseInferenceParams = {
const CLAUDE_SONNET_4_DEFAULT_PARAMS: ConverseInferenceParams = {
Copy link
Collaborator Author

@kazuhitogo kazuhitogo Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もともと 4.5 用に作っていたものですが、sonnet 4 系(と例外で3.7)としてまとめられるのでこの表記に変えました。

inferenceConfig: {
maxTokens: 64000,
temperature: 1,
},
};

const CLAUDE_OPUS_4_DEFAULT_PARAMS: ConverseInferenceParams = {
inferenceConfig: {
maxTokens: 32000,
temperature: 1,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

マネジメントコンソールのデフォルト値かつ、最近のLLMはTemperature及びTopPを最大化する傾向(ベンチマーク時に高目に設定してそれで精度が出ている)にあるので、高い数値を設定しています。

topP: 0.999,
},
};

const CLAUDE_3_5_DEFAULT_PARAMS: ConverseInferenceParams = {
inferenceConfig: {
maxTokens: 8192,
Expand Down Expand Up @@ -472,9 +480,7 @@ const createConverseCommandInput = (
...params.inferenceConfig,
temperature: 1, // reasoning requires temperature to be 1
topP: undefined, // reasoning does not require topP
maxTokens:
(model.modelParameters?.reasoningConfig?.budgetTokens || 0) +
(params.inferenceConfig?.maxTokens || 0),
maxTokens: params.inferenceConfig?.maxTokens,
};
converseCommandInput.additionalModelRequestFields = {
reasoning_config: {
Expand Down Expand Up @@ -929,79 +935,79 @@ export const BEDROCK_TEXT_GEN_MODELS: {
};
} = {
'us.anthropic.claude-opus-4-1-20250805-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_OPUS_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'us.anthropic.claude-opus-4-20250514-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_OPUS_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'global.anthropic.claude-sonnet-4-5-20250929-v1:0': {
defaultParams: CLAUDE_4_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'us.anthropic.claude-sonnet-4-5-20250929-v1:0': {
defaultParams: CLAUDE_4_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'eu.anthropic.claude-sonnet-4-5-20250929-v1:0': {
defaultParams: CLAUDE_4_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'jp.anthropic.claude-sonnet-4-5-20250929-v1:0': {
defaultParams: CLAUDE_4_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'global.anthropic.claude-sonnet-4-20250514-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'us.anthropic.claude-sonnet-4-20250514-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'eu.anthropic.claude-sonnet-4-20250514-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'apac.anthropic.claude-sonnet-4-20250514-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
Expand Down Expand Up @@ -1041,23 +1047,23 @@ export const BEDROCK_TEXT_GEN_MODELS: {
extractConverseStreamOutput: extractConverseStreamOutput,
},
'us.anthropic.claude-3-7-sonnet-20250219-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'eu.anthropic.claude-3-7-sonnet-20250219-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
extractConverseOutput: extractConverseOutput,
extractConverseStreamOutput: extractConverseStreamOutput,
},
'apac.anthropic.claude-3-7-sonnet-20250219-v1:0': {
defaultParams: CLAUDE_3_5_DEFAULT_PARAMS,
defaultParams: CLAUDE_SONNET_4_DEFAULT_PARAMS,
usecaseParams: USECASE_DEFAULT_PARAMS,
createConverseCommandInput: createConverseCommandInput,
createConverseStreamCommandInput: createConverseStreamCommandInput,
Expand Down
Loading