Type something to search...
LLM Inference on AWS: Every Option Explained

LLM Inference on AWS: Every Option Explained

AWS gives you two fundamentally different ways to run an LLM -

  • SageMaker, you provision and pay for the infrastructure that serves the model.
  • Bedrock, AWS already runs the model, and you just call an API.

Under SageMaker there are four separate inference options — three of them are persistent or on-demand “endpoints,” one is a batch job. This article explains what each option actually is, starting from some basics like “inference” itself.

Inference on AWS

Inference is the act of using an already-trained model to make a prediction on new data. It’s the second half of the ML lifecycle, and it’s a different process from training.

Training happens once (or periodically): you feed the model a large labeled dataset so it learns patterns, and the output is a saved file of weights. Inference happens every time you ask that already-trained model a question — every API call to a deployed model, every chatbot reply, every classification of a new image is one inference request. Nothing is being learned or updated at inference time; the model is just applying what it already learned.

This distinction matters because everything that follows — endpoints, deployment, serving — exists purely to answer inference requests against a model that’s already finished training.

Inference Endpoints

An inference endpoint is a persistent, addressable web service standing in front of your trained model. It’s conceptually similar to a web server you’ve deployed yourself — it waits for requests and answers them via an API call (InvokeEndpoint on SageMaker).

Deployments

A trained model by itself is just a weights file. Deploying it means assembling four things and standing them up on compute:

  1. The weights file (typically an S3 object)
  2. An inference container — a Docker image with the ML framework runtime (PyTorch, TensorFlow, etc.)
  3. A serving layer inside that container that loads the weights into memory and, for each request, runs one forward pass and returns the output
  4. Actual compute to run the container on

“Deploying” is AWS taking your weights and container, provisioning compute, booting the container, loading the weights into memory, and putting a stable API in front of it. Loading weights into memory is the slow part of this process — it’s where cold starts come from, and it explains why the four options below trade off differently on latency versus idle cost.

What Are SageMaker’s Four Inference Options?

Three of the four are endpoints, sharing the same CreateEndpoint / InvokeEndpoint pattern. The fourth is a job for batch-processing workloads.

1. Real-Time Inference

This is the classic always-on API — a chatbot backend, a recommendation service — for workloads with steady, unpredictable-but-frequent traffic. You deploy your model to a dedicated, SageMaker-managed instance (no OS access) that stays running continuously and answers requests in sub-second time. Because the instance is always on, it keeps billing whether or not it’s serving a request.

2. Serverless Inference

Same InvokeEndpoint API as real-time, but no instance sits around between requests. You specify a memory size and max concurrency. When a request arrives, SageMaker pulls capacity from its underlying shared fleet and boots a container loading your specific model artifact into it. If no further traffic arrives, that capacity is torn down and you stop paying. The tradeoff is the cold-start that can run into multiple seconds for larger models. You pay per request/duration rather than per hour of uptime.

3. Asynchronous Inference

You call this via InvokeEndpointAsync when payloads or processing times are too large for a synchronous HTTP response (payloads up to 1GB, processing up to an hour). Async runs on provisioned instances. SageMaker drops it into an internal queue and hands you back an S3 location where the results are delivered; the instance picks the request up off that queue and works through it whenever it gets to it. You can autoscale the instance count down to zero when the queue sits empty, avoiding idle billing.

4. Batch Transform

This is a job, not an endpoint. You point it at a dataset already sitting in S3; it spins up instances, processes the entire dataset, writes predictions back to S3, and terminates. Invoked via CreateTransformJob, it is closer to kicking off a Spark job than calling an API.

Bedrock: Where It Stands

Every option above still requires choosing a container and compute config; Bedrock skips that. Bedrock is for calling one of the frontier models (or other available models) that are already deployed on AWS infrastructure by their respective model companies — Anthropic, Meta, Amazon, and others provide Claude, Llama, Titan, Mistral, and more, all running on AWS-operated infrastructure shared across every Bedrock customer. You call InvokeModel or Converse, pass a model ID and a prompt, and get tokens back, billed per input/output tokens rather than compute. See AWS Bedrock vs SageMaker: How to Pick the Right One for more.

Can You Bring Your Own Model to Bedrock?

Yes, but more narrowly than on SageMaker. Two paths:

  • Fine-tuning — customize a subset of Bedrock’s foundation models (some Titan, Llama, and Cohere models) on your own data. You get a customized version of an existing model, not an arbitrary architecture (architectures are covered next).
  • Custom Model Import — bring a compatible open-weight model you fine-tuned elsewhere (often on SageMaker) and Bedrock hosts it behind the same InvokeModel API.

