LOCAL AI • RETRIEVAL-AUGMENTED GENERATION • HARDWARE PLANNING
Running a local Retrieval-Augmented Generation (RAG) system involves more than loading a language model into GPU memory. A complete pipeline may include an embedding model, a vector database, a reranker, and a generator LLM—and each component has different memory and processing requirements.
This distinction matters when planning a workstation. A GPU that can load an 8B language model may still encounter memory pressure when an embedding model, a cross-encoder reranker, and a longer context window are introduced simultaneously.
This guide explains how to estimate those requirements, understand the difference between system RAM and GPU VRAM, and select hardware for different local RAG workloads. The figures below are planning estimates, not universal benchmark results. Actual consumption depends on model revisions, quantization, inference engines, batch sizes, context lengths, and operating systems.
A lightweight 8B RAG setup can be practical on a 12GB GPU with carefully selected models and context settings. A more demanding 14B setup generally benefits from 24GB VRAM. Larger 32B and 70B configurations may require multiple GPUs, substantial unified memory, or a combination of GPU inference and CPU offloading.
🧮 Local RAG Memory Estimator
Estimate approximate simultaneous GPU memory requirements for a selected local RAG configuration. These values are planning assumptions, not live hardware measurements.
Estimated simultaneous GPU memory allocation
15.34 GB
Suggested GPU capacity
24GB GPU recommended
Planning estimate only. Not a guarantee against CUDA Out-of-Memory errors.
Table of Contents
- The Four Main Memory Consumers in a Local RAG Pipeline
- Embedding Models: Understanding VRAM Requirements
- Cross-Encoder Rerankers and Their Memory Cost
- Vector Database Memory: Qdrant, Chroma and Milvus
- Generator Models: 8B, 14B, 32B and 70B
- Single-GPU and Multi-GPU RAG Architectures
- Local RAG Hardware Recommendations
- Python Example: Building a Local RAG Pipeline
- Frequently Asked Questions
1. The Four Main Memory Consumers in a Local RAG Pipeline
A typical local RAG architecture has four major components that influence memory usage:
- Embedding model: Converts queries and documents into numerical vectors.
- Vector database: Stores vectors, metadata and indexes for retrieval.
- Reranker: Re-evaluates retrieved passages to improve their relevance.
- Generator LLM: Uses the retrieved passages to construct the final answer.
Embedding weights + Reranker weights + Generator weights + KV cache + Runtime and activation memory
This is a planning model rather than an exact allocation formula. Some applications load models sequentially instead of keeping every model resident on the GPU, lowering peak memory at the cost of model-switching latency. For generator memory details, see our guide to GPU VRAM requirements for 8B, 14B, 32B and 70B language models.
2. Embedding Models: Understanding VRAM Requirements
Embedding models transform text into semantic vectors, with memory needs governed by parameter count, precision, batch size, and input length.
Nomic Embed Text v1.5
A relatively lightweight embedding option supporting up to 8,192 tokens, easily accommodated on modest GPUs alongside runtime buffers.
BAAI BGE-M3
Designed for multilingual and multi-function retrieval (dense and sparse), BGE-M3 has approximately 567 million parameters—roughly 1.06 GiB in FP16 weights before runtime overhead and batch activations.
GTE-Qwen2-7B
Larger 7B-class embedding models require substantially more memory even when quantized, making simultaneous deployment with a 14B generator impractical on a single 24GB GPU without model swapping or CPU offloading.
3. Cross-Encoder Rerankers and Their Memory Cost
A cross-encoder reranker processes the query and candidate passage together to compute relevance scores, often improving retrieval precision when passages have similar embedding scores. However, evaluating more candidates or longer passages increases latency and activation memory.
- Model weights are only part of the total memory requirement; batch size drives activation memory.
- CPU-based reranking or sequential loading can preserve GPU VRAM for the generator model on smaller workstations.
4. Vector Database Memory: Qdrant, Chroma and Milvus
Vector databases generally use system RAM and storage for indexing and retrieval rather than GPU VRAM when conventional CPU-based indexing is used (though GPU-accelerated indexing implementations can use device memory).
Raw vector storage (FP32) = Number of vectors × Dimensions × 4 bytes
Example (1,000,000 vectors × 1,024 dims × 4) ≈ 4.10 GB (decimal, raw vectors only)
Total RAM also includes metadata, HNSW graph indexes, caching, and whether vectors are kept in memory or memory-mapped from disk. For a medium-sized knowledge base, 32GB system RAM provides more breathing room than 16GB.
5. Generator Models: 8B, 14B, 32B and 70B
- 8B models: ~4.5GB–5.5GB 4-bit weights plus KV cache and runtime allocations; practical on selected 12GB GPUs when embeddings/reranking run on CPU or sequentially.
- 14B models: Benefit from 24GB GPUs when combined with retrieval models and longer contexts.
- 32B models: May exceed 24GB once KV cache and runtime allocations are added, requiring quantized KV caches or offloading.
- 70B models: Require multiple GPUs or high-capacity unified memory systems (dual GPUs do not automatically merge VRAM into one unrestricted pool without parallelism support).
Read our related guide on context window and VRAM scaling from 32K to 128K.
6. Single-GPU and Multi-GPU RAG Architectures
Single-GPU setups keep models resident simultaneously (if memory allows) or load them sequentially to lower peak VRAM at the cost of load time. Dual-GPU setups can separate retrieval models onto one card and generation onto the other, or partition a single large model across both cards. See our comparison of PCIe x8 versus x16 for multi-GPU inference.

