Fix Anthropic models: use cross-region inference profiles (us. prefix)
Opus 4.6, Opus 4.5, Sonnet 4.6, Haiku 4.5 do NOT support direct on-demand invocation — they require cross-region inference profile IDs (us.anthropic.* prefix). Updated all affected bedrockIds. Also fixed isAnthropic check to handle us.anthropic.* prefix. Sonnet 4.5, Sonnet 4, 3.5 Haiku also updated to use profiles for consistency (profiles work everywhere, direct IDs are limited).
This commit is contained in:
parent
e4faf07a6d
commit
a43468fd4e
2 changed files with 11 additions and 10 deletions
|
|
@ -156,7 +156,7 @@ async function callBedrock(messages, model, temperature, maxTokens) {
|
|||
|
||||
var BedrockModule = require('@aws-sdk/client-bedrock-runtime');
|
||||
var modelId = getBedrockModelId(model);
|
||||
var isAnthropic = modelId.startsWith('anthropic.');
|
||||
var isAnthropic = modelId.indexOf('anthropic.') !== -1;
|
||||
|
||||
// Separate system message from chat messages
|
||||
var systemMsg = '';
|
||||
|
|
|
|||
|
|
@ -27,24 +27,25 @@ var OPENROUTER_MODELS = [
|
|||
];
|
||||
|
||||
var BEDROCK_MODELS = [
|
||||
// ── Anthropic vendor model (all verified on-demand from AWS docs 2026-03) ──
|
||||
// Wide region availability unless noted
|
||||
// ── Anthropic vendor model (verified from AWS docs 2026-03) ──
|
||||
// Models marked "profile" require cross-region inference profiles (us. prefix)
|
||||
// Models marked "on-demand" support direct single-region invocation
|
||||
{ id: 'anthropic/vendor-model-opus-4-6', name: 'vendor model Opus 4.6', cost: '~$0.075', tag: 'BEST', category: 'premium',
|
||||
bedrockId: 'anthropic.agent-config-opus-4-6-v1' },
|
||||
bedrockId: 'us.anthropic.agent-config-opus-4-6-v1' },
|
||||
{ id: 'anthropic/vendor-model-opus-4-5', name: 'vendor model Opus 4.5', cost: '~$0.075', tag: 'OPUS', category: 'premium',
|
||||
bedrockId: 'anthropic.agent-config-opus-4-5-20251101-v1:0' },
|
||||
bedrockId: 'us.anthropic.agent-config-opus-4-5-20251101-v1:0' },
|
||||
{ id: 'anthropic/vendor-model-opus-4-1', name: 'vendor model Opus 4.1', cost: '~$0.075', tag: 'MEDICAL', category: 'premium',
|
||||
bedrockId: 'anthropic.agent-config-opus-4-1-20250805-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-2'] },
|
||||
{ id: 'anthropic/vendor-model-sonnet-4-6', name: 'vendor model Sonnet 4.6', cost: '~$0.015', tag: 'RECOMMENDED', category: 'premium',
|
||||
bedrockId: 'anthropic.agent-config-sonnet-4-6' },
|
||||
bedrockId: 'us.anthropic.agent-config-sonnet-4-6' },
|
||||
{ id: 'anthropic/vendor-model-sonnet-4-5', name: 'vendor model Sonnet 4.5', cost: '~$0.015', tag: 'SMART', category: 'premium',
|
||||
bedrockId: 'anthropic.agent-config-sonnet-4-5-20250929-v1:0' },
|
||||
bedrockId: 'us.anthropic.agent-config-sonnet-4-5-20250929-v1:0' },
|
||||
{ id: 'anthropic/vendor-model-sonnet-4', name: 'vendor model Sonnet 4', cost: '~$0.015', tag: 'SOLID', category: 'premium',
|
||||
bedrockId: 'anthropic.agent-config-sonnet-4-20250514-v1:0' },
|
||||
bedrockId: 'us.anthropic.agent-config-sonnet-4-20250514-v1:0' },
|
||||
{ id: 'anthropic/vendor-model-haiku-4-5', name: 'vendor model Haiku 4.5', cost: '~$0.003', tag: 'FAST', category: 'smart',
|
||||
bedrockId: 'anthropic.agent-config-haiku-4-5-20251001-v1:0' },
|
||||
bedrockId: 'us.anthropic.agent-config-haiku-4-5-20251001-v1:0' },
|
||||
{ id: 'anthropic/vendor-model-3.5-haiku', name: 'vendor model 3.5 Haiku', cost: '~$0.002', tag: 'VALUE', category: 'smart',
|
||||
bedrockId: 'anthropic.agent-config-3-5-haiku-20241022-v1:0', regions: ['us-west-2', 'us-east-1', 'us-east-2'] },
|
||||
bedrockId: 'us.anthropic.agent-config-3-5-haiku-20241022-v1:0' },
|
||||
|
||||
// ── Amazon Nova (on-demand, fast + cheap) ──
|
||||
{ id: 'amazon/nova-pro', name: 'Amazon Nova Pro', cost: '~$0.008', tag: 'SMART', category: 'smart',
|
||||
|
|
|
|||
Loading…
Reference in a new issue