Zero Labs
Industry News / AI

How Many RAG Users Fit on One GPU? A Five-Step Check

Source · Towards AI By Mehedi Hasan

From the publisher’s feed, collected in the ZeroLabs newsroom.

You tuned the chunking, the embeddings and the reranker. Then you picked the generator model by leaderboard. Here is the memory check to run first, with a worked example.Image by author.You spent weeks on retrieval quality. Chunk sizes, embeddings, a reranker, evaluation sets. Then you picked the answer-generating model the way most teams do: by leaderboard score and parameter count.A month later you are in a meeting about why the GPU bill is double the estimate, or why latency spikes at 3 p.m. every day.In RAG apps, memory is often the first limit you hit, and you can estimate it in ten minutes before you benchmark anything.TL;DRRAG prompts are long because they carry retrieved chunks. Long prompts mean a big KV cache per user.Fitting on a GPU means weights + KV cache for all concurrent users + overhead. A model with a small cache can still fail on weights.Your retrieval settings (top-k, chunk size) are a capacity knob. Going from 3 to 20 chunks cut capacity by roughly 70% in my example.Run a five-step fit check first, then benchmark quality on your own data.This is Part 3 of a series. Part 2 derives the KV cache formula and gives you a script; Part 1 is the non-technical version. The architecture comparisons behind it are Sebastian Raschka’s Big LLM Architecture Comparison.1. Why RAG is a memory-heavy workloadA chatbot prompt might be 200 tokens. A RAG prompt is your system instructions, the user’s question, conversation history and every retrieved chunk. Eight chunks of 500 tokens is already 4,000 tokens before anything else.Every one of those tokens sits in the KV cache for as long as the request is alive, and every concurrent user has their own copy. So in RAG the cache is often what limits how many users one GPU can serve at once, while the long prefill drives latency.2. A worked example (hypothetical numbers)This is a made-up workload to show the method, not a benchmark of any real system.One 80 GiB GPU (an “80 GB” card has about 80 GiB of memory)32 concurrent users at peakEach request: 1,500 tokens (system prompt, question, history) + 8 retrieved chunks × 500 tokens + a 500-token answer = 6,000 tokens16-bit KV cache, and an assumed flat 8 GiB for runtime overheadI compared three open models that could plausibly run on one GPU. Their per-token cache sizes come from the formula in Part 2.Image by author. Weights are approximate; the workload is hypothetical.Image by author. Hypothetical workload; weights approximate.The table makes four points.The smallest cache is not the smallest bill. Qwen3–30B-A3B has a smaller cache than Llama 3 8B (4 KV heads against 8, even with more layers), yet it is the one that does not fit. Its 30.5B parameters take about 57 GiB in 16-bit.Active parameters are not memory. Qwen3–30B-A3B activates only 3.3B parameters per token, which makes it fast, but you still have to load all 30.5B. The “A3B” saves compute, not memory.One lever can flip the answer. Storing Qwen3’s cache in 8-bit brings the total to 74 GiB and it fits. That lever needs a quality test first.Attention design changes the picture. gpt-oss-20b ships 4-bit expert weights (21B total parameters, 3.6B active) and alternates sliding-window layers with full-attention layers, so its cache stays small. That saving depends on your inference engine actually freeing out-of-window cache, so confirm it on yours.Fitting is only the first filter. Whether a model answers your questions well enough is a separate test (step 5 below).3. Your retrieval settings are a capacity knobTop-k is usually tuned for answer quality, and nobody looks at what it does to capacity.Image by author. Assumes 500-token chunks; hypothetical workload.Going from 3 to 20 retrieved chunks, capacity falls from 133 to 38 users for Llama 3 8B, 46 to 13 for Qwen3–30B-A3B, and 710 to 212 for gpt-oss-20b. Each model’s budget is whatever memory is left after weights and overhead, which is why Qwen3’s line sits lowest. Every model loses roughly 70% of its users.If a reranker lets you pass 5 good chunks instead of 20 mediocre ones, you improve quality and capacity together: about 2.6 to 2.8x more users in this example. That is often the cheapest change available, and you can test it in an afternoon.4. The five-step fit checkImage by author.Read KV bytes per token from the model’s config.json. Layers, KV heads, head dimension. The script from Part 2 does this for you.Estimate tokens per request. System prompt + question + history + top-k × chunk size + answer. Use your P95, not your average.Multiply by peak concurrent users. Peak, not typical. Your 3 p.m. spike is the number that matters.Add weights and overhead. Weights = parameters × bytes per parameter. Leave headroom for the runtime and temporary buffers (I assumed a flat 8 GiB, about 10%).Compare to GPU memory. If it fits, benchmark answer quality on your own questions and documents, then pick the cheapest model that passes. Sliding-window layers and a quantized cache can change how well a model uses information buried in a long prompt, so test with your own documents. If it does not fit, change one lever and repeat steps 2 to 4.5. If it does not fit: the levers, in orderRetrieve fewer, better chunks. Free, and often improves quality.Shorten the system prompt and the history you carry per turn.Quantize the KV cache to 8-bit. It roughly halves cache memory. Test quality first.Pick a model with a cheaper attention design: fewer KV heads, latent attention (MLA) or sliding-window layers.Add GPUs. The most expensive lever, so it comes last.6. Two mistakes to avoidSizing on the average prompt. The long tail sets your capacity.Forgetting the rest of the pipeline. If your embedding model or reranker shares the GPU, count it.The checklist to copy[ ] KV bytes per token computed from config.json[ ] P95 tokens per request estimated (prompt + top-k × chunk size + answer)[ ] Peak concurrent users measured or estimated[ ] Weights + KV cache + overhead compared to GPU memory[ ] Retrieval settings reviewed for capacity, not only quality[ ] 8-bit KV cache considered and quality-tested[ ] Quality benchmark run on my own questions and documents[ ] Decision recorded with the numbers behind itPost your top-k, P95 prompt length, model and GPU in a response. I’ll run the fit check on a few of them and write up the results.LLM Architecture for People Who Ship: Part 1: Why One AI Model Can Serve 4x More Users on the Same GPU · Part 2: KV Cache Size: How Many Users Fit on One GPU? · Part 3: How Many RAG Users Fit on One GPU?How Many RAG Users Fit on One GPU? A Five-Step Check was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.