Local LLM Deployment: A Practical Guide to Model Selection and Resource Planning
This article explains how to choose model size, inference precision, and hardware resources for local LLM deployment. It covers VRAM estimation, quantization trade-offs, tiered deployment recommendations, a typical deployment workflow, and lessons from testing a model with about 110 billion parameters.
Local LLM Deployment: A Practical Guide to Model Selection and Resource Planning
As the open-source LLM ecosystem matures, more developers want to deploy large language models on their own servers or in private environments. Whether a model can actually run depends on three core questions: how large the model should be, what precision to use for deployment, and how much hardware is required. This article addresses these questions and presents a practical resource-estimation method based on a real deployment test of a 100B-class model.
1. The Core Decision Chain for Local Deployment
Local deployment is not simply “download and run.” It is a chain of interconnected decisions:
- Define the business goal: Is the model for conversational Q&A, coding assistance, or long-document analysis? Task complexity determines the minimum model capability required.
- Determine model scale: Parameter counts range from hundreds of millions to hundreds of billions. Larger models generally have higher capability ceilings, but resource requirements grow almost linearly, and inference latency becomes more noticeable.
- Choose inference precision: Full precision (FP16/BF16), 8-bit quantization, and 4-bit quantization are the main options. Quantization trades a small amount of accuracy for significant VRAM savings.
- Assess hardware conditions: Use the first two steps to estimate total VRAM and storage requirements, then decide whether to purchase hardware or use cloud GPU resources.
2. VRAM Estimation: Why Quantization Is the Key Variable
During inference, VRAM consumption mainly comes from four parts: model weights, KV Cache, activation values, and inference framework overhead. Model weights account for the largest share, and their estimation is straightforward:
- No quantization (FP16): Each parameter takes about 2 bytes. For a 100B-class model, weights alone require about 200GB of VRAM.
- 8-bit quantization: Each parameter takes about 1 byte, cutting VRAM requirements in half to around 100GB.
- 4-bit quantization: Each parameter takes about 0.5 bytes, reducing weight VRAM to roughly 50GB.
Consider a real test: to verify the actual resource requirements of a 100B-class model, a chat model with about 110 billion parameters was deployed in a cloud GPU environment. Three metrics were observed:
- Storage footprint: Full-precision weight files typically occupy hundreds of GB of disk space, and both download and loading time are significant. High-speed object storage or a large local SSD cache is recommended.
- VRAM consumption without quantization: Under FP16, weights alone require more than 200GB of VRAM. A single GPU, such as one with 80GB of VRAM, cannot hold the model. Weights must be split across multiple GPUs using tensor parallelism, and space must still be reserved for KV Cache and activation values.
- VRAM consumption after quantization: With 8-bit quantization, requirements drop to a level that can be handled by a single machine with multiple GPUs. 4-bit quantization lowers the barrier further; in some scenarios, inference can be completed with only one or two large-VRAM GPUs.
The test results matched theoretical expectations: quantization is the most cost-effective measure in local deployment. The quality loss of 4-bit precision is acceptable in most conversational scenarios, making it the first choice for individuals and small teams.
3. Tiered Deployment Recommendations
3.1 Consumer/Entry-Level Environment (Single GPU with Up to 24GB VRAM)
This tier is suitable for models with 7B–14B parameters. After 4-bit quantization, weights require only 4–8GB of VRAM, leaving room for context cache. Mature inference frameworks are recommended; most support automatic quantized loading and can start a local API service with a single command.
3.2 Workstation-Level Environment (Multi-GPU with 48GB–96GB)
This tier can host 30B–70B models. At this level, weigh 4-bit against 8-bit: use 8-bit for higher quality, or 4-bit for higher concurrency and longer context. Enabling KV Cache quantization can effectively relieve VRAM pressure caused by long contexts.
3.3 Server-Level Environment (Hundreds of GB of VRAM)
Even with 4-bit quantization, 100B-class models require multi-GPU parallelism. At this stage, focus on:
- Parallelism strategy: Use tensor parallelism to split weights, and combine it with pipeline parallelism when necessary.
- Communication overhead: Cross-GPU AllReduce operations slow down inference, and inter-GPU interconnect bandwidth is a key bottleneck.
- Scheduling and monitoring: Use a container platform to orchestrate GPU resources, and pair it with monitoring and alerting services to track VRAM and throughput.
4. Typical Deployment Workflow
Using a common open-source inference framework as an example, local deployment usually follows this workflow:
1. Check hardware: use nvidia-smi to view total VRAM2. Download weights: prefer official channels and verify file integrity3. Choose precision: select FP16 / 8-bit / 4-bit based on VRAM4. Start service: load the model and expose an OpenAI-compatible API5. Benchmark and tune: measure throughput (tokens/s) and time to first token6. Monitor and operate: integrate logging and alerting for long-term stability
For example, call the local service through an OpenAI-compatible interface:
import openaiclient = openai.OpenAI(base_url="http://localhost:8000/v1",api_key="local")resp = client.chat.completions.create(model="local-model",messages=[{"role": "user", "content": "Hello"}])print(resp.choices[0].message.content)
If you prefer a lower-maintenance approach, cloud GPU instances can be used for elastic validation: first run baseline tests on pay-as-you-go resources, confirm quantization precision and concurrency capability, and then decide on a long-term solution. Combined with object storage for weight files and a container platform for managing inference services, this can shorten the deployment cycle from days to hours.
5. Practical Recommendations
- Validate before scaling: Start with a smaller model to verify the business workflow, then gradually increase model size.
- Quantization is not free: Although 4-bit saves VRAM, it may introduce noticeable quality degradation on complex reasoning tasks. Use a business evaluation set for A/B comparisons.
- Context length affects VRAM: KV Cache grows linearly with sequence length. For long-text scenarios, reserve more than 20% VRAM headroom.
- Do not overlook storage and network: Weight files of hundreds of GB place significant demands on disk I/O and download bandwidth.
- Record baseline data: Document VRAM, latency, and throughput at different precision levels as internal reference material for future model upgrades.
There is no one-size-fits-all approach to local LLM deployment. The essence is finding a balance among model capability, inference quality, and hardware cost. By understanding the order-of-magnitude impact of quantization on resources and making decisions based on evaluation feedback from your own business scenarios, you can run LLMs stably in your own environment at the most reasonable cost.
