Backend
Deployment
Containers or serverless, timeouts that fit LLM latency, environments and gradual rollouts.
What it is and why it exists
LLM backends are I/O-bound and long-running per request, which shapes deployment: serverless functions are easy but have timeout and streaming limits; containers on ECS/Kubernetes/Cloud Run handle long streams and websockets. Prompts and models need the same staged rollout as code.
Quick prototype
One VM or a hobby platform.
In production, at scale
Containers with health checks, autoscaling on concurrency, separate dev/staging/prod keys and limits, feature flags for prompt/model versions, canary releases watched on quality and cost metrics, and infrastructure as code.
Vendors and tools
| Docker / Kubernetes / Cloud Run | Containers |
|---|---|
| Vercel / Fly.io / Render | Platform hosting |
| Terraform / Pulumi / CDK | Infrastructure as code |
On AWS: ECS on Fargate behind ALB, Lambda with response streaming for lighter endpoints, App Runner; CDK or Terraform.
How it fails
- Serverless function timeout shorter than the agent run
- Prompt change shipped to 100% at once
What the interviewer asks next
Lambda or Fargate for a chat backend?
Fargate (or another container platform) when streams are long, connections persistent or work is unpredictable; Lambda for short, spiky, stateless endpoints and event-driven pipelines.