7. Local RAG Hardware Recommendations
| Workload | GPU Memory | System RAM | Typical Configuration |
|---|---|---|---|
| Basic RAG | 8–12GB | 16–32GB | 8B Q4 with lightweight embeddings and CPU reranking |
| Intermediate RAG | 16GB | 32GB | 8B or selected 14B configurations |
| Advanced RAG | 24GB | 32–64GB | 14B Q4 with embedding and reranking workloads |
| Large-model RAG | 48GB or more | 64GB or more | Selected 32B and larger models with partitioning or offloading |
| Large 70B workloads | Depends on deployment | 64–192GB or more | Multi-GPU or suitable unified-memory systems |
These are broad planning ranges rather than minimum guarantees—verify against exact model files, context size, and concurrent users.
8. Python Example: Building a Local RAG Pipeline
This example illustrates a local RAG workflow using Sentence Transformers, Qdrant, and an OpenAI-compatible local inference server (assuming the collection already exists with compatible embeddings):
from sentence_transformers import SentenceTransformer, CrossEncoder
from qdrant_client import QdrantClient
from openai import OpenAI
import torch
# Connect to an existing local Qdrant database.
qdrant = QdrantClient(path="./rag_database")
COLLECTION = "enterprise_docs"
device = "cuda" if torch.cuda.is_available() else "cpu"
# Load the embedding model.
embed_model = SentenceTransformer(
"BAAI/bge-m3",
device=device
)
# Load the reranker.
reranker = CrossEncoder(
"BAAI/bge-reranker-large",
device=device
)
# Connect to a local OpenAI-compatible inference server.
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="local"
)
def run_local_rag(query, top_k=20, top_n=5):
# 1. Encode the query.
query_vector = embed_model.encode(
query,
normalize_embeddings=True
).tolist()
# 2. Retrieve candidate documents.
results = qdrant.query_points(
collection_name=COLLECTION,
query=query_vector,
limit=top_k,
with_payload=True
).points
candidates = [
point.payload["text"]
for point in results
if point.payload and "text" in point.payload
]
if not candidates:
return "No relevant documents were found."
# 3. Rerank candidate passages.
pairs = [[query, text] for text in candidates]
scores = reranker.predict(pairs)
ranked = sorted(
zip(candidates, scores),
key=lambda item: float(item[1]),
reverse=True
)
selected = [text for text, score in ranked[:top_n]]
# 4. Build the augmented context.
context_text = "\n\n---\n\n".join(selected)
prompt = (
"Answer using the supplied context. "
"If the context does not contain the answer, "
"clearly say that the information is unavailable.\n\n"
f"Context:\n{context_text}\n\n"
f"Question: {query}"
)
# 5. Generate the response.
response = client.chat.completions.create(
model="qwen2.5-coder-14b-instruct",
messages=[{"role": "user", "content": prompt}],
temperature=0.1,
max_tokens=512
)
return response.choices[0].message.content
if __name__ == "__main__":
answer = run_local_rag(
"What are the hardware requirements for local RAG?"
)
print(answer)
pip install sentence-transformers qdrant-client openai torch
For persistent deployments, add database backups, document update handling, error logging, access controls and resource limits.
9. Frequently Asked Questions
Can I run local RAG with 16GB system RAM and an 8GB GPU?
Yes, a small RAG pipeline can run under these constraints if the generator is quantized, the embedding model is lightweight, and the reranker runs on the CPU or is loaded separately—keeping limited context headroom in mind.
How much VRAM does BGE-M3 require?
BGE-M3 has roughly 567 million parameters (~1.06 GiB in FP16 weights) before runtime and activation memory, which varies by batch size and input length.
Does Qdrant consume GPU VRAM?
A conventional CPU-based Qdrant deployment primarily uses system RAM and storage; GPU memory is only involved when GPU-accelerated indexing or retrieval components are enabled.
Can I run a 14B model with RAG on an RTX 4090?
Yes. A 24GB RTX 4090 is a practical platform for a quantized 14B generator and RAG components, subject to context length, KV cache, embedding/reranker usage, and runtime overhead.
Does increasing context length always improve RAG quality?
No. Irrelevant or redundant retrieved passages can dilute answer quality—better chunking, filtering and reranking are often more effective than larger contexts alone.
Can two RTX 3090 GPUs run a 70B model?
They can support selected quantized 70B configurations when the inference engine distributes the model across both cards, depending on memory footprint, context length and inter-GPU communication.
How much system RAM should I choose for a local RAG workstation?
16GB suits small experiments, while 32GB or 64GB provides greater flexibility for larger document collections, HNSW indexing, and concurrent local services.
Related Guides & Technical References
- Prompt Caching for Local LLMs: Reduce TTFT with vLLM & llama.cpp
- How to Use Model Context Protocol (MCP) with Local LLMs
- Qdrant Official Documentation — Vector storage, HNSW indexing, and memory tuning.
- Sentence Transformers Documentation — Bi-encoder embeddings and cross-encoder reranking.
Editorial Disclaimer: Hardware capacities and memory figures in this article are approximate planning estimates. They are not guarantees of performance or compatibility. Actual resource consumption varies by model version, quantization format, inference engine, batch size, context length, operating system and concurrent workload. Verify specifications and test the intended configuration before purchasing hardware.
