QuestionQ28

Implementation and Integration

An ecommerce company runs a global product recommendation system that must switch among multiple foundation models (FMs) in Amazon Bedrock based on regulations, cost optimization, and performance requirements. The company must enforce custom controls based on proprietary business logic, including dynamic cost thresholds, AWS Region-specific compliance rules, and real-time A/B testing across multiple FMs. The system must be capable of switching between FMs without deploying new code. It must route user requests according to complex rules that include user tier, transaction value, regulatory zone, and real-time cost metrics that change hourly and need immediate propagation across thousands of concurrent requests.

Which solution meets these requirements?

Explanation

AWS AppConfig lets applications use centrally managed configuration that can be updated independently of application code. A Lambda function can obtain the current routing configuration through the AWS AppConfig Agent and execute arbitrary business logic for each request to select and invoke the appropriate Amazon Bedrock foundation model. This supports dynamically changing thresholds, Region-specific rules, and A/B-routing logic behind one API endpoint. API Gateway transformations and variables are not a suitable engine for complex dynamic routing, and Lambda authorizers are designed for authorization rather than model selection.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!