Choosing a 30B Dense LLM and Deploying It on a Single GPU: A Practical Guide
This guide walks through how to select and deploy a ~30B parameter dense large language model on a single GPU. It explains how to choose between a dense and a mixture-of-experts (MoE) architecture, how to estimate VRAM for both weights and the KV cache, which quantization strategy to use, how to validate effective long-context behavior, and how to conditionally verify multimodal and agent capabilities. It also provides step-by-step single-GPU deployment guidance, a risk checklist, and an evaluation checklist with clear go/no-go thresholds. It is aimed at small and mid-sized teams that want a predictable, manageable, and cost-conscious path to production.
Decide by boundaries first: then measure VRAM and run evaluations
For a dense LLM at roughly the 30B parameter level, the most important question is not “will it fit on a single GPU?” but rather clarifying three things first:
- Does the business need stable low latency and high concurrency? Dense models activate all parameters on every forward pass, so their inference behavior is more predictable and better suited to production environments with steady throughput and latency requirements.
- Does the VRAM budget support the target context length and concurrency? Weight memory is only the baseline. The KV cache, runtime overhead, and batched requests can significantly amplify memory pressure.
- Do you have an executable evaluation loop? Quantization, long context, multimodality, and agent capabilities cannot be judged from nominal specifications alone. They must be validated against task samples.
If the business goal is complex reasoning, code assistance, document understanding, or long-text Q&A, and the team wants a more deterministic deployment path, a 30B dense model is usually a pragmatic choice. If you pursue maximum parameter efficiency and can absorb more complex operations, you may then evaluate a mixture-of-experts (MoE) architecture.
1. Dense vs. MoE: the trade-offs at a glance
| Dimension | Dense model | Mixture-of-Experts (MoE) |
|---|---|---|
| Active parameters | All parameters active on every forward pass | Only part of the expert subnetworks are active |
| Compute predictability | High; latency and throughput are more stable | Affected by routing policy; variation is more complex |
| VRAM usage | Directly tied to total parameters | Usually higher, as it must hold all expert parameters |
| Throughput tuning difficulty | Lower; easier to enable continuous batching | Higher; requires load balancing and communication handling |
| Operational complexity | Relatively simple | Higher; expert load imbalance must be watched |
| Typical scenarios | Stable production serving, single- or few-GPU deployment | Very large parameter scale, total-cost-sensitive scenarios |
For most small and mid-sized teams, the value of a dense model lies in being controllable. It sacrifices some parameter efficiency in exchange for more stable capacity planning, a simpler deployment pipeline, and service levels that are easier to guarantee. In a single-GPU or few-GPU environment, the dense architecture is easier to make predictable, observable, and rollback-capable.
2. Single-GPU VRAM estimation: don’t look at weights alone, also account for the KV cache
Using a ~30B parameter model as an example, weight VRAM can be estimated as follows:
| Weight precision | Estimated weight VRAM | Notes |
|---|---|---|
| FP16 | ~60 GB | High precision, but heavy VRAM pressure; usually only suitable for 80 GB cards with controlled context and concurrency |
| INT8 | ~30 GB | A common balanced option, suitable for 48 GB or 80 GB cards |
| INT4 | ~15 GB | Low VRAM footprint, better suited to 24 GB to 48 GB cards, but precision loss must be validated |
The table above only covers weights. Actual deployment must add the following overhead:
- KV cache: grows with sequence length and concurrency;
- Activation memory: affected by batch size and the inference framework;
- Runtime overhead: CUDA context, operator caches, memory fragmentation, etc.;
- Safety margin: reserve 10% to 30% of VRAM to avoid peak-time OOM.
The KV cache can be roughly understood as:
KV cache ≈ 2 × num_layers × num_kv_heads × head_dim × seq_length × batch_size × bytes_per_element
As an illustrative scenario: if the model has 40 layers, 8 KV heads, and a head dimension of 128, then with an FP16 KV cache each 1024 tokens consumes on the order of tens of MB. When the context is raised to 8192 tokens and concurrency increases, the KV cache can quickly swell to several GB. Applying KV cache quantization can significantly reduce this pressure, but precision and recall over long sequences must still be validated.
Based on this, single-GPU selection guidance is as follows:
- INT4 + 24 GB card: suitable for low-concurrency, shorter-context validation environments; not recommended for directly serving high-concurrency production traffic;
- INT4 + 48 GB card: suitable for moderate concurrency and longer context; a strong price/performance production candidate;
- INT8 + 48 GB card: suitable for higher-precision requirements with moderate context length;
- INT8 or FP16 + 80 GB card: suitable for long context, high concurrency, or precision-sensitive business, but at higher cost.
3. How to quantize: it’s not about saving the most, but balancing precision, latency, and cost
Common quantization directions include weight quantization, KV cache quantization, and runtime precision control. The engineering workflow is recommended as follows:
- Run an FP16 or high-precision baseline first: confirm the model’s initial performance on your business samples.
- Evaluate INT8 first: it usually preserves precision more easily and is suitable for quality-sensitive business.
- Then evaluate INT4: if INT8 still lacks sufficient VRAM, try post-training quantization schemes such as GPTQ or AWQ.
- Validate long context and code ability separately: math, code, and long-document tasks are more sensitive to quantization and cannot be judged by general Q&A alone.
- Set acceptable thresholds: for example, general Q&A accuracy drops by no more than 1%–2%, and code pass rate drops by no more than 3%; otherwise the scheme should be adjusted.
Quantization is not simply about shrinking model size; it is a multi-objective optimization. If the business has high requirements for answer accuracy, blindly choosing INT4 may lead to failed long-context retrieval, degraded code completion quality, or unstable math reasoning.
4. How to validate long context: effective context matters more than nominal context
Supporting a 256K, 128K, or 32K context does not mean the model can effectively use information at every position. Long-context deployment must focus on validating:
- Nominal context: the maximum input length the interface allows;
- Effective context: the range over which the model can still reliably locate, cite, and reason over key information at that length.
A “needle-in-a-haystack” style test is recommended:
| Test item | Suggested content |
|---|---|
| Single-needle retrieval | Insert one piece of key information into a long text and check whether the model can recall it accurately |
| Multi-needle retrieval | Insert multiple pieces of key information and check whether they can be recalled together and ordered correctly |
| Position robustness | Place key information at the start, 25%, 50%, 75%, end, and other positions |
| Long-text reasoning | Ask the model to summarize, compare, or compute based on information spanning paragraphs |
| Citation accuracy | Ask the model to provide its basis and check whether it cites the correct segments |
If the business involves very long documents, also observe:
- whether first-token latency rises significantly;
- whether VRAM usage grows linearly or even super-linearly with context;
- whether KV cache quantization causes a drop in recall;
- whether long sequences trigger truncation, sliding window, or position-encoding extrapolation strategies.
5. Multimodal and agent capabilities: verify conditionally, don’t assume by default
Some 30B-class models may support image or video understanding or tool calling, but whether they are truly usable depends on the specific version, interface format, and task scenario. Before deployment, it is recommended to verify:
- whether the target image or video format is supported;
- whether OCR, chart parsing, and layout reconstruction meet business precision;
- whether function calling, structured output, or JSON mode is supported;
- whether multi-turn tool calling can reliably complete multi-step tasks;
- whether the agent flow provides failure retries, timeout control, and permission isolation.
For code scenarios, focus on code completion, bug fixing, unit test generation, and repository-level Q&A. Don’t rely solely on leaderboards; instead, validate compilation pass rate, test pass rate, and human adoption rate on your own code samples.
6. Single-GPU deployment steps and risk checklist
1. Minimum hardware threshold
Choose based on quantization precision and context requirements:
- INT4: a 24 GB card can validate; 48 GB is more stable;
- INT8: start at 48 GB; 80 GB is more comfortable;
- FP16: start at 80 GB, with strict control over concurrency and context.
2. Inference framework configuration
Prefer an inference engine that supports continuous batching, paged memory, quantized inference, and an OpenAI-compatible interface. An example launch command:
python -m vllm.entrypoints.openai.api_server \--model /models/llm-30b-int4 \--quantization awq \--tensor-parallel-size 1 \--max-model-len 8192 \--gpu-memory-utilization 0.9 \--enable-chunked-prefill
Actual parameters must be adjusted for the model format, GPU VRAM, and business concurrency. In production, it is recommended to set a maximum context, maximum output length, and request timeout to avoid a single request dragging down the service.
3. Weight loading and stability
- Load weights from object storage or reliable local storage;
- Verify the weight file hash or version number before startup;
- Keep the previous model version to support fast rollback;
- When containerizing, set resource limits and health checks;
- Apply least privilege: make the model directory read-only and expose only the necessary interfaces to the service account.
4. Health checks and monitoring metrics
At minimum, monitor:
- GPU VRAM utilization;
- request queue length;
- first-token latency;
- per-token output latency;
- QPS and concurrency;
- OOM, load failures, timeouts, and 5xx error rates;
- quality evaluation metrics before and after quantization.
5. Risk notes
- Insufficient VRAM: first reduce context length or concurrency, or switch to lower precision;
- Precision drop: complete A/B testing on business samples before going live, and roll back to INT8 if necessary;
- Weight loading failure: keep a local cache and a backup version;
- Rising cost: set elastic scale-up limits to avoid unrestricted growth from long-context requests;
- Security risk: tool calling and file parsing capabilities require permission isolation to prevent unauthorized access.
7. Evaluation checklist: use data to decide whether to go live
| Evaluation type | Suggested sample count | Key metrics | Suggested threshold |
|---|---|---|---|
| General understanding | 200–500 | Accuracy, human adoption rate | Not significantly below baseline |
| Math reasoning | 100–300 | Accuracy, step completeness | Drop no more than 2%–3% |
| Code generation | 100–300 | Compilation pass rate, test pass rate | Drop no more than 3%–5% |
| Long-context retrieval | 50–200 | Recall, position robustness | Key positions recall stably |
| Safety compliance | As needed | Unauthorized access, leakage, non-compliant output rate | Meets the business safety baseline |
It is recommended to adopt a small-traffic A/B approach: first internal evaluation, then small-traffic canary, then full rollout. Change only one variable at a time—for example, the quantization scheme, context length, or inference framework version—so that problems can be pinpointed.
8. FAQ: how to choose a 30B dense model?
Q: How do I choose a single GPU for a 30B dense model?
A: Look at VRAM and context first. INT4 suits 24 GB to 48 GB for validation or moderate production; INT8 is recommended from 48 GB up; FP16 usually needs 80 GB with limited concurrency. Long context and high concurrency significantly increase the KV cache, so leave a margin.
Q: Should I choose INT8 or INT4 quantization?
A: Prefer INT8, then evaluate INT4. If the business has high precision requirements for code, math, or long documents, don’t choose INT4 simply because VRAM is tight.
Q: What are common mistakes?
A: Looking only at weight VRAM while ignoring the KV cache; looking only at nominal context without running a needle-in-a-haystack test; judging model ability from general leaderboards alone; having no rollback plan; failing to monitor first-token latency and OOM.
Q: How do I validate long context?
A: Use multi-position key-information retrieval, multi-needle recall, cross-paragraph summarization, and citation-accuracy tests. Focus on effective context, not the maximum length the interface allows.
Summary
The core value of a 30B dense model is striking a balance among capability, cost, and maintainability. Whether single-GPU deployment succeeds depends on whether you seriously calculate weights, KV cache, and runtime overhead; whether you complete quantization precision validation; and whether you establish a long-context and business evaluation loop. Doing the groundwork on selection, VRAM, risk, evaluation, and rollback in advance is what lets you build a service that is both robust and economical.
