How to Choose a Local LLM: VRAM Estimation and Deployment Guide

    Choosing the right large language model for local deployment involves far more than matching parameter counts to available memory. This guide walks through a practical selection framework: defining your task first, estimating VRAM requirements from model weights and runtime overhead, evaluating quantization trade-offs, planning around different hardware configurations, sourcing model files safely, and validating a deployment from first inference to production service. It closes with an evaluation checklist covering quality, performance, and stability, and a recommendation to start with the smallest viable model that meets your goals.

    1. What Determines Whether a Model Can Run Locally?

    The most common question in local deployment is: “How large a model can my machine run?” It’s an important question, but it isn’t the whole story.

    For a model to be suitable for local deployment, four conditions must be satisfied simultaneously:

    1. Task capability match: The model can handle the target language, domain knowledge, and output format.
    2. Sufficient hardware resources: Memory, VRAM, storage, and compute capacity can support inference.
    3. Runtime compatibility: The inference software supports the model architecture, weight format, and quantization scheme.
    4. Clear usage licensing: The model license permits your planned use, modification, and distribution.

    A more sensible selection order is therefore: define the task first, then evaluate candidate models, then calculate resource requirements, and finally verify the deployed result. Choosing a model based solely on parameter count often leads to situations like “it loads, but the output is unusable” or “the answers are good, but the response time is unacceptable.”

    This article focuses on local inference — loading existing weights and generating outputs. Training and fine-tuning involve additional overhead from gradients and optimizer states, so the resource estimates here do not apply to those scenarios.

    2. Choose by Task, Not Just Parameter Count

    Conversational and text-processing tasks: prioritize instruction tuning

    For Q&A, summarization, information extraction, copywriting assistance, or text classification, start with instruction-tuned models.

    Base models primarily learn text distributions and may not reliably follow user instructions; instruction-tuned models are better suited to interactive tasks. That said, “instruction-tuned” does not guarantee good performance on every task — you still need to validate with real business samples.

    For example, for an information extraction task, focus on field-level accuracy, handling of missing information, and the stability of the output structure — not just on whether the answers read fluently.

    Code and reasoning tasks: evaluate with verifiable results

    For code generation, logical analysis, and computation, response length alone says nothing about quality.

    For code tasks, check whether the generated code compiles, passes tests, and handles edge cases; for reasoning tasks, check whether conclusions are correct and evidence is consistent. Longer answers may increase inference time without improving accuracy.

    If local resources are limited, test typical tasks with a smaller model first, then decide whether upgrading to a larger one is worthwhile.

    Vision, speech, and other tasks: account for the full pipeline

    Tasks involving image understanding or speech recognition may require additional encoders, preprocessing components, or other model modules.

    This means you cannot estimate resources from the text-generation parameters alone. The number and resolution of input images, audio duration, and preprocessing method all affect memory, VRAM, and response time.

    Enterprise knowledge Q&A: distinguish missing knowledge from missing capability

    If a model lacks internal policies, business documents, or recent material, simply increasing parameter count may not solve the problem.

    The more common approach is retrieval-augmented generation: retrieve relevant passages first, then let the model compose its answer based on them. This reduces the cost of keeping knowledge up to date and makes it easier to preserve citations.

    However, retrieval augmentation does not automatically guarantee correctness. Document parsing, chunking, retrieval accuracy, access control, and citation verification are all part of overall system quality.

    3. Estimating VRAM: Weights First, Then Runtime Overhead

    The rough rule of “parameter count times two bytes” is a useful starting point, but it only reflects weight size at a specific precision — it is not a complete deployment requirement.

    1. The basic formula for weight storage

    For a dense model, weight storage can be estimated as:

    Weight size in bytes ≈ total parameters × bits per parameter ÷ 8

    If parameter count is expressed in billions (B) and capacity in decimal GB:

    Weight size in GB ≈ parameter count (B) × bits per parameter ÷ 8

    Typical theoretical values:

    Parameter count 16-bit weights 8-bit weights 4-bit weights
    3B ~6 GB ~3 GB ~1.5 GB
    7B ~14 GB ~7 GB ~3.5 GB
    14B ~28 GB ~14 GB ~7 GB
    32B ~64 GB ~32 GB ~16 GB
    70B ~140 GB ~70 GB ~35 GB

    These numbers are theoretical weight sizes only. Actual quantized files may also contain scale factors, grouping metadata, and unquantized parameters, so don’t assume “a 4-bit model occupies exactly the theoretical VRAM.”

    Also note that GB and GiB are measured differently. Keep units consistent when estimating capacity, so unit discrepancies aren’t mistaken for unexpected overhead.

    2. Inference VRAM is more than weights

    A more complete estimate is:

    Peak VRAM ≈ model weights + KV cache + intermediate tensors and compute workspace + runtime overhead

    The KV cache stores reusable attention-related information during generation, and its footprint typically grows with context length and the number of concurrent sequences.

    For standard attention architectures, cache size can be understood through this relationship:

    Cache bytes ≈ 2 × layers × concurrent sequences × cached sequence length × KV heads × head dimension × bytes per element

    The leading “2” accounts for keys and values. Actual cache size also depends on model architecture, cache precision, and allocation strategy, so treat this formula as an estimation framework rather than an exact calculator that applies to every model.

    3. Why “the weights just barely fit” can still fail

    Suppose a model’s 16-bit weights theoretically approach 14 GB. Even if your device has slightly more free VRAM than that, it may still fail to sustain long conversations.

    Reasons include:

    • The inference runtime itself needs VRAM;
    • Input processing and generation produce temporary tensors;
    • Growing conversations expand the cache;
    • Concurrent users increase resource demands;
    • Desktop display or other processes may occupy part of the VRAM.

    Therefore, measure peak usage under your target context length and concurrency load — don’t rely on the occupancy shown when the model finishes loading.

    4. Choosing Quantization: Save Resources, but Validate Quality

    Quantization reduces the numerical precision of parts of the model, lowering weight storage and data transfer costs. It is a key technique for local deployment.

    1. The benefits go beyond file size

    Lower bit widths usually reduce weight footprint, making it possible to deploy models that wouldn’t otherwise fit in VRAM. With suitable hardware and implementations, quantization may also improve inference efficiency.

    But quantization doesn’t automatically speed things up. Actual throughput depends on hardware support, compute kernels, dequantization overhead, and the task profile — always benchmark.

    2. Quantizing weights doesn’t shrink all memory equally

    Weight quantization primarily affects weight storage. Whether the KV cache, intermediate tensors, and workspace also run at lower precision depends on what the runtime supports.

    A 4-bit model can still consume substantial VRAM with long contexts, so you cannot infer runtime memory usage from the model file size alone.

    3. How to decide whether quantization is worth it

    Run controlled comparisons across precisions using identical prompts and generation settings, focusing on:

    • Whether factual answers degrade;
    • Whether numbers, dates, and domain-specific terms become more error-prone;
    • Whether structured output remains stable;
    • Whether pass rates on code and reasoning tasks drop;
    • Whether response time and peak VRAM actually improve.

    For high-risk tasks, keep human review or external rule-based validation in the loop — never rely on the model to guarantee its own correctness.

    5. Deployment Strategies for Different Hardware

    CPU and system memory only

    No discrete GPU doesn’t mean you can’t run models locally. Some inference frameworks support CPU computation.

    This approach suits low-frequency use, offline experimentation, and latency-tolerant tasks, but speed is constrained by CPU capability, memory bandwidth, and the runtime implementation. Start with smaller models and shorter contexts to validate feasibility.

    A single GPU

    Single-GPU deployment is relatively simple and works well as a first production setup.

    Prefer a model that fits entirely in VRAM at your target context length, then gradually tune quantization precision, maximum output length, and concurrency. Don’t sacrifice sustained stability just to fit a larger model.

    Hybrid CPU memory and VRAM

    Some runtimes allow splitting model layers or data between system memory and VRAM.

    This broadens the range of runnable models, but data transfers between devices can become a bottleneck. “It produces output” and “it has usable interactive speed” are two different things — validate them separately.

    Multiple GPUs

    Multiple devices can handle larger workloads by splitting the model or the computation, but they add communication, scheduling, and troubleshooting complexity.

    Summing VRAM across multiple GPUs is not equivalent to having one large GPU. Effective utilization depends on how the model is partitioned, interconnect bandwidth, and the runtime implementation.

    6. Where to Get Model Files, and What to Check

    Obtain models from official release channels, public model hosting platforms, or an approved internal artifact repository. Downloading is only the first step — what matters is a trustworthy source, complete contents, and traceable versions.

    At minimum, check:

    1. Model card: Intended tasks, supported languages, context limits, and known limitations.
    2. License terms: Whether commercial use, modification, and redistribution are allowed, and any additional conditions.
    3. Complete files: Whether weight shards, configs, tokenizer files, and related assets are all present.
    4. Format compatibility: Whether your runtime supports the architecture and quantization format.
    5. Integrity verification: Whether files are corrupted and match the checksums provided by the publisher.
    6. Code execution risk: Some loading processes may execute code bundled with the model — review it first and validate in an isolated environment.

    Enterprise environments should also record the source, download time, file digests, and internal approval results, so the deployed version can always be reproduced later.

    7. From First Run to Local Service: A Practical Workflow

    Step 1: Define acceptance criteria

    Write your requirements as verifiable conditions, for example:

    • Which languages and task types are in scope;
    • Whether internet access is allowed;
    • Typical input and output length ranges;
    • Single user or concurrent multi-user;
    • Acceptable time-to-first-token;
    • Whether sensitive data and access control are involved.

    Without acceptance criteria, deployment easily turns into endless trial-and-error with different models.

    Step 2: Inventory your resources

    Confirm available VRAM, system memory, disk space, compute device status, and runtime environment compatibility. Disk needs to accommodate not just the final weights but also download caches, multiple versions, and temporary space during format conversion.

    Step 3: Run a minimal inference test

    Start the model with short inputs, a single request, and a low output limit. Confirm that loading, tokenization, generation, and stopping behave correctly before scaling up.

    If output is clearly abnormal, check the chat template, tokenizer, special tokens, and generation configuration against the model first — don’t immediately conclude the model lacks capability.

    Step 4: Add load incrementally

    Test in this order:

    1. Short input, short output;
    2. Long input, short output;
    3. Short input, long output;
    4. Concurrent requests;
    5. Sustained operation and recovery from failures.

    This makes it easier to distinguish weight-loading issues from long-context cache issues and concurrency resource issues.

    Step 5: Wrap it as a service with boundaries

    Once you move to a service, add authentication, request length limits, output caps, timeouts, queuing, and concurrency control.

    Local deployment does not automatically mean secure. If the API is directly exposed on the network, unauthorized access, resource exhaustion, and sensitive data leakage can still occur.

    Logs should also avoid indiscriminately recording raw inputs — especially when they involve personal data, internal documents, or business credentials.

    8. Evaluate Whether It’s Worth Deploying, Not Just Whether It Runs

    Evaluation should cover quality, performance, and stability.

    Quality: Build a fixed sample set from real tasks, including routine questions, edge cases, questions with missing information, and questions that should be declined. Use accuracy, field pass rates, citation correctness, or human scoring depending on the task.

    Performance: Record time-to-first-token, sustained generation speed, end-to-end request latency, and peak resource usage separately. Long-input processing and incremental generation have different performance characteristics — a single speed metric can’t capture both.

    Stability: Watch behavior over long runtimes, consecutive requests, abnormal inputs, request cancellation, and recovery after resource exhaustion.

    Keep the model version, quantization scheme, context settings, and generation parameters fixed during testing — otherwise results aren’t comparable.

    9. Final Recommendation: Choose the Smallest Viable Solution That Meets Your Goal

    There is no universal recommendation for local LLMs that applies regardless of context. For most developers, a sensible path is:

    Start with a smaller instruction-tuned model to establish a baseline; expand parameter scale only if task quality demands it. Validate single requests first, then extend to longer contexts and concurrency. Build reliable evaluation first, then discuss more advanced deployment optimizations.

    When results disappoint, diagnose the cause first: is it missing source material, poorly structured prompts, a format mismatch, or genuinely insufficient model capability? Only the last case necessarily calls for switching models.

    The core value of local deployment is a sustainable balance between data control, resource cost, response quality, and maintenance complexity. Parameter count is just one variable. A truly reliable solution is one where resources can be estimated, results can be verified, versions can be traced, and operations can be maintained.