Fix Bedrock models: remove Nova (no on-demand), add region filtering

- Removed Amazon Nova models (not available for on-demand invocation)
- Replaced DeepSeek V3 with V3.2 (correct model ID)
- Removed Mistral Large 24.07 (us-west-2 only), added Magistral Small
- Added vendor model Opus 4.1, Writer Palmyra X5, Qwen3, Command R
- Each model now has region metadata; getAvailableModels() filters
  to only show models available in the configured AWS_BEDROCK_REGION
- Fixes "on-demand throughput not allowed" and region mismatch errors
This commit is contained in:
Daniel Onyejesi 2026-03-24 17:45:36 -04:00
parent 9437da2c99
commit a0dec0d1d7

View file

@ -27,11 +27,14 @@ var OPENROUTER_MODELS = [
];
var BEDROCK_MODELS = [
// ── Anthropic vendor model — verified IDs from AWS docs (models-supported.html) ──
{ id: 'anthropic/vendor-model-opus-4-6', name: 'vendor model Opus 4.6', cost: '~$0.075', tag: 'BEST NUANCE', category: 'premium',
// ── Anthropic vendor model (all verified on-demand from AWS docs 2026-03) ──
// Wide region availability unless noted
{ 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' },
{ 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' },
{ 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' },
{ id: 'anthropic/vendor-model-sonnet-4-5', name: 'vendor model Sonnet 4.5', cost: '~$0.015', tag: 'SMART', category: 'premium',
@ -41,45 +44,47 @@ var BEDROCK_MODELS = [
{ 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' },
{ 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' },
bedrockId: 'anthropic.agent-config-3-5-haiku-20241022-v1:0', regions: ['us-west-2', 'us-east-1', 'us-east-2'] },
// ── Amazon Nova ──
{ id: 'amazon/nova-pro', name: 'Amazon Nova Pro', cost: '~$0.008', tag: 'SMART', category: 'smart',
bedrockId: 'amazon.nova-pro-v1:0' },
{ id: 'amazon/nova-lite', name: 'Amazon Nova Lite', cost: '~$0.001', tag: 'FAST', category: 'fast',
bedrockId: 'amazon.nova-lite-v1:0' },
{ id: 'amazon/nova-micro', name: 'Amazon Nova Micro', cost: '~$0.0004', tag: 'CHEAPEST', category: 'fast',
bedrockId: 'amazon.nova-micro-v1:0' },
{ id: 'amazon/nova-premier', name: 'Amazon Nova Premier', cost: '~$0.04', tag: 'BEST AMAZON', category: 'premium',
bedrockId: 'amazon.nova-premier-v1:0' },
// ── Meta Llama ──
// ── Meta Llama (on-demand, good for clinical summarisation) ──
{ id: 'meta/llama-4-maverick', name: 'Llama 4 Maverick', cost: '~$0.005', tag: 'NEW', category: 'smart',
bedrockId: 'meta.llama4-maverick-17b-instruct-v1:0' },
bedrockId: 'meta.llama4-maverick-17b-instruct-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2'] },
{ id: 'meta/llama-4-scout', name: 'Llama 4 Scout', cost: '~$0.004', tag: 'NEW', category: 'smart',
bedrockId: 'meta.llama4-scout-17b-instruct-v1:0' },
bedrockId: 'meta.llama4-scout-17b-instruct-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2'] },
{ id: 'meta/llama-3.3-70b', name: 'Llama 3.3 70B', cost: '~$0.003', tag: 'GOOD', category: 'smart',
bedrockId: 'meta.llama3-3-70b-instruct-v1:0' },
bedrockId: 'meta.llama3-3-70b-instruct-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-2'] },
// ── DeepSeek ──
// ── DeepSeek (reasoning + fast) ──
{ id: 'deepseek/r1', name: 'DeepSeek R1', cost: '~$0.005', tag: 'REASONING', category: 'smart',
bedrockId: 'deepseek.r1-v1:0' },
{ id: 'deepseek/v3', name: 'DeepSeek V3', cost: '~$0.001', tag: 'CHEAP', category: 'fast',
bedrockId: 'deepseek.v3-v1:0' },
bedrockId: 'deepseek.r1-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-2'] },
{ id: 'deepseek/v3.2', name: 'DeepSeek V3.2', cost: '~$0.001', tag: 'FAST', category: 'fast',
bedrockId: 'deepseek.v3.2', regions: ['us-east-1', 'us-east-2', 'us-west-2', 'ap-northeast-1', 'eu-north-1'] },
// ── Mistral AI ──
{ id: 'mistral/large-3', name: 'Mistral Large 3 (675B)', cost: '~$0.008', tag: 'PREMIUM', category: 'premium',
bedrockId: 'mistral.mistral-large-3-675b-instruct' },
{ id: 'mistral/mistral-large-2407', name: 'Mistral Large (24.07)', cost: '~$0.006', tag: 'GOOD', category: 'smart',
bedrockId: 'mistral.mistral-large-2407-v1:0' },
bedrockId: 'mistral.mistral-large-3-675b-instruct', regions: ['us-east-1', 'us-east-2', 'us-west-2', 'ap-northeast-1'] },
{ id: 'mistral/magistral-small', name: 'Magistral Small', cost: '~$0.003', tag: 'VALUE', category: 'smart',
bedrockId: 'mistral.magistral-small-2509', regions: ['us-east-1', 'us-east-2', 'us-west-2', 'ap-northeast-1'] },
// ── Cohere ──
// ── Cohere (good for medical text, us-east-1/us-west-2 only) ──
{ id: 'cohere/command-r-plus', name: 'Command R+', cost: '~$0.005', tag: 'GOOD', category: 'smart',
bedrockId: 'cohere.command-r-plus-v1:0' },
bedrockId: 'cohere.command-r-plus-v1:0', regions: ['us-east-1', 'us-west-2'] },
{ id: 'cohere/command-r', name: 'Command R', cost: '~$0.002', tag: 'VALUE', category: 'fast',
bedrockId: 'cohere.command-r-v1:0', regions: ['us-east-1', 'us-west-2'] },
// ── AI21 Labs ──
// ── AI21 Labs (us-east-1 only) ──
{ id: 'ai21/jamba-1.5-large', name: 'Jamba 1.5 Large', cost: '~$0.005', tag: 'GOOD', category: 'smart',
bedrockId: 'ai21.jamba-1-5-large-v1:0' }
bedrockId: 'ai21.jamba-1-5-large-v1:0', regions: ['us-east-1'] },
// ── Writer (medical/clinical writing, us regions) ──
{ id: 'writer/palmyra-x5', name: 'Palmyra X5', cost: '~$0.01', tag: 'CLINICAL', category: 'premium',
bedrockId: 'writer.palmyra-x5-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2'] },
// ── Qwen (strong multilingual medical reasoning) ──
{ id: 'qwen/qwen3-235b', name: 'Qwen3 235B', cost: '~$0.005', tag: 'SMART', category: 'smart',
bedrockId: 'qwen.qwen3-235b-a22b-2507-v1:0', regions: ['us-east-2', 'us-west-2', 'ap-northeast-1', 'eu-central-1'] },
{ id: 'qwen/qwen3-32b', name: 'Qwen3 32B', cost: '~$0.002', tag: 'VALUE', category: 'fast',
bedrockId: 'qwen.qwen3-32b-v1:0', regions: ['us-east-1', 'us-east-2', 'us-west-2', 'ap-northeast-1', 'eu-central-1'] }
];
var AZURE_MODELS = [
@ -95,7 +100,11 @@ var AZURE_MODELS = [
function getAvailableModels() {
switch (activeProvider) {
case 'bedrock': return BEDROCK_MODELS;
case 'bedrock':
var region = process.env.AWS_BEDROCK_REGION || 'us-east-1';
return BEDROCK_MODELS.filter(function(m) {
return !m.regions || m.regions.indexOf(region) !== -1;
});
case 'azure': return AZURE_MODELS;
case 'openrouter':
default: return OPENROUTER_MODELS;