Deploying LLMs Locally: A Practical Guide to Hardware Resources and Quantization
A practical walkthrough of what local large language model deployment actually costs in hardware, using a ~110B parameter model as the reference case. It separates the three resource dimensions developers often confuse — storage, GPU memory, and compute — explains why GPU memory is the binding constraint, and shows how weight memory scales with numeric precision from FP16 to 8-bit and 4-bit. You'll also find the KV cache formula, why context length can consume as much memory as the weights themselves, guidance on choosing an inference framework, and a capacity-planning checklist.
Why Local Deployment Has Become a Cost Question
Driven by requirements for private deployment, data compliance, and cost control, running large language models on your own hardware has shifted from “can we do it?” to “how do we do it affordably?” Compared with calling a hosted cloud API, self-hosting buys you three things: data never leaves your environment, latency you can reason about, and a long-term cost profile you can predict. The main obstacle, however, concentrates in one place — finite GPU memory and storage.
This article uses a large language model in the 100-billion-parameter range as a reference point, breaks down the underlying logic of resource consumption, and helps you get the math right during model selection and capacity planning.
Three Resource Concepts That Are Easy to Confuse
Developers new to model deployment often lump storage, GPU memory, and compute together, which leads to planning mistakes. These are actually three separate dimensions:
- Storage (disk / filesystem): the on-disk footprint of the model weights. It determines how much disk space you need and how much I/O pressure you put on the system when loading the model.
- GPU memory: the memory that inference and training actually run in. It is the hard constraint in the vast majority of scenarios, and the resource most often underestimated.
- Compute (measured in FLOPS): determines how many tokens you can process per unit of time, which in turn drives throughput and response latency.
One point deserves emphasis: a model that fits on disk does not necessarily run. The weights may occupy only tens of gigabytes on disk, but once loaded into GPU memory you must also account for activations, the KV cache, and framework overhead. Actual usage is typically well above the raw weight size. GPU memory, therefore, is the first decision variable in any local deployment.
Storage: The Physical Lower Bound of Model Weights
Weights are stored as tensors and usually distributed as binary files. Absent special compression, the size of the weight file is essentially “number of parameters × bytes per parameter.” For a model of roughly 110 billion parameters:
- Half precision (FP16/BF16): 2 bytes per parameter, roughly 200+ GB of weights.
- 8-bit: 1 byte per parameter, just over 100 GB.
- 4-bit: about 0.5 bytes per parameter, compressible to around 55 GB.
In practice, if you want the weights to live on local disk and load quickly, both disk capacity and read bandwidth will directly affect startup time. Common approaches include distributing and backing up weights via object storage, and using fast local disks or memory mapping to avoid repeated reads and shorten cold-start latency.
GPU Memory Is the Hard Constraint: A Quantitative View of Precision
Estimating GPU memory usage follows a simple but reliable rule:
Weight memory ≈ parameters × bytes per parameter
The numeric precision determines how many bytes each parameter occupies:
- Half-precision floating point (FP16/BF16): 2 bytes per parameter.
- 8-bit quantization (INT8): 1 byte per parameter.
- 4-bit quantization (INT4): about 0.5 bytes per parameter.
For 110 billion parameters, the memory needed for weights alone is roughly 220 GB at half precision, 110 GB at 8-bit, and 55 GB at 4-bit. This is only a theoretical floor. Real inference must add activations, the KV cache, and the framework’s own context overhead, so plan to reserve another 10%–30% on top.
Quantization: Trading Precision for Usability
When the parameter count exceeds the capacity of a single GPU, quantization is nearly the only way to get the model running on consumer hardware or a single server. The essence is straightforward: represent weights with fewer numeric bits, reducing memory usage linearly, at the potential cost of some accuracy loss.
No quantization (half precision)
Keeping the original FP16/BF16 precision gives output quality closest to what you had during training, and suits accuracy-sensitive workloads where GPU memory is plentiful. The downside is the highest memory requirement — a model in this size class often cannot fit on a single GPU at all.
8-bit quantization
Compressing weights to INT8 halves memory usage, with typically minimal accuracy loss, making it the more conservative compromise between quality and resource consumption. For most general-purpose chat and text generation tasks, 8-bit already meets the baseline requirement.
4-bit quantization
Pushing further to INT4 halves memory again, giving models that previously required multiple GPUs a chance to run on one GPU or a smaller GPU count. The tradeoff is greater sensitivity to accuracy loss: perceptible degradation can appear in logical reasoning, numerical computation, and long-document understanding. 4-bit therefore suits resource-constrained environments, or cases where output accuracy does not need to be pushed to the limit.
In engineering terms, quantization falls into two categories: post-training quantization (PTQ) and quantization-aware training (QAT). PTQ requires no retraining and is quick to adopt, which makes it the most common path. QAT simulates quantization error during training and preserves accuracy better, but at higher cost.
The snippet below gives a quick estimate of weight-only memory requirements at different precisions:
def estimate_weight_memory_gb(num_params, bytes_per_param):weight_bytes = num_params * bytes_per_paramreturn weight_bytes / (1024 ** 3)num_params = 110e9 # roughly 110 billion parametersfor name, bpp in [("Half precision FP16/BF16", 2), ("8-bit quantization", 1), ("4-bit quantization", 0.5)]:gb = estimate_weight_memory_gb(num_params, bpp)print(f"{name}: weight memory approx. {gb:.1f} GB")
The KV Cache and Context Length: An Easily Overlooked Memory Sink
Counting weights alone tends to underestimate actual usage. Autoregressive generation requires caching the key-value pairs of previous tokens (the KV Cache), and its size is proportional to “batch size × sequence length × number of layers × hidden dimension.” The longer the context and the higher the concurrency, the faster the KV cache grows — in long-context scenarios it can rival the weight footprint.
The KV cache can be approximated as:
KV ≈ 2 × layers × hidden_dim × sequence_length × batch_size × bytes_per_param
The factor of 2 accounts for the Key and Value caches. For local deployment, this means that even if 4-bit quantization brings the weights down to tens of gigabytes, enabling long context or multiple concurrent streams can still exhaust GPU memory. The practical response is to cap the maximum context length, control the concurrent batch size, and prefer inference frameworks with paged cache management to reduce fragmentation waste.
Inference Frameworks and Engineering Practice
Once your resource plan is clear, picking a suitable inference framework will substantially reduce the difficulty of getting to production. When evaluating options, look at:
- Memory optimization: support for quantized loading, memory paging, and weight sharing; the ability to serve reliably under limited GPU memory.
- Batching and scheduling: support for continuous/dynamic batching to raise throughput.
- Hardware compatibility: maturity of support across different GPU architectures and memory capacities.
- Serving capabilities: whether standard HTTP/gRPC interfaces are provided, to make integration with your application straightforward.
From an engineering standpoint, a pragmatic deployment sequence looks like this: first determine the maximum context length and concurrency the business can accept → work backward to derive the KV cache and activation overhead → sum weights + cache + headroom to set your GPU memory budget → then decide which precision to use and how many GPUs you need.
Hardware Selection and Capacity Planning
Drawing on the analysis above, a few general recommendations:
- GPU memory before compute. Local deployments usually hit the wall on memory first, so check whether the memory capacity can hold the target model before anything else.
- Use quantization to make single-GPU deployment feasible. A model in this size class almost certainly needs multi-GPU parallelism without quantization, while 4-bit quantization substantially lowers that bar.
- Reserve a safety margin. Don’t plan against the theoretical minimum; keep 10%–30% of GPU memory in reserve for fluctuation and spikes.
- Plan around your serving model. Offline batch processing can tolerate lower throughput, whereas interactive online use demands more attention to latency and concurrency.
- Instrument it. Deploy through a container platform, wire up monitoring and alerting, and track GPU memory, utilization, and request latency continuously so you can tune over time.
Summary
The core of local LLM deployment is balancing storage, GPU memory, and compute — and GPU memory is usually the decisive variable. The key conclusion is this: weight memory ≈ parameters × bytes per parameter. As precision drops (half precision → 8-bit → 4-bit), memory usage falls roughly linearly, but so does accuracy. You must also set aside room for the KV cache and activation overhead. Apply this estimation method to your own selection process, combine it with a quantization strategy and the memory optimizations offered by your inference framework, and even with limited compute you can bring a model in this size class into production reliably.
