Deploying AI Workloads on AWS: A Practical Guide

Carson Rodrigues

Carson Rodrigues / May 26, 2026

8 min read––– views

There's a big gap between "my AI feature works on my laptop" and "my AI feature runs reliably for real users without setting my AWS bill on fire." Closing that gap is mostly infrastructure decisions — and AWS gives you a lot of rope, which means a lot of ways to get it right or wrong. This is the practical guide I'd give an engineer about to deploy an AI workload on AWS for the first time.

I'll focus on the decisions that matter, not an exhaustive service tour.


First: do you even need to host a model?

The most important architecture decision happens before you touch AWS: are you calling a hosted model API, or running your own?

  • Calling an API (Anthropic, OpenAI, or Amazon Bedrock for managed access to multiple models) — your "AI infra" is mostly just your application servers plus good API hygiene. This is the right answer for the large majority of products.
  • Self-hosting a model — you take on GPUs, scaling, and a whole category of ops. Only worth it for real reasons: data residency, cost at massive scale, latency control, or a fine-tuned/open-weight model you must run yourself.

Most teams should start with hosted APIs and only move to self-hosting when they can name the specific constraint forcing the change. I'll cover both paths.


The hosted-API path (start here)

If you're calling an LLM API, your AWS footprint is refreshingly normal:

  • Compute: Run your app on Fluid/serverless functions (Lambda) for spiky traffic, or ECS/Fargate for steady traffic and longer-running requests. AI requests can be slow, so mind timeouts — streaming responses helps both UX and timeout pressure.
  • Amazon Bedrock: If you want managed access to multiple foundation models with one integration, billing, and IAM story, Bedrock is the clean AWS-native option. It also keeps your model calls inside your AWS security perimeter.
  • API keys & secrets: Never in code or env files in the repo. Use AWS Secrets Manager or SSM Parameter Store, and rotate. (This is a hill I'll die on — secrets never enter git.)
  • Queues for long jobs: For anything that isn't interactive — batch summarization, document processing — put work on SQS and process asynchronously instead of blocking a request.

This path gets you to production fast, scales well, and keeps the ops surface small.


The self-hosting path (when you must)

If you genuinely need to run your own model on AWS:

  • GPUs: EC2 GPU instances (the g and p families) or SageMaker endpoints for managed hosting. SageMaker handles a lot of the serving boilerplate; raw EC2 gives you control and sometimes better cost.
  • Cold starts are brutal. Loading model weights takes time. You'll likely want warm, always-on capacity for latency-sensitive paths — which means paying for idle GPU. Budget for it.
  • Autoscaling is hard with GPUs. They're expensive and slow to spin up. Plan capacity around real traffic patterns rather than hoping to scale reactively second-to-second.
  • Consider managed inference. Before committing to self-hosting, price out Bedrock or a specialist inference provider. Self-hosting often looks cheaper until you add the engineering time and idle-GPU cost.

The honest take: self-hosting is a real commitment. I steer teams toward hosted inference unless there's a hard requirement that forces the issue.


Cost: the thing that surprises everyone

AI workloads have a cost profile that catches people off guard:

  • Token cost dominates on the hosted path. Optimize your prompts, cache aggressively, and tier your models (cheap model for easy steps, expensive model for hard ones — see my agents post).
  • Idle GPU dominates on the self-hosted path. An always-on GPU you're not fully using is pure waste.
  • Set billing alarms. CloudWatch billing alarms and AWS Budgets are the cheapest insurance you'll ever buy. One runaway loop or a misconfigured batch job can cost a month's budget in a night.
  • Cache at every layer. Prompt caching, response caching for identical requests, and CDN caching for anything static. Each layer you add is latency and cost you don't pay twice.

Latency and reliability

A few patterns that consistently pay off:

  • Stream responses. Use streaming (and an architecture that supports it end-to-end) so users see output immediately. Perceived latency is the latency that matters.
  • Pick the right region. Run compute close to the model endpoint and close to your users when you can. Cross-region hops add up.
  • Build in retries and fallbacks. Model APIs have transient errors and rate limits. Retry with backoff, and have a fallback model or a graceful degradation path. Don't let one upstream hiccup take down your feature.
  • Observability. Log latency, token counts, error rates, and cost per request from day one. You can't optimize what you can't see, and AI costs hide in the aggregate.

A sensible default architecture

For a typical product calling a hosted model on AWS, here's the shape I reach for:

  1. App on Fargate (or Lambda for spiky traffic), behind an ALB / API Gateway.
  2. Model access via Bedrock or a direct provider API, keys in Secrets Manager.
  3. Long-running or batch work on SQS + worker tasks.
  4. Retrieval data in a managed store (e.g. a vector-capable database) accessed at request time.
  5. Caching at the prompt and response layers; CloudFront for static assets.
  6. CloudWatch for logs/metrics, Budgets + billing alarms wired before launch.

It's deliberately boring. Boring scales and pages you less.

If your workload outgrows this — lots of containers, GPU scheduling, complex orchestration — that's the point where Kubernetes for AI/ML workloads starts to earn its complexity.


The takeaway

Deploying AI on AWS is mostly normal cloud engineering with two twists: token/GPU cost can surprise you, and latency is a first-class feature. Start on the hosted-API path with a boring, observable architecture; reach for self-hosting only when a hard requirement forces it; and wire up billing alarms before you launch, not after the scary invoice. Get those right and the AI part is the easy part.


Related reading

Available for senior AI / contract / FDE work

Building something with AI?

Voice agents, MCP servers, LLM pipelines, agentic workflows — pick a slot, drop a message, or send your email and I'll reply within a day.

or leave your email

Replies within ~24 hours · Remote-first · global · open to relocation