Maximizing Foundation Model Throughput
This lesson covers token flow, batching and concurrency techniques that increase how much work a generative AI system completes per unit of time, since throughput is limited by token quotas or GPU capacity rather than CPU.
Learning outcomes
After completing this lesson, you will be able to:
- Reduce tokens per request to increase capacity.
- Separate bulk work from interactive traffic with batch inference.
- Manage concurrent invocations to avoid throttling storms.
Token processing optimisation
Model quotas and GPU capacity are both consumed in tokens, so the number of requests that the same capacity can serve depends on how many tokens each request uses. Every token saved per request raises throughput. Shorter prompts, fewer retrieved chunks, prompt caching of repeated prefixes and shorter outputs all increase the number of requests served before a quota or a GPU is saturated.
On self-hosted models, the serving engine determines how many tokens per second a GPU delivers. Continuous batching keeps the GPU busy by adding new requests to a running batch as others finish, paged attention fits more concurrent requests into GPU memory, and quantisation reduces the memory and compute each token needs.
Tokens and throughput
Batch inference strategies
Interactive users and bulk jobs compete for the same on-demand quota, so a large overnight job can cause throttling for users who arrive early. Work that does not need immediate results therefore moves to Bedrock batch inference, which has its own quotas separate from on-demand traffic and costs less for supported models.
Large workloads are split into several input files within the per-job limits and run as concurrent jobs, up to the account's quota for batch jobs. Scheduling batch work outside interactive peaks, and pre-computing results that users are likely to request, such as summaries of new documents, keeps on-demand capacity free for the requests that need an immediate answer.
The following diagram compares two designs for a nightly enrichment job that shares capacity with interactive users.

Concurrent invocation management
Uncontrolled concurrency causes throttling storms: many clients hit the quota, retry together and fail again. Concurrency management keeps in-flight requests at a level the quota supports: SQS queues with a fixed number of workers, Lambda reserved concurrency or event source maximum concurrency, semaphores or thread pools in application code, and token-bucket rate limiters that budget tokens per minute. Distributed Map in Step Functions sets a maximum concurrency for large fan-outs. Cross-Region inference profiles spread load across Regions, and quota increases raise the ceiling.
import asyncio
limit = asyncio.Semaphore(8) # at most 8 concurrent model calls
async def summarize(doc):
async with limit:
return await asyncio.to_thread(call_converse, doc) # boto3 is synchronous, so run it in a thread
async def main():
return await asyncio.gather(*(summarize(d) for d in documents))
results = asyncio.run(main())The following table summarises throughput techniques.
| Technique | Effect on throughput |
|---|---|
| Fewer tokens per request | More requests within the same TPM quota |
| Batch inference for bulk work | Separate quotas; interactive capacity freed |
| Queues and bounded concurrency | Steady flow without throttling storms |
| Cross-Region inference | Pooled capacity across Regions |
| Continuous batching (self-hosted) | More tokens per second per GPU |
Throttling storms
Nightly enrichment competing with users
A nightly job enriches 500,000 product records with generated attributes through on-demand calls. It overruns into the morning and interactive users are throttled.
Moving the job to batch inference, split into several files, removes it from the on-demand quota and lowers its cost; any remaining on-demand bulk work goes through a queue with bounded concurrency.
What bounds the throughput of a foundation model?
Show answer
Tokens per minute, so saving tokens increases throughput.
Exam Tips
Remember for the exam
- FM throughput is bounded by tokens per minute; save tokens to gain throughput.
- Move bulk work to batch inference with its own quotas.
- Bound concurrency with queues, reserved concurrency and rate limiters.
- Cross-Region inference pools capacity across Regions.