Running Medium-Sized LLMs Locally on Consumer GPUs: A Practical Selection and Evaluation Guide
Many developers want to run large language models on their own machines for privacy, cost control, and flexibility. This guide explains how to evaluate whether a medium-sized model is worth deploying locally: how much VRAM a model actually needs at different precisions, why Mixture-of-Experts models are easy to misjudge, which factors determine inference speed, how quantization affects quality, and how to interpret public benchmark scores with training data contamination in mind. It includes a sample script for measuring time-to-first-token and decode throughput.
1. Why Run Medium-Sized Models Locally?
More and more developers want to run large models on their personal computers or workstations, mainly for three reasons. First, data stays on the local machine, which suits internal documents, code, and unpublished material. Second, local inference carries no per-call billing, making it well suited to frequent experimentation and batch testing. Third, inference parameters, context length, and system prompts can all be adjusted freely, which makes systematic comparison easy.
Medium-sized models sit at a compromise between capability and hardware requirements. They are clearly stronger than small models while still being able to run on a single high-end consumer GPU. To decide whether a model is worth deploying locally, you need to answer three questions at once: Can the hardware fit it? Is the speed acceptable? Does the quality meet the needs of your actual tasks? The rest of this guide addresses these three questions in turn.
2. Hardware Requirements: VRAM Determines Whether a Model Can Run
2.1 Estimating VRAM Usage
The VRAM occupied by model weights can be roughly estimated with this formula:
Weight VRAM (GB) ≈ parameter count (billions) × bits per parameter ÷ 8
For a dense model with 27B parameters:
- 16-bit (FP16): about 54 GB;
- 8-bit: about 27 GB;
- 4-bit: about 13.5 GB.
Actual usage is higher: you must also account for the KV cache, activation values, and the overhead of the inference framework itself. The KV cache grows linearly with context length, so the longer the context, the less room is left for the weights. A 16 GB GPU can therefore hold 13.5 GB of weights in 4-bit quantization, but there is very little headroom left for long contexts.
By the same formula, a 35B model in 4-bit quantization has theoretical weights of about 17.5 GB, which already exceeds 16 GB. In that case, some layers have to be offloaded to system memory, and generation speed usually drops noticeably.
2.2 VRAM and Compute for Mixture-of-Experts Models
Mixture-of-Experts (MoE) architectures are characterized by a large total parameter count, but only a subset of experts is activated for each token. The benefit is that per-step computation is smaller, so generation speed can approach that of a dense model with far fewer parameters.
The cost is equally clear: the weights of all experts must reside in accessible storage, so VRAM usage scales with the total parameter count, not the activated parameters. In other words, “fewer activated parameters” does not mean “less VRAM needed.” This is the most commonly misunderstood point when deploying models locally. Before choosing a model, use the total parameter count and the size of the quantized weights as the basis for your VRAM budget.
2.3 What Determines Inference Speed
LLM inference typically has two phases. The prefill phase processes the input prompt and is sensitive to compute; the longer the input, the longer it takes. The decode phase generates output tokens one at a time. Each generated token requires reading the participating weights once, so decode speed is mainly limited by memory bandwidth.
This means a speed evaluation must at least distinguish two metrics: time-to-first-token reflects prefill performance, while generation throughput reflects decode performance. The example script below shows how to measure them separately. Here, generate_stream is a placeholder interface and must be replaced with the actual streaming call of your inference service.
import timedef measure_throughput(generate_stream, prompt, max_new_tokens=512):"""Measure time-to-first-token and decode-phase generation speed."""start = time.perf_counter()first_token_time = Nonetoken_count = 0for _ in generate_stream(prompt, max_new_tokens=max_new_tokens):if first_token_time is None:first_token_time = time.perf_counter()token_count += 1if first_token_time is None:return None # No tokens generated; the result is invalidend = time.perf_counter()decode_seconds = end - first_token_timereturn {"time_to_first_token_seconds": round(first_token_time - start, 3),"generation_speed_tokens_per_second": round(token_count / decode_seconds, 2),}
It is worth emphasizing that the same model can show very different speeds on different hardware, with different inference implementations, and at different context lengths. Speed numbers without their test conditions are meaningless; when reporting results, always record these conditions alongside them.
3. Quantization: Trading Precision for VRAM and Bandwidth
Quantization maps model weights from high-precision values to low-bit representations. It reduces both VRAM usage and the amount of data read per step, which makes it especially important for consumer GPUs.
General experience suggests that 8-bit quantization usually causes only minor quality loss, while 4-bit is the common practical compromise. However, the magnitude of precision loss depends on the model architecture, the quantization method, and the task type, so it cannot be generalized. Empirically, demanding tasks such as mathematical reasoning, code generation, and long-chain logic are more likely to expose degradation caused by low-bit quantization.
When evaluating quantized versions, follow these principles:
- Compare different quantized versions of the same model using the same prompts, the same sampling parameters, and the same test set;
- Record VRAM usage, generation speed, and task quality together — all three matter;
- Perform manual spot checks on critical tasks; do not rely solely on automated metrics.
4. How to Interpret Benchmark Scores and Training Data Contamination
Public benchmarks are a common way to compare models, but their reliability depends on whether the test questions have already entered the training data. If the questions or answers appeared during training, the model may simply reproduce memorized content rather than demonstrate genuine capability, and the resulting scores will overstate its real-world performance. When shortlisting models, treat public benchmark scores only as a rough reference, and validate candidates against test cases drawn from your own actual tasks.
