Experimental
@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
DefaultPromptRouterIdentifier Class
Represents identifiers for default prompt routers in Bedrock.
These are pre-configured routers provided by AWS that route between different models in the same family for optimal performance and cost.
Example
ts
// Create a prompt router for intelligent model selection
const promptRouter = bedrock.PromptRouter.fromDefaultId(
bedrock.DefaultPromptRouterIdentifier.ANTHROPIC_CLAUDE_V1,
'us-east-1'
);
// Use the prompt router with a prompt variant
const variant = bedrock.PromptVariant.text({
variantName: 'variant1',
promptText: 'What is the capital of France?',
model: promptRouter,
});
new bedrock.Prompt(this, 'Prompt', {
promptName: 'prompt-router-test',
variants: [variant],
});
Properties
ANTHROPIC_CLAUDE_V1DefaultPromptRouterIdentifieranthropic_claude_v1DefaultPromptRouterIdentifierANTHROPIC_CLAUDE_V1DefaultPromptRouterIdentifierANTHROPIC_CLAUDE_V1DefaultPromptRouterIdentifierANTHROPIC_CLAUDE_V1DefaultPromptRouterIdentifierstatic#Anthropic Claude V1 router configuration.
Routes between Claude Haiku and Claude 3.5 Sonnet models for optimal balance between performance and cost.
META_LLAMA_3_1DefaultPromptRouterIdentifiermeta_llama_3_1DefaultPromptRouterIdentifierMETA_LLAMA_3_1DefaultPromptRouterIdentifierMETA_LLAMA_3_1DefaultPromptRouterIdentifierMETA_LLAMA_3_1DefaultPromptRouterIdentifierstatic#Meta Llama 3.1 router configuration. Routes between different sizes of Llama 3.1 models (8B and 70B) for optimal performance based on request complexity.
promptRouterIdstringprompt_router_idstrpromptRouterIdStringPromptRouterIdstringPromptRouterId*string#The unique identifier for this prompt router.
routingModelsBedrockFoundationModel[]routing_modelstyping.List[BedrockFoundationModel]routingModelsList<BedrockFoundationModel>RoutingModelsBedrockFoundationModel[]RoutingModels*[]BedrockFoundationModel#The foundation models that this router can route between.