SysArt
Book a briefing
SysArt

Private LLMs and RAG

Hardware-Aware Model Selection: Matching SLMs to Your On-Premises Compute

How to choose small language models for fixed on-premises hardware: GPU memory and bandwidth, KV cache, quantisation, parallelism and task-based evaluation.

Last reviewed by SysArt AI Architecture Team6 min readHow we review

In short

Hardware-aware model selection starts from the hardware you have rather than from leaderboard scores. Calculate the memory each candidate needs for its weights and key-value cache at your context length and concurrency, shortlist the models that fit, quantise where accuracy allows, and pick the one that performs best on your own tasks under realistic load.

Key takeaways

  • GPU memory is the hard limit: 16-bit weights need about 2 bytes per parameter, and the key-value cache grows with context length and the number of concurrent requests.
  • Generating tokens is usually limited by memory bandwidth rather than compute, so fewer bytes per weight often means faster responses.
  • 4-bit weights often give the best accuracy for a given memory budget, but lower bit widths carry real accuracy risk, especially on harder reasoning tasks.
  • Prefer a model that fits on one GPU; if a model must be split across GPUs, match the parallelism strategy to the interconnect.
  • Choose on your own task benchmark under realistic load, and repeat the selection when models, serving engines or hardware change.
Black graphics card with dual fans for high-performance computing

Why should model selection start from your hardware?

On-premises hardware is fixed, so the best model is the most capable one that fits your memory, latency and concurrency budget, not the one at the top of a public leaderboard. A model chosen from rankings alone can fill GPU memory with its weights, leave little room for the key-value cache and serve only a few requests at a time.

Hardware-aware selection reverses the order: profile the hardware, calculate what fits, shortlist candidates within that envelope, and choose on your own tasks. The same calculation works in reverse when you plan new hardware, because it tells you what a target model needs. Our LLM GPU sizing calculator does the arithmetic for weights, cache and overhead.

Which hardware limits matter most for LLM inference?

Four properties decide what you can serve: GPU memory, memory bandwidth, compute and the interconnect between GPUs.

GPU memory is the hard constraint. The weights, the key-value cache and the serving engine’s working memory must all fit. At 16-bit precision, weights need about 2 bytes per parameter.

Memory bandwidth usually limits how fast tokens are generated. The vLLM authors describe the token-generation phase as memory-bound: producing each token means reading weights and cache from memory, which leaves the GPU’s compute underused. llama.cpp’s published measurements for Llama 3.1 8B show the effect. On the same test machine, which the README does not name, text generation ran at about 29 tokens per second with 16-bit weights, 51 with 8-bit Q8_0 and 72 with 4-bit Q4_K_M: fewer bytes per weight, faster generation.

Compute matters more for processing the prompt. In the same measurements, prompt processing ran at roughly 820 to 920 tokens per second across those three formats and changed little with quantisation. Long prompts, such as retrieved documents in RAG, therefore load the hardware differently from long answers, and both need testing.

Interconnect matters only when a model is split across GPUs. vLLM’s documentation says distributed inference is probably unnecessary if a model fits on a single GPU, recommends tensor parallelism when the model fits on one multi-GPU node, and suggests pipeline parallelism instead when the GPUs lack an NVLink interconnect, for lower communication overhead. A model that fits on one GPU avoids the question.

How do you calculate whether a model fits?

Add three components: weights, key-value cache and working memory.

Weights. Multiply the parameter count by the bits per weight of the format. Real formats store scaling factors alongside the weights, so a 4-bit format uses more than 4 bits: llama.cpp measured 4.89 bits per weight for Q4_K_M and 8.50 for Q8_0 on Llama 3.1 8B. Using those figures:

Parameters16-bit8-bit (Q8_0)4-bit (Q4_K_M)
3 billion6.0 GB3.2 GB1.8 GB
8 billion16.0 GB8.5 GB4.9 GB
14 billion28.0 GB14.9 GB8.6 GB
32 billion64.0 GB34.0 GB19.6 GB
70 billion140.0 GB74.4 GB42.8 GB

The figures are approximate, because bits per weight vary slightly between models.

Key-value cache. For every token processed, the model keeps a key and a value vector in every layer so that it does not recompute them. The vLLM paper gives the example of a 13-billion-parameter OPT model: 800 KB per token, or up to 1.6 GB for a single request of 2,048 tokens. Sixteen such requests at once would need about 26 GB of cache, roughly as much as that model’s 16-bit weights. The calculator applies the same calculation using your model’s layer and key-value head counts.

Working memory. Serving engines need memory of their own, so leave headroom rather than planning to 100% of GPU memory.

The serving engine also changes how efficiently memory is used. vLLM’s PagedAttention manages the cache in blocks to reduce fragmentation and waste, and its authors reported 2 to 4 times higher throughput than FasterTransformer and Orca at the same latency. Our comparison of vLLM, Ollama, llama.cpp and SGLang covers engine choice.

