How to Deploy Large Language Models Locally: A Complete Workflow
This guide breaks down local LLM deployment into a repeatable engineering workflow: how to continuously discover new open-weight models, how to estimate whether your hardware (especially VRAM) can handle a target parameter size, and how to move from setup to validation and ongoing operations. It covers reading model metadata and naming conventions, a practical VRAM estimation formula and script, the impact of quantization, a minimal deployment and smoke-test path, service and operations essentials, and running a resource stress test to build your own model-precision-GPU reference table.
1. Reframe the Problem: Don’t Just Ask “Which Model Can I Run?”
When facing the question “Which large models can I deploy locally?”, a more useful approach is to break the goal into three actionable sub-questions:
- How to continuously discover newly released open-weight models;
- How to determine whether your local hardware (especially VRAM) can support the target parameter scale;
- How to complete deployment, validation, and ongoing operations via the shortest path.
Once the problem is decomposed this way, model selection is no longer guesswork. It becomes a measurable, reproducible engineering process.
2. How to Continuously Find the Latest Open-Weight Models
1. Use model hosting platforms instead of scattered searches
Open-weight models are typically hosted centrally on a few public platforms, in a form similar to code hosting communities for AI developers. They provide model weights, datasets (text, image, audio, video, and more), dependency libraries, and tutorials. Almost every newly released open-source model is synced there first, covering multimodal, computer vision, natural language processing, speech, tabular data, and reinforcement learning.
When searching, pay attention to four metadata dimensions:
- Parameter scale: commonly 7B, 13B, 70B, and so on, where B means billion parameters;
- Weight precision: FP16/BF16, 8bit, 4bit, and so on;
- License: whether commercial use is allowed, and whether attribution or usage restrictions apply;
- Context length and multimodal capability: these determine feasibility for scenarios like long-document or code-base Q&A.
2. Prepare a stable mirror source
Some international platforms are unreliable under cross-border networks. In such cases, you can use model mirrors and dataset services provided by local communities or cloud vendors. A more robust practice is to prepare a temporary pull node in the cloud with object storage, download the weights, archive them to object storage, and then sync them at high speed from the internal network to the local inference machine, avoiding repeated cross-border downloads.
3. Learn to read naming conventions
Model names usually carry information. For example, “chatglm2-6b” indicates the model family is chatglm2 with a parameter scale of roughly 6 billion. Once you understand this convention, you can make a preliminary judgment about resource requirements without even opening the page.
3. Hardware Evaluation: VRAM Is the Hard Constraint
1. The basic estimation formula
Ignoring any quantization, there is a commonly used rule of thumb:
Model VRAM usage (GB) ≈ Parameters (B) × 2
This comes from the fact that each parameter takes 2 bytes under FP16/BF16. Accordingly, 7B needs about 14GB, 13B about 26GB, and 70B about 140GB, and that does not yet include inference framework overhead.
2. Don’t ignore the “invisible usage”
Actual peak VRAM = weights + KV Cache + framework and operator workspace + fragmentation headroom. Among these, KV Cache is roughly linearly related to context length and concurrency, and long-context scenarios are often the last straw that breaks VRAM capacity. In engineering practice, it is advisable to reserve 15%–25% headroom.
3. A reusable estimation script
def estimate_vram(params_b, bits=16, ctx_len=4096, layers=32,kv_heads=8, head_dim=128, batch=1, overhead=0.2):weight = params_b * bits / 8 # GBkv = 2 * batch * ctx_len * layers * kv_heads * head_dim * (bits/8) / 1e9total = (weight + kv) * (1 + overhead)return round(weight, 2), round(kv, 2), round(total, 2)print(estimate_vram(7, 16, 8192)) # (14.0, kv, total)
4. The order-of-magnitude change from quantization
The VRAM difference for the same model across precisions is an order of magnitude: with FP16 as the baseline, 8bit is roughly halved, and 4bit drops to about a quarter. Take a hundred-billion-scale model as an example: FP16 requires multi-GPU parallelism or even tensor parallelism across multiple GPUs on a single machine; 8bit can fit on multiple GPUs in a single machine; 4bit has a chance to run on a single high-VRAM card or two cards. The cost is precision loss and throughput changes, which must be measured against your business tolerance.
5. Should ordinary developers learn quantization and acceleration?
Yes, but only the “enough” parts: how to read precision labels, how to use ready-made quantized artifacts, and how to read VRAM and throughput curves. Low-level operators and kernel optimization are the work of inference engine maintainers.
4. Deployment Path: From Zero to Usable
1. Environment preparation
- Drivers and runtime: confirm that the GPU driver and parallel computing runtime versions match;
- Inference framework: choose a framework that supports the target model architecture and quantization format;
- Dependency isolation: use container images to lock down dependencies and avoid “it works on my machine.”
2. A minimal validation path
# 1) Pull weights (example uses generic placeholders)model pull <org>/<model-name> --precision 4bit# 2) Start the local inference serviceserve --model <model-name> --ctx 8192 --port 8080# 3) Smoke testcurl -s localhost:8080/v1/chat -d '{"messages":[{"role":"user","content":"ping"}]}'
3. Acceptance checklist
- Whether first-token latency and steady-state throughput meet business needs;
- Whether VRAM overflows under long context;
- Whether queuing and timeouts appear as concurrency rises;
- Output stability (variance across repeated tests).
5. Service and Operations Essentials
- Gateway and authentication: a unified entry point, rate limiting, and quotas;
- Observability: a logging service collects the request path, and monitoring and alerting cover VRAM, latency, and error rate;
- Elasticity: orchestrate inference replicas with a container platform and scale by queue length;
- Cost: use object storage as the weight repository to reduce repeated downloads and cold-start time.
6. Run a Resource Stress Test in the Cloud
If local resources are insufficient, you can temporarily rent a multi-GPU cloud host for benchmarking: run FP16, 8bit, and 4bit separately, record peak VRAM, throughput, and first-token latency, and form a “model–precision–GPU count” reference table. This table answers “What can I actually deploy?” better than any recommendation list.
7. Conclusion
The core of local LLM deployment is not a list but a method: use platform-based channels to continuously obtain models, use the VRAM formula and measured data to make decisions, use quantization and inference acceleration to gain feasibility, and use containerization and observability to ensure long-term stability. Once you master this workflow, when a new model is released you only need to swap the weights and parameters, and the entire process is reusable.
