Field guide · Local models
Local models: how big a model can your GPU actually run?
You downloaded a model. The chat box opens, but the first question stalls, or the answer starts repeating halfway through. Before asking “how fast”, work out memory, quantisation, cache and concurrency. If it does not run, speed means nothing.
- Work out four ledgers first: weights, quantisation, KV cache and concurrency.
- Define “it runs” as: it fits, it finishes the answer, and the speed is acceptable.
- Get one user working before talking about a multi-user service.
The full guide starts below. Use the tables for reference; you do not need to memorise them.
Take one concrete job: a 24 GB GPU, a 30B model, 8,000 characters of input and at least 10 output tokens per second. First check whether it fits; then check whether it finishes.
1 · Five ledgers: weights, quantization, KV cache, runtime, concurrency
Weights are only the first ledger. An 8B model at 4-bit is roughly 4 GB of weights, but that does not mean the whole process occupies 4 GB. The runtime also needs graphs, temporary buffers and framework overhead; long contexts add KV cache. Treating weight size as memory requirement is the most common local-deployment underestimate.
The second ledger is quantization. 4-bit is not lossless compression: it trades accuracy, speed and memory. Different formats, calibration data and backend support produce different results. Confirm the runtime actually supports the format, then compare on your own task sample instead of trusting one perplexity number.
The third ledger is KV cache, which grows with context length and concurrency. The fourth is the runtime, which determines whether the same weights can be loaded, offloaded and batched efficiently. The fifth is concurrency: single-user speed is not production capacity. Count all five together; miss one and the system fails under pressure.
| Ledger | What to calculate | Most often missed |
|---|---|---|
| Weights | Parameters × bits per weight, plus loading headroom | Treating parameter bytes as VRAM |
| Quantization | Format, calibration, backend support, accuracy loss | Assuming Q4 equals the original model |
| KV cache | Layers, heads, context length, concurrency | Estimating from a short chat only |
| Runtime | Loading, offload, batching, graph overhead | Treating framework overhead as zero |
| Concurrency | Concurrent requests, batch size, queueing, timeouts | Using single-user speed for production |
2 · Define “it runs”: four conditions that must all hold
“It runs” is not seeing the first sentence generated. It means four things at once: no VRAM overflow; the context fits; output is sane on your own sample; and time to first token plus total generation is acceptable. If one condition fails, the configuration is not ready for the next step.
Write a fixed sample first: same input, same question set, same context length, same quantization and same runtime. Change one variable at a time. Otherwise you cannot tell whether a slowdown comes from quantization, context, drivers or thermal throttling. This fixed sample also becomes the basis for cost and acceptance.
- VRAM: leave enough headroom after loading so long-context and concurrency peaks do not overflow.
- Context: system prompt, history, retrieved material and output budget all fit without silent truncation.
- Quality: on your own task sample, key fields, citations and refusal behaviour do not visibly degrade.
- Latency: time to first token and total generation meet the use case, not just the average.
3 · Runtime: a single-user tool and a multi-user service are different problems
llama.cpp, LM Studio, Ollama and vLLM are often put in one comparison table, but they do not solve the same problem. The first group leans toward single-user desktop use, quick validation and model switching; vLLM-style servers target multi-user serving, continuous batching and throughput. Using a desktop tool for production concurrency, or a serving framework for a small local experiment, leads to the wrong conclusion.
Ask four questions before choosing a runtime: does it support the model format; does it support the target quantization; do you need full or partial GPU offload; do you need batching, concurrency and observability. If one answer is no, stop comparing speed and change the runtime or the format first.
| Scenario | Better fit | Poor fit | Check first |
|---|---|---|---|
| Desktop trials, model switching | LM Studio / Ollama-style tools | High-concurrency production | Format, quantization, memory |
| Single-machine tuning | llama.cpp-style backend | No command line at all | Build flags, backend, offload layers |
| Multi-user API serving | vLLM-style serving | Quick one-model trial | Batching, concurrency, monitoring |
| Offline or air-gapped | Runtime that loads weights locally | Cloud-only auth | Licence, model files, update path |
4 · Hardware: capacity and bandwidth before model names
Local inference is limited first by VRAM capacity, then by memory bandwidth and interconnect. Capacity decides whether it fits; bandwidth decides how long generation waits; interconnect decides whether multiple cards are actually faster. Comparing only TFLOPS or only VRAM misses half the problem.
Laptops, desktops and workstations are three different constraints. A laptop has power limits, cooling and direct-GPU-output support; a desktop has PSU, airflow and sustained load; a workstation adds ECC, lanes and remote management. Treating peak specifications as sustained capability is the most expensive mistake in local hardware selection.
Multiple GPUs are not automatically faster. When the model fits on one card, partitioning, communication and synchronisation can eat the gain. Go multi-GPU only when capacity must expand or throughput must rise. Measure one card before crossing cards.
5 · Speed: separate prefill from decode
Generation speed is not one number. Prefill processes the input and is usually more compute-bound; decode produces tokens one by one and is usually more memory-bandwidth-bound. Long prompts raise time to first token; long outputs raise total time; quantization and batching change the ratio. A single tokens-per-second figure merges two different bottlenecks.
To get a comparable number, record at least: model, quantization, context length, input length, output length, batch size, hardware, runtime version and thermal state. Miss one and the number is only a local reference, not a cross-machine conclusion.
| Metric | Mainly affected by | How to measure | Do not use it for |
|---|---|---|---|
| Time to first token | Input length, prefill compute, batching | Fixed input, repeat and take a distribution | Inferring long-chat experience |
| Decode speed | Memory bandwidth, quantization, batch size | Fixed output length, record inter-token intervals | Representing total generation time |
| End-to-end latency | Input + output + queueing + retries | Time from request to complete result | Representing throughput capacity |
6 · Cost: include idle time, electricity and retries
Local cost is not “GPU price divided by days used”. It includes hardware depreciation, electricity, cooling, operator time, model and dependency updates, retries and idle time. Counting only full-load hours makes local deployment look cheaper than it is.
When comparing with an API, put both on the same workload: same request count, same context, same retry rate, same availability requirement. API unit prices are visible; local labour, idle time and failure costs are not. The invisible part distorts budgets most.
A practical approach: calculate how many hours per day the machine must run and how much concurrency the peak must support. If it runs only two hours a day, idle hardware is expensive. If data cannot leave the premises, cost is not the only factor, but the premium still needs to be written down.
7 · Failure branches: symptom first, cause second
Local deployment failures are rarely just “the model is bad”. OOM, context truncation, quantization degradation, backend mismatch, thermal throttling and driver issues can all look like “bad answers”. Triage by symptom to avoid mistaking an engineering problem for a model problem.
Fails on load
Check first: Format, quantization support, VRAM headroom
Common fix: Change format or lower quantization; reduce offload layers
Crashes after a while
Check first: Long-context KV, concurrency peak, thermals
Common fix: Cap context, cap concurrency, improve cooling
Irrelevant or repetitive output
Check first: Quantization degradation, template, sampling
Common fix: Change quant tier, fix template, reduce randomness
Slows down as chat grows
Check first: Context growth, cache recomputation
Common fix: Trim history, enable cache, summarise in segments
Sudden slowdown
Check first: Power limit, temperature, driver, background load
Common fix: Check temperature and power, roll back driver, isolate load
8 · A minimum path to deployment
Do not buy a card before choosing a model, and do not install a 70B model and then improvise. Follow the order below; if a step fails, stop there instead of stacking unknowns.
- Write the task: what goes in, what comes out, whether retries are allowed, whether data may leave the premises.
- Pick one model and one quantization tier; get the minimum configuration running before chasing the largest model.
- Test four things on a fixed sample: no overflow, enough context, acceptable quality, acceptable latency.
- Record model, quantization, context, batch size, hardware, runtime version and thermal state.
- Measure again under real concurrency; if queueing or timeouts appear, limit load before buying hardware.
- Run a three-year sum: depreciation, electricity, operations, retries, idle time, against the same workload on an API.
- Write failure branches: overflow, truncation, throttling and quantization degradation, and who decides each.
- Keep a rollback before launch: previous model, quantization, runtime and configuration, restorable in one step.
Sources and further reading
These links are for checking facts, licences and official scope. External pages may change; cite the original text and check date.
- Models · GPU cost mathFormulas for weights, KV cache, concurrency and cost.
- Models · Quantization tiersCommon quantization tiers, accuracy and scope.
- Tools · Local model playbookSteps from model choice to a working local run.
- Tools · Local runner comparisonBoundaries between llama.cpp, Ollama, LM Studio and vLLM.
- Hardware · Selection pathWork back from VRAM, bandwidth, power and use case.
- OSS · Local inferenceRepositories and licences for local inference.
- Learn · VRAMConcept page on VRAM, bandwidth and capacity.
Next
If you get stuck while following it, go back to the matching route instead of rereading the whole guide.