How much memory does a local LLM need?

Estimate weight memory first. Multiply the parameter count by bits per weight and divide by eight. That gives a lower bound in bytes before caches, runtime buffers and quantization metadata.

Budget memory for weights, the attention cache, runtime buffers and your other applications. For a first estimate, an 8-billion-parameter model at about 4.9 bits per weight needs 8 billion × 4.9 ÷ 8 = 4.9 GB for weights alone; start with at least 25% additional room after accounting for the cache.

Turn parameter counts into a download estimate

The arithmetic is weights in bytes = parameter count × bits per weight ÷ 8. Four bits gives an 8B model a theoretical 4 GB payload, but real quantization stores scales and mixes tensor precisions. Read Q4 as a nominal precision family; use the complete recipe to estimate storage.

The llama.cpp quantization documentation reports 4.8944 bits per weight for its Llama 3.1 8B Q4_K_M example, 5.7036 for Q5_K_M and 8.5008 for Q8_0. The following planning table rounds these to 4.9, 5.7 and 8.5. Use these approximate file-size estimates for planning, then check the selected architecture and artifact. F16 uses 16 bits per weight.

Parameters Q4_K_M, about 4.9 bpw Q5_K_M, about 5.7 bpw Q8_0, about 8.5 bpw F16, 16 bpw
3 billion 1.84 GB 2.14 GB 3.19 GB 6 GB
8 billion 4.90 GB 5.70 GB 8.50 GB 16 GB
14 billion 8.58 GB 9.98 GB 14.88 GB 28 GB
32 billion 19.60 GB 22.80 GB 34 GB 64 GB
70 billion 42.88 GB 49.88 GB 74.38 GB 140 GB

For example, the 14B Q5 estimate is 14 × 5.7 ÷ 8 = 9.975 GB, rounded to 9.98 GB. GB here means one billion bytes. GiB means 1,073,741,824 bytes, so 4.9 GB ÷ 1.073741824 = about 4.56 GiB. Keep units consistent when comparing a download page with a memory monitor. Once you select an artifact, replace this estimate with its actual byte size.

Give the cache and the desktop their own lines

Use a worksheet with separate entries for the weights, the configured context cache, runtime buffers and normal applications. Give each item its own measured or calculated value. In Ollama, parallel requests enlarge context allocation: four requests with a 2,048-token context require capacity for 4 × 2,048 = 8,192 context tokens.

Here is an illustrative budget. Suppose weights occupy 5 GiB, your chosen context and concurrency require 2 GiB of cache, and measured runtime buffers occupy 1 GiB. The inference subtotal is 5 + 2 + 1 = 8 GiB. Applying this guide's 25% planning margin gives 8 × 1.25 = 10 GiB. If your operating system and usual applications need another 4 GiB, plan around 14 GiB of total memory.

Keep the planning margin after measuring the longest request, leaving room for workload variation before choosing a larger model. A configuration that consumes every available byte at startup gives you no practical room for a browser tab, a longer answer or another worker.

For the architecture-specific calculation, use the KV cache guide. A shorter weight file and a shorter context solve different parts of the budget. If long chats are your failure case, changing only the quantization may leave the underlying problem intact.

Check which memory is doing the work

On a discrete GPU machine, make a GPU budget and a system-memory budget separately. Ollama reports placement through ollama ps: CPU, GPU or a split between them. Confirm that the accelerator holds the full model when full GPU placement is your goal.

On a Mac with unified memory, start with the combined workload rather than adding advertised CPU and GPU memory as separate capacities. The Mac sizing guide covers that case. In either layout, record the loaded configuration, including context and parallel requests, beside the memory reading. Test four document-processing agents together when that is the workload you need to support.

Keep download storage in a separate column too. Your experiment may retain two quantizations and their outputs even though only one model is loaded. Deleting an unused download frees disk capacity; loading a smaller artifact reduces weight memory.

Try it on your workload

Choose a model you have already downloaded and substitute its exact local name below. This request explicitly reserves 4,096 context tokens and keeps the model available for inspection. The same HTTP command works from a macOS or Linux terminal with Ollama running.

curl http://localhost:11434/api/generate -d '{
  "model": "YOUR_LOCAL_MODEL",
  "prompt": "List the decisions in this fictional meeting: We agreed to delay shipping until testing finishes.",
  "stream": false,
  "keep_alive": "10m",
  "options": {"num_ctx": 4096}
}'
ollama ps

Record free memory before loading, after this response, and during your longest representative prompt. Repeat with the concurrency your application needs. Keep the same artifact and context setting, and note whether each request actually runs together or waits. Save answer quality and elapsed time alongside peak memory. A load that succeeds but causes unacceptable waiting has failed the experiment.

Use three passes: a quiet machine, your normal desktop workload, and the busiest expected agent burst. Keep the worst observed memory requirement in your worksheet. The final pass determines whether your headroom rule survives real use.

How to decide

  • Keep the configuration when the longest request and normal applications fit with your reserved margin.
  • Reduce context or simultaneous work when cache growth is the problem; compare smaller weight artifacts when the baseline load is too large.
  • Buy more memory only after a useful model has passed your accuracy checks and the worksheet identifies a recurring capacity shortfall.

Give ten analysis agents room for about 7 cents

Ten analysis agents working at once on openai/gpt-oss-120b cost about 7 cents in tokens on TrustedRouter for this trial. Use them for approved document analysis that exceeds your everyday memory budget, while keeping the local configuration sized for routine work.

On 2026-11-22, the live catalog listed approximately $0.0317 per million input tokens and $0.179 per million output tokens. Suppose each agent uses 100,000 input and 20,000 output tokens across its requests. Input = 10 × 100,000 = 1,000,000; output = 10 × 20,000 = 200,000. At those rounded rates, cost = 1 × $0.0317 + 0.2 × $0.179 = $0.0675, about 7 cents.

On one local GPU, those agents share throughput, and requests beyond its parallel capacity wait in line; through a per-token API, they can run together for the same token bill as sequential work. Compare accepted answers from each deployment against your references. Prices change; check current prices, the API quickstart and agent setup. For approved off-device work, encrypted inference and zero data retention depend on model and provider. Local remains preferable when the workload must stay on your device.

Sources

Related local LLM decisions