A Practical Guide to Selecting Open-Source LLMs for Local Deployment
This guide explains how to choose open-source large language models for local deployment based on use case and resource budget rather than benchmark rankings. It covers three tiers (7B–8B Q4, 30B-level Q4, and 0.6B–4B quantized edge models), how to estimate VRAM for weights, KV Cache, and runtime overhead, how to select an inference framework and deployment shape, which metrics to measure in your own tests, and how to combine the tiers into a layered edge-to-cloud architecture.
1. Start by clearing up a misconception: use case decides the tier
The most common failure pattern when running LLMs locally is to ask “which model is the strongest,” download the largest parameter version from a leaderboard, and then discover that it does not fit in VRAM, that inference is unusably slow, that memory is exhausted, and that the machine overheats and throttles. The model ends up idle. The root cause is not a bad model; it is the wrong selection order.
The correct order has three steps:
- Define the task boundary: writing and polishing, knowledge Q&A, summarization and translation, or code generation, complex reasoning, and tool-call orchestration.
- Define the resource budget: VRAM capacity, memory capacity, compute (GPU/CPU/NPU), power and cooling, and whether the system must run offline.
- Within that budget, pick a parameter tier and quantization precision that are “good enough and stable.”
In short: there is no universally best open-source LLM, only a tier that matches the scenario. Parameter count sets the capability ceiling, quantization precision sets the deployment cost, and the inference framework sets actual throughput. All three must be traded off together.
2. Three tiers and the selection logic
Tier 1: Lightweight daily use (around 7B–8B, Q4 quantization)
Suitable tasks: writing and rewriting, everyday Q&A, long-document summarization, multilingual translation, structured extraction, simple classification.
Selection points:
- A 7B–8B parameter scale with 4-bit weight quantization usually keeps VRAM use within what a consumer GPU can handle.
- Low time-to-first-token and stable decode speed make the interaction feel close to real time.
- Be realistic about context length: long contexts significantly increase VRAM and compute cost, so enable them only as needed for daily scenarios.
Practical advice: for everyday tasks, the perceived gap between 8B and 30B is often small, while the difference in waiting time and power draw is noticeable every day. Keeping this tier as an always-on service is the most cost-effective approach.
Tier 2: Code and reasoning (around 30B, Q4 quantization)
Suitable tasks: code generation and refactoring, multi-step reasoning, long-document understanding, agent tool orchestration, distillation, and data synthesis.
Selection points:
- The 30B level is clearly better than 8B at complex instruction following and stability on long tasks.
- VRAM demand rises, so a single large-VRAM GPU or multi-GPU parallelism is recommended, and Q4 quantization is almost standard.
- For the inference framework, prefer options that support mechanisms such as continuous batching and PagedAttention to improve concurrent throughput.
- Be careful with distilled versions: distilled models usually lose some general capability, so always test them on your own task set instead of relying only on public leaderboards.
Practical advice: use this tier as the “main inference layer” for complex daily tasks, while keeping the 8B tier to offload high-frequency light tasks, forming a layered call structure.
Tier 3: On-device and edge (0.6B–4B, quantization required)
Suitable tasks: on-device assistants, fixed-flow Q&A, offline command parsing, and simple interaction after local wake-word detection.
Selection points:
- Low-bit quantization (such as a weight-only scheme like w4a16) is mandatory; otherwise edge devices cannot handle the compute and memory load.
- Recognize the capability ceiling: it fits closed scenarios with “fixed tasks and controlled input,” not open-ended chat or complex reasoning.
- Evaluation should focus on prefill and decode speed; both are heavily affected by the compute type and cannot be compared directly across devices.
Practical advice: for on-device solutions, trim capabilities first, narrow open questions to a limited set of intents, then choose the smallest viable model, avoiding power cost paid for redundant capability.
3. Quantization and VRAM: do the math on your budget
Quantization compresses floating-point weights into a low-bit representation, trading controllable precision loss for lower VRAM and bandwidth use. Common approaches include weight-only quantization (such as 4-bit) and joint weight-activation quantization (such as w4a16, 4-bit weights and 16-bit activations).
A simplified VRAM estimation approach (illustrative, not an exact formula):
Weight VRAM ≈ parameter count × bytes per parameterAt Q4, roughly 0.5 bytes per parameterA 70B model's weights ≈ 70 × 0.5 = 35 GB (excluding KV Cache and framework overhead)
What you need to reserve on top of that:
- KV Cache: grows linearly with context length and concurrency, and may become the main cost for long-context scenarios.
- Framework and runtime overhead: the inference framework, VRAM fragmentation, communication buffers.
- Multi-GPU parallelism loss: tensor or pipeline parallelism adds communication and partitioning overhead.
Conclusion: when selecting a model, do not budget for weights alone. Budget for three items — weights + KV Cache + runtime — and leave 15%–20% headroom.
4. Inference frameworks and deployment shapes
Local deployment usually takes one of three shapes:
- An always-on inference service: suited to sharing across multiple users or applications, with throughput and concurrency as the focus.
- One-off script invocation: suited to batch and offline jobs, with startup overhead as the focus.
- Embedded on-device inference: focused on memory use, power draw, and cold-start time.
For framework selection, look for these general capabilities: continuous batching, PagedAttention, quantized inference support, tensor parallelism, and an OpenAI-compatible style API wrapper (which makes integration on the business side uniform). It is also advisable to add an abstraction layer at the interface level so business code is not tightly coupled to a specific inference engine:
# Illustrative: a unified inference interface that hides engine differencesdef chat(prompt: str, max_tokens: int = 512) -> str:# The actual implementation can connect to a local inference service or a general-purpose cloud LLM servicereturn LOCAL_ENGINE.generate(prompt, max_tokens=max_tokens)
5. Real testing: do not substitute your own task set with leaderboards
Whichever tier you choose, run a small-scale test before going live, with four fixed metrics:
- Time to first token (TTFT): determines how the interaction feels.
- Decode speed (tokens/s): determines efficiency for long-form output.
- Peak VRAM: determines whether it runs stably and what the concurrency ceiling is.
- Task accuracy: run a regression on 50–100 of your own samples covering the real input distribution.
When comparing across devices, note in particular that the same model on different compute platforms can differ by an order of magnitude in prefill and decode. This is normal and must not be used to judge whether a model is “good or bad”; it is only a reference for device fit.
6. Layered deployment: combining the three tiers into one system
A mature setup is not “install one model,” but a layered structure:
- Edge layer: a quantized 0.6B–4B model handling wake-word detection, intent recognition, and fixed-flow Q&A.
- Lightweight layer: 7B–8B at Q4 handling high-frequency writing, summarization, and translation.
- Main layer: a 30B-level model at Q4 handling code, complex reasoning, and agent orchestration.
- Optional cloud fallback: for tasks beyond the local capability ceiling, forward them through the unified interface to a general-purpose cloud LLM service so the experience does not degrade.
The benefit of this structure is that cost is allocated per task, latency is optimized per layer, and the capability ceiling is guaranteed jointly by the main layer and cloud fallback.
7. Common pitfalls checklist
- Looking only at parameter count and ignoring quantization: Q4 and Q8 versions of a 70B model are completely different in deployment difficulty.
- Ignoring KV Cache: with long contexts, VRAM gets consumed by the cache.
- Substituting public leaderboards for your own evaluation: task distributions differ, so conclusions do not transfer.
- Cramming a large model onto an edge device: power draw and latency become unacceptable.
- Tight coupling between business code and the engine: switching engines later is costly, so abstract the interface.
- Skipping concurrency stress tests: working for a single request does not mean it works for multiple concurrent ones.
8. Conclusion
The core of deploying open-source LLMs locally is not “chasing the strongest” but “making a match.” Define the use case first, then the tier; calculate the budget first, then the quantization; run real tests first, then pick the main model. Keep the 8B tier always on, the 30B tier as the main layer, and the 0.6B–4B tier on-device, together with a unified interface and cloud fallback, and you get stable, scalable local inference at a controllable cost. If you need elastic scaling and unified operations, you can also combine local inference with general cloud capabilities such as general-purpose cloud LLM services, container platforms, logging services, and monitoring and alerting, forming a layered “device–edge–cloud” architecture.
