Running Local LLMs on a Single GPU: VRAM, Quantization, and Capability Limits
A single consumer GPU can run a useful local language model, but fitting the weights into memory is only the first step. This article explains how to estimate VRAM requirements, evaluate quantization quality and inference speed, identify suitable workloads, and compare self-hosting with usage-based APIs. It also provides a practical evaluation workflow for choosing a configuration that balances quality, performance, and cost.
1. Why Single-GPU Local Models Are Getting Another Look
Mid-sized dense language models have improved rapidly in recent years. Better training data and post-training methods have strengthened their performance in coding, tool use, and multistep tasks without substantial increases in parameter count. These gains have prompted some developers to reconsider local deployment.
Local deployment offers four main benefits:
- Data privacy: Sensitive code and business data can remain within the internal network.
- Latency: Eliminating network round trips can make interactions more consistent.
- Predictable costs: After the hardware investment, the marginal cost of inference is largely electricity.
- Offline availability: Models can continue working with limited connectivity or in isolated environments.
However, getting a model to run is not the same as making it production-ready. A viable deployment must fit within available VRAM, retain acceptable quality after quantization, respond quickly enough, and handle the intended tasks reliably.
2. VRAM: Estimate Capacity Before Choosing a Model
A simple formula provides an initial estimate of model weight memory:
Weight memory (GB) ≈ Parameters (billions) × Bits per parameter ÷ 8
For a model with approximately 27 billion parameters:
def estimate_weight_gb(params_b, bits):"""Estimate weight memory in GB, excluding KV cache and runtime overhead."""return params_b * bits / 8for bits in (16, 8, 4, 3):print(f"{bits} bit: {estimate_weight_gb(27, bits):.1f} GB")
The estimated weight memory is:
| Weight precision | Estimated weight memory |
|---|---|
| 16-bit | 54.0 GB |
| 8-bit | 27.0 GB |
| 4-bit | 13.5 GB |
| 3-bit | 10.1 GB |
Loading the full 16-bit weights creates a substantial memory barrier for a single consumer GPU. At around 4-bit precision, the weights alone can fit within the nominal capacity of a 16 GB or 24 GB card. That does not necessarily mean the entire workload will fit.
Weights are only part of the memory budget. Three additional components matter:
KV cache: Memory usage grows linearly with context length. A rough estimate per sequence is:
KV cache bytes ≈ 2 × Layers × KV heads × Head dimension × Context length × Bytes per element
With long contexts, the KV cache can become a substantial fraction of weight memory.
Runtime overhead: Inference frameworks need memory for compute buffers, intermediate activations, and memory fragmentation. Reserving 10%–20% headroom is a reasonable starting point.
System usage: Display output and other processes also consume VRAM, leaving less usable memory than the card’s advertised capacity.
Capacity planning should therefore account for target context length, concurrency, and weight precision together, rather than relying on the weight file size alone.
3. Quantization: Quality Loss Is Not Uniform
Quantization represents model weights with fewer bits. Lower bit widths reduce file size but introduce greater numerical error. Different parts of a model respond differently to that error.
A common engineering approach is mixed-precision quantization. Instead of assigning the same bit width to every layer, it allocates precision according to sensitivity. Layers near the input and output, along with some attention-related layers, are often more sensitive and may benefit from higher precision. Some intermediate feed-forward layers can tolerate more aggressive compression.
At a similar file size, this allocation can keep the quantized model’s output distribution closer to that of the original model.
Quality degradation is usually nonlinear. At higher bit widths, modest reductions in precision may have little effect. Below a certain threshold, quality can deteriorate much more quickly. That threshold depends on the model architecture and workload, so it must be measured on your own evaluation set rather than borrowed from someone else’s results.
Useful quantization metrics include:
- Perplexity: Measures prediction uncertainty on a reference text corpus and indicates changes in overall language-modeling performance.
- Distributional difference from the baseline: Metrics such as KL divergence measure how far the quantized model’s output probabilities diverge from those of the original model.
- Task-level accuracy: Pass rates for code generation, question answering, or structured extraction provide the closest measure of practical usefulness.
Use task-level results as the final decision criterion. Distributional metrics are useful for quickly screening candidate quantizations.
4. Inference Speed: Bandwidth and Concurrency Shape the Experience
LLM inference has two main stages.
Prefill processes the input prompt. It is compute-intensive and affects time to first token.
Decoding generates output tokens one at a time. Each token typically requires reading most of the model’s weights, so this stage is often constrained by GPU memory bandwidth.
Smaller weights mean less data to read during decoding, which can improve speed. However, low-bit weights require dequantization. If computation becomes the bottleneck, that overhead can offset the benefit of reduced memory traffic. Actual performance depends on the hardware and inference implementation and should be measured directly.
Track three metrics:
- Time to first token: The interval between submitting a request and receiving the first output token. This strongly affects perceived responsiveness.
- Decode throughput: Generated tokens per second, which determines how quickly long responses finish.
- Concurrent-request performance: How throughput and latency change when multiple requests arrive together. A single-user setup and a multi-user service can have very different bottlenecks.
5. Capability Limits: Which Tasks Fit Local Models?
A local model’s capabilities should be evaluated by task, not reduced to a single overall score.
Relatively Suitable Tasks
- Single-function or localized code completion
- Explaining error messages and troubleshooting common issues
- Rewriting documents, summarizing text, and converting formats
- Processing internal text with strict privacy requirements
Higher-Risk Tasks
- Large refactoring efforts spanning multiple files
- Long reasoning chains in which intermediate errors are unacceptable
- Tool calls that require strict formatting, where occasional invalid arguments require external validation and retries
- Decision-making tasks with demanding accuracy requirements
Agent workflows are particularly sensitive to the limitations of smaller models. In multistep planning, small errors can accumulate. Common safeguards include limiting the number of steps per task, constraining outputs to structured formats, validating tool arguments outside the model, and providing retries or fallbacks for failed steps.
One practical architecture is to divide workloads by complexity. A local model handles sensitive, frequent, low-complexity requests, while more demanding tasks are routed to a larger model service. Routing rules can use task type, input length, or model confidence signals.
6. Costs: Self-Hosting Versus Usage-Based APIs
Hosted APIs for niche models are not necessarily inexpensive. When demand is fragmented, providers have fewer users over whom to spread fixed costs such as hardware, operations, and capacity reserved for queued requests. Using a hosted service is therefore not automatically cheaper than deploying the model yourself.
Self-hosting costs include:
- Hardware purchase and depreciation
- Electricity and cooling
- Engineering time for model updates, monitoring, and incident response
A simple break-even model can help:
Monthly fixed cost =Monthly hardware depreciation+ Electricity+ Allocated operations laborBreak-even monthly request volume =Monthly fixed cost/ (Cloud cost per request - Local marginal cost per request)
When cloud cost per request exceeds local marginal cost, self-hosting becomes more economical once actual request volume rises above the break-even point. If usage remains below that threshold, usage-based pricing is usually more reasonable.
Base the comparison on realistic demand forecasts rather than intuition.
7. A Repeatable Evaluation Workflow
Before adopting a local model, work through the following steps:
- Define tasks and metrics. List the target workloads and establish measurable acceptance criteria for each.
- Build a private evaluation set. Start with roughly 50–200 real examples, covering both typical inputs and edge cases.
- Filter candidates by VRAM budget. Use the memory estimates above to exclude configurations that will not fit and retain quantized versions that might meet your requirements.
- Measure performance. Record time to first token, decode throughput, and peak VRAM usage. Repeat testing at the intended concurrency.
- Compare quality. Evaluate all candidates on the same dataset. Identify where quality degradation accelerates and choose an appropriate balance between precision and resource use.
- Design routing and fallback behavior. Specify which requests stay local, which go to a cloud service, and what happens when a request fails.
The following illustrative evaluation loop records results consistently across model versions:
def evaluate(model, dataset, checker):results = {"pass": 0, "fail": 0, "latency_ms": []}for item in dataset:start = now_ms()output = model.generate(item["prompt"])results["latency_ms"].append(now_ms() - start)if checker(output, item["expected"]):results["pass"] += 1else:results["fail"] += 1total = results["pass"] + results["fail"]results["pass_rate"] = results["pass"] / totalreturn results
Where possible, checker should use deterministic rules, such as executing unit tests, validating JSON structure, or comparing required fields. This reduces the subjectivity of manual evaluation.
8. Conclusion
A single consumer GPU can run a local language model with practical value. Its usefulness depends on three questions: whether VRAM can accommodate both weights and context, where quantization quality begins to break down on your workloads, and whether those workloads fall within the model’s capabilities.
For developers, the sensible sequence is to estimate memory first, measure quality next, and then evaluate cost. Assigning local models to tasks they handle well—and retaining a cloud option for harder requests—is more reliable and easier to maintain than expecting one deployment approach to replace every other option.
