← Blog

How much VRAM does a local RAG system really need?

Agile Store · 18 November 2026 · 17 min read

  • RAG
  • Buying guide
  • Language models (LLM)
  • Tesla P4 8 GB
  • Tesla P40 24 GB
  • Tesla V100 16 GB
  • Tesla V100 32 GB
  • A2 16 GB
  • 0
  • 0

Short answer: the language model alone is not the whole bill. If you budget VRAM for the LLM alone, sooner or later some process in production will end with an OOM error, because alongside the model, on the same card, there also has to be room for the embedder, and, if you use a GPU index, for the vector database too. The difference between "the card is enough" and "the process ends with a CUDA out of memory error in production" is the 1 to almost 8 GB of the embedder that nobody counted at the planning stage.

We sell used Tesla cards: treat that as an explicit disclosure of interest. The VRAM figures in this post come from runs on our own test bench, not from manufacturers' datasheets: the same model, the same backend, different cards and quantisations. If you are planning a local RAG system and wondering whether your 16 GB card will be enough or whether you really need to go to 24 GB, this post is meant to give you figures from which you can work out your own budget.

One guiding example: a VRAM budget for the whole pipeline

Imagine the IT team of a medium-⁠sized company that has been given a task: set up a local RAG system over internal documentation, without sending data to the cloud. The hardware supplier has been asked "which card will be enough?", and this is where the problem starts, because the answer depends on three things at once: which quant of the model you use, how long a context you inject from retrieval, and which embedder shares the card with the LLM.

