Running LLMs Locally: From Model Selection to Efficient Deployment
Most people start by asking which large language models can run on their own hardware, but that question is narrower than it looks. Deployment success depends less on any curated list of models—lists go stale and models iterate quickly—and more on whether you have a repeatable methodology you can apply again and again. That methodology breaks down into three progressive questions: how to keep finding and shortlisting suitable open-source models, how to tell whether your local hardware (especially GPU memory) can actually hold a target model, and how to deploy and tune it efficiently and reliably. This article walks through those three threads, covering model evaluation criteria, a practical VRAM estimation rule of thumb, quantization and inference acceleration techniques, and a standard deployment workflow you can follow when local capacity runs out.
Reframing the Problem: From “Which Model” to “How to Deploy”
Most people start by asking which large language models can run locally, but that question is narrower than it looks. What actually determines whether a deployment succeeds is not any particular recommendation list—lists go out of date, and models are iterating quickly—but whether you have a methodology you can reuse over and over. That methodology breaks down into three progressive sub-questions:
- How to keep finding and shortlisting suitable open-source LLMs;
- How to tell whether your local hardware (especially GPU VRAM) can hold the target model;
- How to complete deployment and tuning efficiently and reliably.
The rest of this article follows those three threads.
Finding and Evaluating Suitable Open-Source Models
Open-source models are mainly obtained through the major model hosting communities—platforms such as Hugging Face, which work much like code hosting platforms aimed at AI developers. Beyond model weights, they ship companion datasets, inference libraries, fine-tuning frameworks, and tutorials, and they index new open-source releases almost immediately across text, vision, audio, multimodal, and reinforcement learning.
When evaluating a model, focus on a few signals:
- Parameter count in the name: most models state their size in the name. A “6B” model means roughly 6 billion parameters; “7B”, “13B”, and “70B” follow the same convention. Parameter count directly determines the resource requirement.
- The Model Card: it documents training data, intended use cases, known limitations, and recommended usage—your first-hand evidence for whether the model fits your task.
- The license: confirm the terms before commercial use or redistribution to avoid legal risk.
- Community activity: download counts, recency of updates, and issue threads are useful proxies for model quality and ongoing maintenance.
If your network makes the mainstream hubs hard to reach, use a model hub or mirror that is reliably accessible from where you are; these generally mirror the same popular open-source models and give you more stable downloads.
Checking Whether Your Local Hardware Is Enough
The most important constraint on local deployment is GPU memory (VRAM), followed by system RAM, CPU, and disk.
A Rule of Thumb for VRAM Usage
For inference without any quantization, at half precision (FP16/BF16), the industry uses a widely cited rule of thumb:
Model weight VRAM (GB) ≈ parameter count (B) × 2
The “×2” comes from each parameter taking 2 bytes in half precision. That gives quick estimates: a 7B model needs about 14 GB of VRAM for weights alone, 13B about 26 GB, and 70B roughly 140 GB—which is also why 10B-plus and 100B-class models typically require multi-GPU setups.
Note that this formula accounts only for the weights. Actual runtime VRAM usage also includes:
- KV Cache: grows with context length and number of concurrent requests, and becomes especially visible with long inputs;
- Activations and framework overhead: memory management, buffers, and other costs inside the inference framework;
- Batch size: throughput and VRAM consumption move together.
So the usable VRAM you need should sit above the weight estimate—leaving 20% to 30% of headroom (or more) is a common practice.
A Quick Estimation Example
You can pin the estimation logic into a small function:
def estimate_weight_vram_gb(param_billions, bytes_per_param=2):"""Estimate the VRAM used by model weights (GB).bytes_per_param: FP32=4, FP16/BF16=2, INT8=1, INT4=0.5"""return param_billions * bytes_per_paramprint(estimate_weight_vram_gb(7)) # ~14 GB in half precision
Quantization and Inference Acceleration: Fitting Models into Less VRAM
When VRAM falls short, quantization is the most direct lever. It stores parameters at lower numerical precision, cutting memory use substantially while usually giving up very little quality.
| Precision | Bytes per parameter | Weight VRAM for a 7B model | Characteristics |
|---|---|---|---|
| FP32 | 4 | ~28 GB | Common in training, rare in inference |
| FP16/BF16 | 2 | ~14 GB | Default inference precision; balanced quality and memory |
| INT8 | 1 | ~7 GB | Halves memory use with typically minor quality loss |
| INT4 | 0.5 | ~3.5 GB | Further compression; evaluate the quality impact |
Quantization cuts both ways: the lower the precision, the more VRAM you save and the more likely you are to lose output quality. The practical approach is to get things running at half precision first, then step down to 8-bit and 4-bit according to how much headroom you have, and compare output quality on the tasks that matter to you.
A few general acceleration techniques are also worth knowing:
- KV Cache optimization: techniques such as paged management and sharing reduce memory overhead for long contexts;
- Operator fusion and high-performance inference kernels: fewer memory accesses, higher throughput;
- Continuous batching: better GPU utilization under concurrent load.
As a developer, you do not need to study every detail up front, but understanding the trade-off between VRAM, precision, and quality is what lets you make sound decisions.
A Standard Local Deployment Workflow
Stringing those pieces together, a disciplined local deployment roughly follows these steps:
- Take stock of your hardware: confirm GPU model and VRAM capacity, and keep an eye on RAM, disk, and power/cooling.
- Choose the model and precision: pick the model based on task requirements, then the precision (FP16 / INT8 / INT4) based on your VRAM budget.
- Choose an inference framework: use a mature framework, load the model, and configure context length, batching, and related parameters.
- Download and load the weights: prefer a source that is reliably reachable from your network, and verify file integrity.
- Test and tune: validate output quality with real inputs, monitor VRAM and throughput, and adjust precision or concurrency as needed.
When Local Resources Are Not Enough
Not every scenario suits local deployment. When the target model outgrows your local VRAM, or when you need higher concurrency and a stable service, cloud GPU resources are worth considering. Such needs are generally served by standard cloud capabilities: pay-as-you-go GPU compute instances, containerized deployment with elastic scaling, and supporting services such as object storage, logging, and monitoring with alerts. General-purpose cloud infrastructure from providers such as Baidu AI Cloud can supply the compute and operations support for model deployments that exceed local capacity. Choosing whether to move to the cloud is ultimately a trade-off between data privacy and local control on one side, and elastic compute plus operational cost on the other.
Key Takeaways
Back to the opening question: instead of asking which models you can deploy, learn how to deploy models systematically. Following the thread of shortlisting and evaluating models → estimating the VRAM threshold → applying quantization and acceleration → deploying and tuning with a repeatable process, running LLMs locally turns out to be far less mysterious than it seems. Start by getting a moderately sized model working on the hardware you already have, build an intuition for VRAM, precision, and quality, then work your way up to larger models—that is the most reliable progression.