Applied to common configurations, the table suggests where to look:

  • One 24 GB GPU: an 8-billion-parameter model at 16-bit leaves little room for cache; in 4-bit formats, models of around 14 billion parameters fit with room to spare.
  • One 80 GB GPU: 32-billion-parameter models at 8-bit or 70-billion-parameter models at 4-bit fit with room for cache; a 70-billion-parameter model at 16-bit does not.
  • Several GPUs in one server: needed for 70-billion-parameter models at 16-bit. Before splitting one large model across every GPU, consider whether smaller models, each on its own GPU, would serve your mix of tasks better, with a router sending only demanding requests to a larger model, as described in our post on small language models on-premises.
  • CPU-only servers: some quantised formats also run on CPUs; vLLM’s documentation, for example, lists AWQ and GPTQ support on x86 CPUs. Measure whether throughput is acceptable for latency-tolerant batch work before relying on it.

Does quantisation reduce quality?

It can, and the effect depends on the method, the bit width, the model and the task. Two research findings help set expectations.

  • 4-bit weights are usually the best use of a fixed memory budget. Dettmers and Zettlemoyer ran more than 35,000 experiments on four model families and found 4-bit precision almost universally optimal for total model bits and zero-shot accuracy. For a fixed amount of memory, that means a larger model at 4-bit will often beat a smaller model at 16-bit.
  • Lower bit widths carry real risk, especially for reasoning. Liu and colleagues studied quantised reasoning models (COLM 2025). They found that 8-bit weights and activations, or 4-bit weights with 16-bit activations, could be lossless, while lower bit widths introduced significant accuracy risks, with model size, model origin and task difficulty as critical factors.

Choosing a format is also a hardware question. vLLM supports methods such as GPTQ, AWQ, FP8 and GGUF, but support differs by GPU generation; its documentation lists FP8 weight-and-activation quantisation for Ada, Hopper and AMD GPUs, for example. llama.cpp offers many GGUF types, from 1-bit-class IQ1 formats up to 8-bit Q8_0, and notes that smaller types can affect quality. Shortlist the formats your hardware and engine support, then compare them on your own tasks. Our post on model quantisation and pruning goes deeper.

How do you evaluate candidate models on your own tasks?

Public benchmarks measure general capability, not your workload. Build an evaluation set from real examples of each task, with expected outputs, and include the edge cases that matter to the business. Then measure every candidate in the same way:

  1. Task quality on your evaluation set, with the same scoring for every model.
  2. Latency under load: time to first token and time per output token, with realistic prompt and answer lengths.
  3. Throughput at your expected number of concurrent requests, with the serving engine and quantisation you plan to use.
  4. Memory headroom at peak load, including the cache for your longest contexts.

Compare across model families, because the best model for summarisation may come from a different family from the best model for extraction. Check the licence before you shortlist; our guide to open-weight model licences explains the common terms.

How often should you revisit the choice?

Whenever one of the inputs changes. New model releases, serving-engine upgrades with new quantisation formats, hardware purchases or retirements, and workload changes, such as longer contexts after adding retrieval, can all change the best choice. Keep the task benchmark as a living dataset, run new candidates through it, and promote a model only if it beats the current one on your tasks at similar or lower resource use. In production, track the signals that benchmarks miss, such as how often people correct or escalate the model’s output.

Our posts on automated model evaluation and capacity planning for on-premises LLM hardware cover both sides. SysArt applies this method when designing private LLM platforms: the model portfolio is chosen against the client’s hardware, tasks and test data, and revisited as they change.

Featured image by Lilian Do Khac on Unsplash.

Frequently asked questions

How much GPU memory does a 7B or 8B model need?

At 16-bit precision, about 2 bytes per parameter: roughly 14 GB for 7 billion parameters and 16 GB for 8 billion. llama.cpp measured Llama 3.1 8B at about 16 GB in 16-bit, 8.5 GB in 8-bit Q8_0 and 4.9 GB in 4-bit Q4_K_M. The key-value cache and runtime overhead come on top, and with many concurrent or long requests the cache can need as much memory as the weights.

What is the KV cache and how large can it get?

The key-value cache stores attention keys and values for every token already processed, so the model does not recompute them. In the vLLM paper's example, a 13-billion-parameter OPT model needs 800 KB per token, or up to 1.6 GB for a single 2,048-token request. The cache grows with context length and with the number of requests served at once.

Is a larger quantised model better than a smaller full-precision model?

Often, for the same memory. Dettmers and Zettlemoyer ran more than 35,000 experiments and found 4-bit precision almost universally optimal for total model bits and zero-shot accuracy. Later work on reasoning models found 8-bit weights and activations, or 4-bit weights, could be lossless, while lower bit widths carried significant accuracy risk. Always confirm the result on your own task benchmark.

Which quantisation format should we use?

It depends on your serving engine and GPU generation. vLLM supports formats such as GPTQ, AWQ, FP8 and GGUF, but support varies by hardware; its documentation lists FP8 weight-and-activation quantisation for Ada, Hopper and AMD GPUs, for example. llama.cpp offers many GGUF types up to 8-bit Q8_0. Shortlist the formats your hardware supports, then compare accuracy on your tasks.

When should a model be split across several GPUs?

Only when it does not fit on one. vLLM's documentation says distributed inference is probably unnecessary if a model fits on a single GPU, recommends tensor parallelism when it fits on one multi-GPU node, and suggests pipeline parallelism instead when the GPUs lack an NVLink interconnect. Splitting adds communication overhead, so a smaller model on one GPU is often the simpler choice.

Related insights

Plan your private AI with people who build it

Book a briefing. We look at your use case, data and constraints, and you leave with the deployment options and governance steps that fit.