Will a Local LLM Fit on Your GPU? A Memory Planning Tutorial
Estimate model weight memory, KV-cache use, and runtime overhead before downloading a model or changing your GPU installation.

Start with the hardware you have
Before downloading a model, write down your GPU model and VRAM, installed system RAM, free disk space, operating system, and the compute backend your software supports. Check the backend against the GPU: CUDA applies to compatible NVIDIA GPUs, while other platforms have their own requirements. NVIDIA’s CUDA documentation describes its supported computing platform and installation.
Then define the workload. A single short prompt has different memory needs from a long context or several simultaneous requests. This tutorial gives you a way to estimate whether a installation is plausible; the actual peak depends on the model, quantization, runtime, context length, and workload. For a model shortlist based on task rather than hardware, see how to choose an open model.
Estimate the weight memory first
A rough starting point is parameter count multiplied by bits per parameter, then divided by eight to convert bits to bytes. A 7-billion-parameter model stored at an average of 4 bits per parameter has a nominal weight size near 3.5 billion bytes, or about 3.3 GiB. A 14-billion-parameter model at the same bit width is roughly twice that. These are planning estimates, not exact file or runtime sizes.
Real quantized files also include metadata and may store some tensors at different precisions. The runner needs additional memory for its runtime, temporary operations, and buffers. Some of that may live in system RAM rather than VRAM, depending on the software and configuration. A file that appears to fit in VRAM can still fail to load or leave too little room for inference.
Treat the estimate as a floor, not a capacity guarantee. Check the model’s file size and format, then leave room for runtime use and the workload. GGUF files are useful in several local workflows, but the chosen file and runner must be compatible; this GGUF selection tutorial covers file-choice considerations.
Budget for context and concurrent requests
Model weights are only part of inference memory. The runtime also keeps a key-value cache, or KV-cache, for tokens processed so far. Its size grows with context length: a prompt near the model’s context limit can require substantially more cache memory than a short prompt, even though the weights have not changed.
Architecture and implementation affect the exact amount, so there is no single reliable cache figure for every model. Concurrent requests add another consideration: each active sequence needs cache space. A workload with multiple long conversations can therefore run out of memory where one short exchange succeeds.
When comparing settings, hold the model and quantization constant, then change one variable at a time. Start with a short context and one request. Increase the context window only as far as the application needs. Transformers’ model loading and inference documentation describes loading and generation workflows, including cache-related options.
If the estimate is too close
First reduce the context window and concurrency. This targets cache use without changing the model weights. If the workload still does not fit, choose a smaller parameter count or a more compact quantization. Quantization reduces weight storage, but it can affect output quality and may change runtime behavior; compare candidate files on the prompts you actually use.
CPU offload can move some model work out of VRAM when the runner supports it and the system has enough RAM. It is a capacity tradeoff, not free memory: data must move between CPU and GPU, and that can increase latency. Keep enough system RAM available for the operating system, the model, and other processes. Free disk space also matters because the download and any converted or cached copies may occupy more space than the final in-memory estimate suggests.
For a focused installation around a supported local workflow, review the Neuroforge toolkit features. The useful question is not whether a model is labelled “small,” but whether its weights, cache, runtime, and intended workload fit together on your machine.
Run a small test before scaling up
Use a controlled sequence. Confirm that the selected backend recognizes the GPU, load one model, and generate a short response with a modest context. Record the peak VRAM and system RAM during loading and generation. Then increase context length in measured steps, followed by any concurrency you expect to use. Close unrelated GPU-heavy applications so their memory use does not confuse the result.
In a PyTorch diagnostic script, GPU memory statistics can help track allocated and reserved memory; consult the PyTorch GPU documentation for the relevant APIs. A runner may expose its own metrics, so use those when available. Note the model file, quantization, context setting, backend, and peak readings together. That makes a successful configuration repeatable.
Classify failures before changing hardware. An out-of-memory error points toward capacity: reduce context or concurrency, select a smaller or more compact model, or try supported CPU offload. A driver initialization error, unavailable device, or unsupported backend points toward compatibility instead. Check the GPU model, driver, operating-system support, and backend configuration before treating it as a VRAM limit.
Common questions
Does the model file size tell me whether it fits in VRAM?
No. It approximates weight storage, but runtime buffers and KV-cache also use memory. Context length and concurrent requests can push peak use above the file size. See the [weight and cache estimates](page:services) for the planning factors.
Can I run a model if its weights exceed my GPU’s VRAM?
Possibly, if your runner supports CPU offload and you have enough system RAM. Expect a different latency profile because some work and data movement involve the CPU. Start with the [local toolkit features](page:services) and verify the options supported by your chosen runner.
How can I tell an out-of-memory issue from a CUDA problem?
Out-of-memory errors usually indicate that the workload exceeded available memory. Device discovery or initialization errors suggest a driver or backend issue. Check [CUDA compatibility guidance](src:2), then compare GPU memory readings with the [PyTorch diagnostics reference](src:1).