Calling a fine-tuned or imported model at real volume generally requires Provisioned Throughput — a reserved capacity unit billed hourly whether or not you’re calling it. That’s the one place the SageMaker real-time problem — always warm, always billing — reappears inside Bedrock.

A Note on Supported Architectures

Architecture is the blueprint of the neural network — layer count, attention mechanism, vocabulary handling — coded into a specific model class. Weights are the learned numbers that fill in that blueprint after training. Custom Model Import doesn’t execute arbitrary code; it only knows how to load a fixed set of architectures, so your weights have to fit one of them.

As of this writing, the supported architectures are:

  • Mistral — decoder-only transformer with Sliding Window Attention, optional Grouped Query Attention
  • Mixtral — decoder-only, sparse Mixture-of-Experts
  • Flan — encoder-decoder, T5-based
  • Llama family — Llama 2, 3, 3.1, 3.2, 3.3, and Mllama
  • GPTBigCode — an optimized GPT-2 variant with multi-query attention
  • Qwen family — Qwen2, 2.5, 2-VL, 2.5-VL, and Qwen3 (Qwen3 only via its ForCausalLM/MoeForCausalLM classes, without Converse API support)
  • GPT-OSS — OpenAI’s open-weight architecture, 20B and 120B sizes, US East (N. Virginia) only, callable only through InvokeModel with an OpenAI-style schema, not Converse

Fixed constraints apply regardless of architecture: weights under 100GB (multimodal) or 200GB (text-only), a maximum context length under 128K, and model files supplied in Hugging Face format (.safetensors plus config.json).

In practice, this feature is built for teams who fine-tuned an open-weight Hugging Face model — often on SageMaker — and want Bedrock’s managed hosting instead of running their own endpoint.

All Five Options at a Glance

OptionTypeLatencyBillingBest For
Real-Time InferenceSageMaker endpointSub-second, consistentlyPer instance-hour, continuously — whether or not it’s servingSteady, latency-sensitive traffic
Serverless InferenceSageMaker endpointSub-second once warm; multi-second cold start after idlePer request/durationSpiky, unpredictable traffic
Asynchronous InferenceSageMaker endpointSeconds to minutes — queued, not synchronousPer instance-hour, only while instances are runningLarge payloads or long-running requests arriving individually
Batch TransformSageMaker jobMinutes to hours — whole dataset, one runPer instance-hour, only for the job’s durationA whole dataset processed at once
BedrockManaged API, no endpoint to runSub-second, consistently — no cold startPer input/output tokenUsing an already-deployed foundation model

Key Takeaways

  • Inference is using an already-trained model to answer a new request — distinct from training, which happens separately and earlier.
  • SageMaker has four inference options: real-time, serverless, and asynchronous are all endpoints; batch transform is a job with no persistent endpoint at all.
  • Real-time inference is the only one of the four that bills continuously regardless of traffic — the others scale down or only run for the job’s duration.
  • Bedrock skips infrastructure decisions entirely: no containers, no instances. You just use it via API call per-token billing on models AWS already hosts.
  • Bringing your own model to Bedrock is possible via fine-tuning or Custom Model Import, but only for a fixed list of supported open-weight architectures — SageMaker remains the option for anything outside that list.

Once the mechanics make sense, the actual decision — which of these fits your workload — is covered in AWS Bedrock vs SageMaker: How to Pick the Right One.

Not sure which of these fits your workload?

Book a 30-minute call with Pratik — no pitch deck, no pressure, just a straight read on whether your workload belongs on Bedrock, SageMaker, or both.

Book an intro call

Related Posts

What an AI Agent Costs Per Conversation on AgentCore

What an AI Agent Costs Per Conversation on AgentCore

You can read AgentCore's per-service rates straight off the AWS pricing page. What that page can't tell you — and what you actually need before you build a business on agents — is what one of your u

Read more
Bedrock Agents vs AgentCore: What to Use Now

Bedrock Agents vs AgentCore: What to Use Now

Updated 2 September 2026: Amazon Bedrock Agents Classic moved to maintenance mode in June 2026. This post has been rewritten around the options that are actually available now. **Amazon Bedrock Age

Read more
Connect Claude Code to Live AWS Tools with the Agent Toolkit

Connect Claude Code to Live AWS Tools with the Agent Toolkit

AI coding agents are getting remarkably capable — but they have a blind spot. The models powering them were trained on data that's months or years old. When you ask your agent about Amazon S3 Tables,

Read more
Why Your AWS Bedrock Bill Makes No Sense (And How to Fix It)

Why Your AWS Bedrock Bill Makes No Sense (And How to Fix It)

