Cost Estimation for Local Deployment of Open-Source LLMs
A practical framework for translating open-source LLM parameter counts into GPU memory requirements, hardware tiers, and layered budgets. The article also covers software optimizations such as quantization, continuous batching, KV cache tuning, speculative decoding, and tiered inference to reduce cost without changing the original engineering conclusions.
Local Deployment of Open-Source LLMs: A Complete Cost Estimation Framework from Memory Sizing to Layered Budgeting
1. Why “Local Deployment Quotes” Often Look Unreasonable
Many teams evaluating self-hosted inference for open-source LLMs are surprised by how expensive the initial estimates appear. A model in the hundreds of billions of parameters requires roughly 2 TB of GPU memory for weights alone at FP16 precision. Even with FP8 or INT8 quantization, that figure is still around 1 TB. This does not include KV cache, activations, runtime overhead, or headroom for concurrency.
As a result, the “minimum configuration” quoted by vendors or community guides is usually just the floor for “the model can start.” The “recommended configuration” is the realistic threshold for “the service can remain stable.” These two numbers often differ by several times. This article does not repeat pricing for any specific product. Instead, it provides a reusable estimation framework that you can apply to any open-weight model to calculate your own numbers.
2. Step 1: Translating Parameter Count into GPU Memory Requirements
GPU memory usage can be broken into four parts. Estimating each separately is far more reliable than relying on intuition.
2.1 Weight Memory
Weight memory is approximately equal to parameter count multiplied by bytes per parameter. Common precision levels are shown below:
| Precision | Bytes per parameter | Weight footprint for a 100B-class model |
|---|---|---|
| FP32 | 4 | Around 400 GB |
| FP16 / BF16 | 2 | Around 200 GB |
| FP8 / INT8 | 1 | Around 100 GB |
| INT4 with group quantization | Around 0.5 to 0.6 | Around 50 to 60 GB |
Note that “100B-class” is only an order-of-magnitude description. The actual model may be 100B, 130B, or 236B. Always use the real parameter count from the model card. A 2x difference in parameters can shift the hardware budget by an entire tier.
2.2 KV Cache
This is the most commonly underestimated part. KV cache size scales linearly with concurrency and context length:
KV cache bytes ≈ 2 × layers × attention heads × head dimension × sequence length × concurrency × bytes per element
A simplified way to think about it: the longer the context and the higher the concurrency, the more likely KV cache is to overtake weight memory. In a scenario with 128K context and dozens of concurrent requests, KV cache consuming hundreds of GB of GPU memory is not unusual. Engineering practices typically use paged attention, KV quantization, and prefix caching to control this overhead.
2.3 Activations and Temporary Buffers
Activations during inference are much smaller than during training, but they still matter for long sequences and large batches. A common rule of thumb is to reserve 5% to 15% of weight memory for activations. Frameworks also have fixed overhead from communication buffers and operator workspaces, so it is reasonable to add another 10% or so.
2.4 A Rough Total Memory Formula
Total GPU memory ≈ weights × 1.1 (framework overhead) + KV cache + activation buffer + safety margin (10% to 20%)
Including the safety margin is what separates “it works in a lab” from “it survives in production.”
3. Step 2: From GPU Memory to Hardware and Layered Budgets
3.1 Single Node Multi-GPU or Multi-Node Cluster
GPU memory requirements first determine the number of accelerators, which then determines the number of nodes. Using 80 GB per GPU as a common reference:
- 200 GB of weights at FP16 requires at least 3 GPUs. With headroom, 4 or 8 GPUs is typical.
- 100 GB of weights at FP8 plus 100 GB of KV cache plus headroom calls for at least 8 GPUs.
- 50 GB of weights at INT4 with moderate concurrency can be supported by 4 GPUs in a single node.
When a single node cannot provide enough accelerator memory, tensor parallelism and pipeline parallelism become necessary. Cross-node communication then becomes a bottleneck, and network interconnect costs rise significantly. Many budget jumps happen here. Moving from an 8-GPU single node to a multi-node cluster does not just add more accelerators. Switches, cabling, rack power, and cooling all need to be recalculated.
3.2 The Right Way to Layer the Budget
It is better to split the budget into four layers instead of reporting a single total:
- Compute layer: number of accelerators multiplied by unit price. This is usually the largest cost.
- Host layer: CPU, memory, local storage, motherboard, and power. Typically 15% to 30% of the compute layer.
- Interconnect layer: intra-node high-speed links and cross-node networking. In multi-node scenarios, this may account for 10% to 20%.
- Facilities layer: data center power, cooling, racks, and operational monitoring. This is a continuous long-term expense.
The “minimum starting price” usually covers only the compute layer plus a minimal host layer, and assumes extremely low concurrency, short context, and single-node deployment. The “recommended configuration” includes interconnect, facilities, and redundancy. A difference of several times between the two is normal, not inflated pricing.
3.3 A Rule of Thumb
For every 100B parameters at FP8 precision with moderate concurrency and 8K context, expect roughly one machine with eight high-memory GPUs. This rule helps you quickly judge the hardware tier for any model, then adjust upward or downward based on context length and concurrency.
4. Step 3: Reducing the Budget with Software Techniques
Hardware is a rigid cost. Software optimization provides flexibility. On the same hardware, the following techniques can significantly improve effective throughput.
4.1 Quantization
INT8 or FP8 quantization cuts weight memory in half. INT4 cuts it by roughly half again. The trade-off is accuracy loss, which must be evaluated per use case. For most question answering, summarization, and retrieval-augmented generation tasks, INT8 is often nearly lossless. INT4 requires careful validation on long-tail behavior.
4.2 Continuous Batching and Request Scheduling
Static batching lets long requests hold up short ones, leaving GPUs idle. Continuous batching dynamically groups requests at the token level. Combined with priority queues and timeout controls, it can improve throughput several times under the same GPU memory budget. This is one of the most cost-effective optimizations available.
4.3 KV Cache Optimizations
Paged attention reduces memory fragmentation. KV quantization compresses cache to FP8 or INT4. Prefix caching allows requests with identical system prompts to reuse computation. Together, these three techniques can meaningfully reduce memory pressure in long-context scenarios.
4.4 Speculative Decoding and Distilled Small Models
For latency-sensitive workloads, speculative decoding uses a small model to draft tokens and a large model to verify them, improving generation speed. For cost-sensitive workloads, a distilled small model handles most traffic while the large model processes only difficult cases, forming a tiered inference architecture.
4.5 Tiered Deployment Strategy
Not every request requires the strongest model. Route traffic by difficulty: simple intent recognition and formatted extraction go to a small model, while complex reasoning goes to a large model. Total hardware requirements can drop by more than half in some cases.
5. A Practical Evaluation Workflow
The steps above can be combined into a repeatable process:
- Confirm the real parameter count and license, and check the precision list in the model card.
- Define business requirements: peak concurrency, average context length, acceptable time to first token, and generation speed.
- Estimate weights plus KV cache plus buffers using the formulas above to get total GPU memory.
- Convert memory into GPU count and node count, and determine whether multi-node parallelism is needed.
- Add host, interconnect, and facilities costs to form two budgets: minimum tier and recommended tier.
- Prepare a software optimization plan: quantization, batching strategy, caching strategy, and tiered inference.
- Run small-scale load tests with realistic traffic distribution to correct the estimate before final procurement.
6. Common Mistakes
- Looking only at weight memory: ignoring KV cache and concurrency is the leading cause of budget failures.
- Testing short context but deploying long context: passing at 4K does not mean passing at 128K. KV cache grows linearly.
- Ignoring networking costs: interconnect is one of the most underestimated items in multi-node deployments.
- Buying for peak load: for services with a high peak-to-average ratio, a hybrid model of elastic capacity plus a small always-on cluster is more economical.
- Purchasing without load testing: estimates always contain error. Validate the throughput curve with a small number of GPUs first, then scale.
7. Conclusion
Local deployment of open-source LLMs is fundamentally a balancing problem among GPU memory, concurrency, and cost. Convert parameter count into memory, memory into accelerator count, and accelerator count into a layered budget. Then apply quantization, continuous batching, caching, and tiered inference. The result is an assessment that is both realistic from an engineering perspective and defensible under financial review. The next time you see a “starting price,” ask immediately: what concurrency, what context length, and does it include interconnect and facilities? Different answers naturally lead to different numbers.
