Most tutorials for building an AI chat app start by spinning up a Node.js or Python backend server, configuring Docker, and babysitting an EC2 instance or container service.
You don't need any of that.
Combining a static HTML frontend with an Amazon API Gateway WebSocket API and AWS Lambda gives you real-time, bidirectional user interaction and token-by-token LLM streaming—with zero servers to manage , automatic scaling to zero when idle, and near-\$0 running costs.
In this step-by-step guide, you'll build and deploy a complete serverless streaming AI chat app on AWS using:
Amazon S3 + CloudFront for static HTML hosting
Amazon API Gateway (WebSocket API) for persistent bidirectional wss:// connections
AWS Lambda (Python 3.12) for connection lifecycle and token streaming
Amazon DynamoDB for tracking active WebSocket connections
Amazon Bedrock (Amazon Nova Micro) for ultra-fast, low-cost LLM inference
The Honest Truth About Using a "Free" LLM on AWS
Before writing a single line of code, let's clear…