When a startup says "our AWS bill is too high," the conversation almost always starts at the aggregate level — total monthly spend, a few large services, maybe a spike someone noticed. That's not wher

Read more
AWS Bedrock Cost Structure: What You're Actually Paying For

AWS Bedrock Cost Structure: What You're Actually Paying For

AWS Bedrock looks simple from the outside — call an API, get a response, pay per token. The reality is that a production Bedrock setup has several distinct cost layers, and they behave very differentl

Read more
AWS Bedrock vs SageMaker: How to Pick the Right One

AWS Bedrock vs SageMaker: How to Pick the Right One

If you're building an AI product on AWS, you'll hit this question early: Bedrock or SageMaker? The short answer is that they solve different problems, and most startups only need one. What Each Se

Read more
Stretch Your Claude Code Budget with Bedrock Prompt Caching

Stretch Your Claude Code Budget with Bedrock Prompt Caching

Anthropic recently tightened usage limits on Claude Code — and if you're doing serious development work, you feel it. Long refactoring sessions, codebase-wide architecture questions, iterative debuggi

Read more
When Is Self-Hosting an LLM Cheaper Than Bedrock?

When Is Self-Hosting an LLM Cheaper Than Bedrock?

Two questions send teams down this path: "our Bedrock bill is growing, should we run this on our own GPU?" and "we fine-tuned a Llama, where does it go?" For most teams the answer to both is no, a

Read more
Cheaper Alternatives to AWS in 2026: What Each One Cuts

Cheaper Alternatives to AWS in 2026: What Each One Cuts

There is no single cheapest alternative to AWS, because AWS bills are not shaped the same way. A bill dominated by EC2 has a different answer from one dominated by egress, RDS or GPU-hours. And severa

Read more
Deploying Engineering Resource Management Knowledge Graph on AWS

Deploying Engineering Resource Management Knowledge Graph on AWS

Resource planning in engineering orgs is a multi-hop problem. The data is there — skills, project history, availability — it's just stored in flat tables that you need to join on demand. This post wal

Read more
Hetzner vs AWS: The Real Cost Difference in 2026

Hetzner vs AWS: The Real Cost Difference in 2026

For a standing 8-vCPU, 16 GB server, AWS charges about $212 per month on demand and Hetzner charges €20.99, or roughly $25. That is a factor of nine, and it is not a rounding error. The gap is also no

Read more
RAG, GraphRAG, and Knowledge Graphs: What's Actually Different

RAG, GraphRAG, and Knowledge Graphs: What's Actually Different

LLMs are stateless. They don't know your documents, your internal data, or what changed last week. They're only as good as what you put in front of them. This gave rise to what's now called context en

Read more
Leaving AWS for Hetzner: What You Have to Rebuild

Leaving AWS for Hetzner: What You Have to Rebuild

Moving from AWS to Hetzner keeps compute, block storage, private networking, load balancers, DNS and object storage, and replaces the managed database, the managed Kubernetes control plane, IAM, Cloud

Read more
Model Evals: How to Know If You Can Use a Cheaper Model

Model Evals: How to Know If You Can Use a Cheaper Model

An eval, in the AI FinOps context, is a structured comparison: run a representative sample of real production inputs through your current model and a cheaper candidate, score both against a defined qu

Read more
How to Build RAG on Your S3 Documents with Bedrock

How to Build RAG on Your S3 Documents with Bedrock

If your documents already sit in Amazon S3 and you want to ask questions of them, the shortest path on AWS is Amazon Bedrock Managed Knowledge Base: point it at the bucket, and it handles parsing,

Read more
S3 Vectors vs OpenSearch Serverless for RAG on AWS

S3 Vectors vs OpenSearch Serverless for RAG on AWS

This is a choice you only face on the customer-managed path — if you have not ruled out the fully managed option yet, [building RAG on your S3 documents with Bedrock](/blog/rag-on-s3-documents-with-be

Read more
What Is a Knowledge Graph?

What Is a Knowledge Graph?

A knowledge graph stores information as entities and the relationships between them — not rows and columns, but a web of connected facts. The Idea Is Simple Three building blocks:Nodes —

Read more
What Is AI FinOps?

What Is AI FinOps?

AI FinOps is the practice of making AI workload costs visible, attributable, and optimizable — applied to the specific economics of model inference, where the unit of cost is the token, not the instan

Read more
What Is Amazon Bedrock AgentCore? (And When to Use It)

What Is Amazon Bedrock AgentCore? (And When to Use It)

Amazon Bedrock AgentCore is a managed platform for deploying and operating AI agents you've already built — in any framework, with any model — without managing the runtime, memory, identity, or observ

Read more