AWS Lambda Uses for GenAI
Ref: https://www.udemy.com/course/ultimate-aws-certified-generative-ai-developer-professional/learn/lecture/53684673
- 💡 Lambda can be used in a ton of places in GenAI, since it offers focused, short-lived code
- If you need serverless custom code, Lambda probably involved
- Immediate syncing between raw data and DBs
- Connect Bedrock Agents with tools (calling a tool usually involves calling a Lambda)
- Parameter validation & error handling
- On-demand FM invocation without provisioning capacity (just call Bedrock's API with a Lambda function)
- Receive webhooks (integrates with external tools that use webhooks)
- Handle JSON events from APIGW (which acts as FE)
- Custom aggregation logic
- From multiple models (e.g. weighted averaging?)
- Models that vote
Amazon APIGW Uses for GenAI
Ref: https://www.udemy.com/course/ultimate-aws-certified-generative-ai-developer-professional/learn/lecture/53684675
- Frontend for:
- Calling FM models in Bedrock (probably don't want to allow end-users to call Bedrock directly)
- Can implement retry strategies if FMs time out
- Feedback collection (e.g. collect feedback from users on how well the AI system is doing)
- Filter/pre-handle requests:
- Leverage APIGW usage plans to limit traffic
- Throttle end-users who are sending too many requests
- Configure burst capacity
- Validate requests & required fields (e.g. via defined JSON schema)
- Can reject requests with too many tokens
- Implement routing logic with request transformations (can decide which FM to call, and adjust request before calling it)
AWS AppConfig