In this post I stick to one set: the Bielik-⁠11B-⁠v2.3-instruct model (SpeakLeash) as the LLM, and two embedders, e5-⁠large and bge-⁠m3, because those are the ones we measured. Everything runs through Ollama (the LLM; we did not log the OLLAMA_NUM_PARALLEL value, which we state as a limitation of reproducibility) and through a standard embedding stack (the embedders), on the P40 24 GB, V100 16 GB and V100 32 GB cards, and for the embedders alone also on the P4 8 GB and A2 16 GB (we also measured the P4 for the LLM: I refer to that only in one caveat under the scenario table). Before we get to the figures: this is one model, two embedders, one backend. A different LLM (e.g. larger than 11B), a different runtime (llama.cpp with other settings, or vLLM on newer cards, which reserves 92% of the card's memory by default) or a different embedder will have a different VRAM profile: do not extrapolate these figures directly to another architecture without your own measurement.

VRAM of the LLM alone: quant and context make the difference

Let us start with the most obvious variable: quantisation. The higher the precision of the weights, the more VRAM the model itself takes, before you even add the context.

Card Quant VRAM peak @ ctx 512 VRAM peak @ ctx 8192
P40 Q4_K_M 6.57 GB 8.18 GB
P40 Q5_K_M 7.66 GB 9.26 GB
P40 Q8_0 11.30 GB 12.91 GB
V100-⁠16 Q4_K_M 6.88 GB 8.49 GB
V100-⁠16 Q5_K_M 7.97 GB 9.57 GB
V100-⁠16 Q8_0 11.61 GB 13.09 GB
V100-⁠32 Q4_K_M 6.88 GB 8.49 GB
V100-⁠32 Q5_K_M 7.97 GB 9.57 GB
V100-⁠32 Q8_0 11.61 GB 13.22 GB

All VRAM values in this post are a reading of the whole card's usage at the moment of peak, converted to binary GB (1 GB = 1024 MiB), i.e. on the same scale as the system uses to show a card's "16 GB". Each point is a single run on one unit of each card, using one methodology for all cards: where I write about a pattern, I mean a consistent pattern on our units, not a result from repeats.

A few things stand out. First, the jump from Q4 to Q8 is 4.6–⁠4.7 GB on each of the three cards: Q8_0 at ctx 512 takes about 1.7 times as much as Q4_K_M at the same context. If your VRAM budget is tight, the quant is the first lever you reach for, before you start thinking about another card.

Second, the context adds to VRAM usage, but less than you might think. With Q4_K_M the difference between ctx 512 and ctx 8192 is 1.6 GB (on each of the three cards, almost to the megabyte): real, but not dramatic. With Q8_0 it is 1.5–⁠1.6 GB, i.e. the same absolute increase, but smaller in percentage terms, because the base (the model itself) is larger. This is important information for planning a RAG system: within the tested range up to 8k tokens, the choice of quant had a greater effect on VRAM than context length. The increase we measured matches the theoretical FP16 KV cache of Bielik-⁠11B for a single request slot (about 0.2 MB per token), so it scales linearly: a 32k context adds about 6 GB, and each extra parallel slot (OLLAMA_NUM_PARALLEL) adds its own context.

Third, an observation from this measurement series: the VRAM difference between the V100-⁠16 and the V100-⁠32 at the same quant and context is negligible (for Q4 and Q5 identical to the MB, for Q8 at ctx 8192 it is 13.09 GB vs 13.22 GB, a difference of about 0.13 GB). In other words, the model's own usage does not depend on the card's capacity: these two cards only start to differ in practice when you add another process alongside the LLM. That process is the embedder.

VRAM of the embedder: the second half of the budget, which we forget

RAG is not only generating answers. Before the LLM writes anything, the documents must have been indexed with an embedder, and at query time the user's question has to be turned into a vector with the same model. If the embedder and the LLM share one card (the typical scenario for a small deployment, one card for the whole pipeline), their VRAM adds up.

We measured two embedders, e5-⁠large and bge-⁠m3, at different batch sizes, on five cards. In this post "e5-⁠large" means multilingual-⁠e5-⁠large. The multilingual versions of both are built on the same XLM-⁠RoBERTa-⁠large network (about 560M parameters), so their weights take the same memory; the difference is the input length: e5 truncates every fragment to 512 tokens, bge-⁠m3 accepts up to 8,192.

Card e5-⁠large @ batch 32 bge-⁠m3 @ batch 32
P4 8GB 3.30 GB 7.32 GB
A2 16GB 3.25 GB 7.41 GB
P40 24GB 3.34 GB 7.50 GB
V100-⁠16 3.54 GB 7.70 GB
V100-⁠32 3.54 GB 7.70 GB

Batch 32 is a sensible reference point: large enough not to be extremely conservative, and at the same time fitting on all five cards without OOM. One thing is clear here: in our setup bge-⁠m3 took more than twice as much VRAM as e5-⁠large at the same batch. A fragment was a whole scifact-⁠pl passage (title plus text), 5,000 passages in all. We did not record the max_length bge-⁠m3 ran with, so we cannot confirm the cause of the difference; one possibility is longer sequences rather than a larger model. The embedder's input length is a design decision with a weight comparable to the choice of quant. If VRAM is tight, capping bge-⁠m3's max_length (and chunking accordingly) may bring it closer to e5's footprint (we did not test this).

The embedder's VRAM grows with the batch, and in some cases non-⁠linearly. At batch 128 the bge-⁠m3 process ends with an OOM error on the 16 GB cards, both on the A2 and on the V100-⁠16 (in the measurement log: zero fragments processed, an OOM note). The P4 (8 GB) fits bge-⁠m3 at batch 32 (7.32 GB of the 7.5 GB the card actually makes available), and that is where the series ends: our harness stops the sweep when a measurement exceeds 85% of the card's VRAM, so batch 64 (12.5–⁠12.8 GB on the other cards) was never run on the P4 at all; we did not measure an OOM there, we stopped the series before it. For e5-⁠large the load is lower: on the P4 the process ends with an OOM error only at batch 256; on the other cards no OOM occurred in the range of batches studied.

One figure needs explaining: in the measurement file for V100-32/e5-large at batch 8, the VRAM peak is 11,238 MiB, i.e. more than at batch 16 (3,484 MiB) and more than any other e5-⁠large result in the whole series. We checked this in the per-⁠second log from the card: when this run started on the V100-⁠32, a resident Bielik from the previous test (about 7.7 GB) was still sitting on it, and the embedder loaded alongside it; a few minutes later Ollama released the model and the subsequent batches are clean. This is a co-⁠residency artefact, not a feature of the card: I do not include this value in the table. But note what it illustrates: the measurement sees the usage of the whole card, exactly as your second process will see it when it tries to run alongside the first.

The whole pipeline on one card: LLM + embedder together

The question that someone planning a purchase actually asks is not "how much does the LLM take" or "how much does the embedder take" separately, but how much will they take together, if they are to share one card.

Our measurement specification states this directly in the context of the end-⁠to-⁠end tests: the full pipeline (the LLM through Ollama in Q4 + the e5-⁠large embedder) holds about 7.5 GB minimum on the card at the same time, of which Bielik in Q4 alone is about 6.4 GB, and e5-⁠large adds about 1 GB in that test configuration. That is why this test ends with an OOM error on an 8 GB card (the P4): the model barely fits, and there is no free memory left for the embedder. A 16 GB card such as the A2 should handle this pipeline; I write "should", because we have not yet measured the full pipeline on the A2: it is a conclusion from adding up, not a measurement.

Where does the discrepancy between "e5-⁠large ~1 GB" in the end-⁠to-⁠end test and 3.3–⁠3.5 GB in the table above come from? Not mainly from the batch: in our sweep e5-⁠large grows by only about 0.15 GB from batch 16 to batch 32. We do not know the cause: we did not record the embedder's precision in the end-⁠to-⁠end test, nor how VRAM was read there. For orientation, the weights of multilingual-⁠e5-⁠large take about 2.1 GB in FP32 and about 1 GB in FP16, and the sweep reading covers the whole card, including the process's own CUDA context. If you index on the same card on which you answer, count the higher figure.

If you put it together from our own tables above: Bielik Q4_K_M at ctx 8192 (8.49 GB on the V100) plus e5-⁠large at batch 32 (3.54 GB) comes to about 12 GB in total. This is the sum of two peaks measured separately: a conservative approximation for planning, not a formal upper bound: the two peaks need not fall in the same second (which works in favour of the sum), but co-⁠residency can also change allocations, buffers and runtime behaviour (which works against it). That is the kind of approximation you want at the planning stage, and an approximation that has to be confirmed before deployment by measuring both processes resident at the same time. It fits on the P40 (24 GB) and the V100-⁠32 with plenty of headroom; it will also fit on the V100-⁠16, but only about 4 GB of slack is left, and that is too little to safely switch to bge-⁠m3 or raise the embedder's batch. If you want Q8_0 instead of Q4 (13.09–⁠13.22 GB at ctx 8192) plus any embedder alongside, the V100-⁠16 starts to get tight: we already observed the same in the comparison of the P40 vs the V100 for the LLM alone.

Which card is enough for which scenario

The table below is a synthesis of the measurements above, not a separate measurement: it combines the VRAM of the LLM (from the inference measurements) and the VRAM of the embedder (from the batch measurements) into typical deployment scenarios. The sizes of the cards themselves (the "GB" figures next to the card names) are the hardware specification, not a measurement result.

Scenario VRAM needed (approximation from measurements) Card that is enough
Bielik Q4, short context, generation only (embedder elsewhere) ~6.5–⁠7 GB P4 8 GB (6.41 GB measured at ctx 512; longer contexts most likely involve CPU offload, see the caveat below), any larger
Bielik Q4, ctx up to 8k, + e5-⁠large (batch 32) on the same card ~12 GB A2 16 GB (a conclusion from adding up: we did not measure the LLM on the A2), V100-⁠16 (tight), P40, V100-⁠32
Bielik Q5, ctx up to 8k, + e5-⁠large (batch 32) ~13 GB P40, V100-⁠16 (very tight), V100-⁠32
Bielik Q8, ctx up to 8k, the LLM alone without an embedder on that card ~13–⁠13.5 GB P40, V100-⁠16 (just about), V100-⁠32
Bielik Q4, ctx up to 8k, + bge-⁠m3 (batch 32, long-⁠input settings as measured) on one card ~16 GB P40, V100-⁠32
Bielik Q8, ctx up to 8k, + bge-⁠m3 (batch 32) on one card ~20.5–⁠21 GB P40 (close to the limit), V100-⁠32

A caveat to the first row: our OOM measurement for the P4 concerned a full end-⁠to-⁠end run (the LLM + embedder resident at the same time), where the 8 GB card could not carry both at once. We also measured the LLM alone on the P4, and that measurement says something interesting: at ctx 512 Bielik Q4 takes 6.41 GB of the 7.5 GB the card makes available, and generates (decode, tg) about 14 tok/s, half of what the P40 does. But with a longer context the VRAM on the P4 stays put (6.4–⁠6.45 GB from 512 to 8192 tokens, while on the P40 it grows by 1.6 GB), and generation drops to about 6 tok/s. We did not log how many layers the runtime placed outside the GPU, so treat this as a hypothesis from the signature of the measurement: When the model and context do not fit in VRAM, Ollama can keep some layers in system memory and execute them on the CPU, provided the settings and available memory allow it. This does not guarantee that an OOM error will be avoided. Our test does not isolate this. You can check it on your own card with ollama ps: the PROCESSOR column shows "100% GPU" or a CPU/GPU split. For a standalone, light LLM with a short context the P4 may be enough; for a full RAG system on one card, I do not recommend it.

What you can see in this table as a pattern: the P40 and the V100-⁠32 are the cards that fit every combination in the table, the P40 with only about 2 GB to spare in the heaviest one (with ECC on, it makes about 22.4 GB available, the A2 about 15 GB), not because they are faster (we wrote about that in another post, and there the V100 wins on speed), but because 24–⁠32 GB gives room to add up the LLM + embedder + a safety margin, instead of balancing on the edge of OOM.

Why this differs between cards at all

It is worth asking why an identical model with identical quantisation uses a slightly different amount of VRAM on the V100-⁠16 than on the P40, given that the weights are the same. The answer: it does not take significantly different amounts: differences of the order of 190–⁠320 MB between the P40 and the V100 at the same quant and context are the runtime's margin (the KV cache buffer, CUDA allocations, the overhead of the backend implementation itself), not a difference in the size of the model. That is good news for planning: with the same backend, the same offload settings and the same context, the LLM's VRAM is above all a property of the model and the quant: small runtime differences between GPUs still occur, and a change of backend, KV cache type, attention implementation or offload can shift the result. This is unlike decode (tg) and prefill (pp) speed, which depends very strongly on the GPU architecture, as we showed in our earlier comparison of the P40 vs the V100.

The embedder behaves differently: here the VRAM grows with the batch, because the batch is literally the number of fragments processed at once in one forward pass. A larger batch = higher throughput (frag/s), but memory usage grows linearly (and sometimes more than linearly, because of activation overhead). This is a lever you control, not a property of the card itself: if VRAM is the bottleneck, lowering the embedder's batch is a cheaper operation than replacing the card.

The trade-⁠off few people mention: indexing versus answering

There is one more practical thread here. Indexing documents (the embedder working with a large batch to process the whole corpus quickly) and answering questions (the LLM resident, ready to generate) are two different VRAM loads that do not have to occur at the same moment, but on a single card a collision is easy if you re-⁠index in the background just when someone asks a question. If you plan frequent, large re-⁠indexing (e.g. a daily synchronisation with a document system), it is worth considering splitting the roles: one card holds the resident LLM, a second (perhaps cheaper, smaller) one does the embeddings in batches, outside peak hours. This is not a conclusion drawn directly from our measurements: it is my architectural recommendation, following from the observation of how the embedder's VRAM grows with the batch: with large batch re-⁠indexing you want to maximise the batch (throughput), and that is exactly when VRAM hurts the most.

What follows from this

If I had to reduce this to one rule to remember: do not budget VRAM for the model alone: budget for the whole pipeline that is to reside on the card at the same time. Bielik in Q4 alone is 6.6–⁠8.5 GB depending on the context and the card, and looking only at that figure, it is easy to think an 8 GB card will be enough. But add an embedder (even e5-⁠large, which used less VRAM in our setup) and things get tight; with bge-⁠m3 in our measured configuration, 16 GB stops being a safe choice for the higher quants. On a card that is "enough" for the LLM alone in a dry run, processes may start ending with OOM errors a month later, when someone raises the embedder's batch or adds a second model to the same instance.

Budget VRAM the way you budget money for unforeseen expenses: count what you know you need, add a margin for what you have not yet planned, and then check whether the card you are buying has that margin at all.

Sources

All the VRAM figures in this article come from our own measurements, carried out on our own test bench (not from manufacturers' datasheets or external publications).

  1. VRAM measurements of LLM inference (Bielik-⁠11B-⁠v2.3, Ollama, Q4_K_M/Q5_K_M/Q8_0 quants, context 512–⁠8192 tokens) on the P40, V100-⁠16 GB and V100-⁠32 GB cards and, cited only in the caveat about the P4, on the P4 8 GB; full power limit, a uniform measurement methodology, a single run per point. Measurement series: 1–⁠6 September 2026.
  2. VRAM measurements of embeddings (the e5-⁠large and bge-⁠m3 models, batch 8–⁠256, up to 85% of the card's memory or OOM) on the P4, A2, P40, V100-⁠16 GB and V100-⁠32 GB cards. Measurement series: 1–⁠4 September 2026.
  3. VRAM requirements for the full RAG pipeline (the LLM + embedder resident at the same time on one card): an observation from the end-⁠to-⁠end tests of the same series (P4: OOM; A2: not measured).

Full documentation of the methodology and the raw measurement data are available on request: write to us.

FAQ

How much VRAM did the whole LLM instance (Bielik-⁠11B) take in our test?
Bielik-⁠11B in Q4_K_M is 6.6–⁠8.5 GB depending on the context and the card (P40: 6.57 GB @512 → 8.18 GB @8192); in Q8_0, 11.3–⁠13.2 GB. The jump from Q4 to Q8 is 4.6–⁠4.7 GB on each of the three cards.
How much VRAM does the embedder add?
At batch 32 e5-⁠large takes 3.25–⁠3.54 GB, bge-⁠m3 7.32–⁠7.70 GB (more than 2× as much). At batch 128 bge-⁠m3 ends in OOM on the 16 GB cards (A2 and V100-⁠16).
How much VRAM does the whole pipeline (LLM + embedder) need on one card?
Bielik Q4 at ctx 8192 (8.49 GB) plus e5-⁠large at batch 32 (3.54 GB) is about 12 GB: a conservative sum of two peaks. With bge-⁠m3 instead of e5-⁠large it comes to about 16 GB, and Bielik Q8 + bge-⁠m3 to about 20.5–⁠21 GB.
Is a Tesla P4 8 GB enough for RAG?
On our P4, Bielik Q4 used 6.41 GB at ctx 512; with longer contexts generation slowed to about 6 tok/s, most likely because part of the model ran from system memory. We did not log GPU layer placement. In the end-⁠to-⁠end test, running the LLM and the embedder simultaneously on the P4 resulted in an OOM error.
Which of the cards tested fitted every combination in our table?
The P40 24 GB and the V100 32 GB: not because they are faster, but because in our matrix they fitted the LLM, the embedder and the context lengths studied with a larger margin than the 8/16 GB cards.

Related products