Local LLM Selection in Practice: VRAM, Speed, and Multimodal Workloads

    This article presents a practical process for choosing and running LLMs locally, beginning with hardware limits such as VRAM and unified memory, then evaluating cold and warm starts, first-token latency, throughput, language quality, instruction following, multimodal support, and chat templates. It maps task types to small, mid-sized, multimodal, and larger or remote models, covers common runtime considerations, and shows how to build a reproducible benchmark and a step-by-step selection workflow.

    1. Why Local Deployment Requires a Fresh Look at Model Selection

    There are usually three reasons to run models locally: data should not leave the device, offline availability is required, or high-frequency calls need lower cost. All three scenarios share the same constraint: hardware. A common personal development setup is a discrete GPU with 8GB to 16GB of VRAM, or a laptop with a larger unified memory pool. On such devices, whether a model fits, whether responses are fast enough, and whether it remains stable over long runs matter more directly than leaderboard scores.

    For this reason, confirm the hardware boundary first, then compare model capabilities. If the order is reversed, it is easy to choose a model that performs well in evaluations but cannot run smoothly on the local machine.

    2. Start with the Hardware Boundary: VRAM Sets the Upper Limit

    2.1 Rough Estimation of Weight Footprint

    The size of model weights is mainly determined by parameter count and storage precision. The following formula can be used for a first-pass estimate:

    Weight footprint (GB) ≈ parameter count (billions) × bytes per parameter

    Common precisions correspond roughly to the following bytes per parameter:

    • 16-bit floating point: about 2 bytes
    • 8-bit integer quantization: about 1 byte
    • 4-bit integer quantization: about 0.5 bytes, slightly higher after adding scaling parameters and other overhead

    For an 8-billion-parameter model, 4-bit quantized weights are about 4GB, but that is only the starting point.

    1. def estimate_weight_gb(params_billion: float, bits: int) -> float:
    2. """Roughly estimate model weight footprint in GB, excluding KV cache and runtime overhead."""
    3. bytes_per_param = bits / 8
    4. return params_billion * bytes_per_param
    5. for size in (4, 8, 14):
    6. for bits in (16, 8, 4):
    7. print(f"{size}B @ {bits}bit ≈ {estimate_weight_gb(size, bits):.1f} GB")

    2.2 Weights Are Not the Whole Story

    Actual VRAM usage includes at least three parts:

    1. Model weights: resident after loading, with size determined by the formula above.
    2. KV cache: grows linearly with context length and the number of concurrent requests. The longer the context, the more it consumes.
    3. Runtime overhead: intermediate computation results, framework-internal buffers, and similar allocations.

    Therefore, a model with about 4GB of weights may use noticeably more VRAM when processing long documents or multi-turn conversations. Leave headroom for context growth during selection, preferably at least 20% to 30% of free VRAM.

    2.3 Dedicated VRAM vs. Unified Memory

    Dedicated VRAM has high bandwidth but limited capacity. Devices with a unified memory architecture can allocate system memory for computation, offering larger capacity but usually lower bandwidth, which affects generation speed. The trade-off is: capacity determines whether a large model fits; bandwidth determines how fast generation feels.

    If VRAM is insufficient to hold the entire model, some layers will run from system memory, and speed will drop noticeably. In this case, rather than forcing a large model, choose a smaller model or a lower quantization precision.

    3. Evaluation Dimensions: Do Not Look Only at Parameter Scale

    Parameter scale is a rough proxy. The following metrics have a more direct impact on daily user experience.

    3.1 Latency: Cold Start and Warm Start

    A local inference service usually needs to load the model from disk into VRAM. This process falls into two categories:

    • Cold start: the model is loaded for the first time, or reloaded after being unloaded from memory. The time depends on disk read speed and model size and may reach more than ten seconds.
    • Warm start: the model is already in VRAM and only needs to receive a request and begin generation. This usually takes hundreds of milliseconds.

    For interactive applications, the wait caused by cold starts is the most noticeable. Solutions include keeping the service resident, setting a reasonable idle unload time, or actively prewarming the model during off-peak periods.

    3.2 First-Token Latency and Generation Throughput

    Perceived speed consists of two parts:

    • First-token latency: the time from sending a request to receiving the first token. It is affected by prompt length; longer prompts increase the prefill phase.
    • Generation throughput: the number of tokens generated per second. It determines how long a long answer takes.

    Their importance depends on the scenario. Tasks such as classification and tagging produce short outputs, so first-token latency is most critical. Long-form writing and code generation depend more on throughput.

    3.3 Capability Dimensions

    In addition to speed, check the following capabilities:

    • Language ability: if the business mainly uses Chinese, test comprehension, summarization, and rewriting quality on Chinese corpora rather than relying only on English leaderboards.
    • Instruction following: whether the model can strictly follow output format requirements, such as a fixed JSON structure or fixed classification labels. This is especially important for pipeline scenarios.
    • Multimodal ability: whether the model can understand images, screenshots, and charts. Multimodal models usually require an additional image encoding step, increasing both VRAM usage and latency.
    • Stability: whether long continuous calls produce truncated output, repetition, or malformed formats.

    3.4 Chat Templates

    Many models have specific requirements for the input message format. For example, system instructions, user messages, and assistant messages need to be organized with fixed markers. If the template is inconsistent, the model may output abnormal content, such as repetition, control tokens mixed into the output, or ignored system instructions.

    The correct approach is to use the template mechanism provided by the inference service, or strictly follow the format published by the model provider when assembling messages. Do not hand-write it based on experience. This issue is most easily overlooked when switching models and should be included as a migration checklist item.

    4. Match Models to Task Types

    4.1 Lightweight Tasks: Small Models as Pipeline Nodes

    Tasks such as classification, keyword extraction, title generation, and short-text rewriting have short inputs and outputs and do not require deep reasoning. Small models offer the best cost-performance ratio for these tasks. They use less VRAM, start quickly when warm, and can process many requests in parallel.

    A suitable approach is to place them at the front or middle of a pipeline for preprocessing and routing, while handing complex tasks to larger models. For example, a small model can first determine which category a user question belongs to, then decide which model or processing path to invoke.

    4.2 Daily Text Workhorse: Mid-Sized Models

    If you want to keep only one general-purpose text model locally, a mid-sized parameter scale is often a good balance. It can handle more complex question answering, summarization, and writing while remaining resident on common consumer GPUs. When choosing, focus on testing output quality in the target language and stability under your own business prompts.

    4.3 Image Understanding: Trade-offs of Multimodal Models

    Multimodal models are suitable for reading screenshots, explaining charts, and identifying interface elements. Their advantage is that they can answer questions about images directly without an additional OCR or image-description pipeline.

    There are two costs. First, image encoding increases VRAM usage and first-token latency. Second, at the same scale, a multimodal model’s text ability may be slightly weaker than that of a pure text model. Therefore, a common approach is on-demand invocation: switch to the multimodal model only when image input is present.

    4.4 Complex Reasoning: Scale First or Offload to a Remote Service

    If a task requires multi-step reasoning, long-chain code generation, or domain-specific analysis, local small models often fall short. In this case, consider a larger model, but accept the cost in VRAM and speed; alternatively, design a fallback strategy that hands the task to a remote service when it cannot be completed locally.

    5. Common Runtime Considerations

    5.1 Using GPUs Through the Linux Subsystem

    Running inference services through the Linux subsystem on Windows is a common approach. Confirm three things:

    1. Whether the GPU device is visible inside the subsystem, which can be checked with a device-information command.
    2. Whether the inference service can use GPU acceleration rather than falling back to CPU.
    3. Whether the GPU driver version meets the inference framework’s requirements.

    Note that an inference service being able to use the GPU does not mean a compute library compiled from source can also use the GPU. To build a GPU-enabled version yourself, you also need to install the compute toolchain provided by the GPU vendor separately and confirm that the compiler can find it.

    5.2 The Value of a CPU Baseline

    During debugging, first running the workflow with the CPU version helps isolate the source of problems. If the CPU version produces correct output but the GPU version behaves abnormally, the issue is more likely in the driver, VRAM, or build configuration. CPU baseline speed does not represent final performance, but it is a reliable reference for troubleshooting.

    5.3 Resident Services vs. On-Demand Loading

    • Resident: the model stays in VRAM, suitable for high-frequency calls with low warm-start latency. The cost is continuous VRAM usage, which may affect other programs.
    • On-demand loading: unload after an idle period, suitable for low-frequency calls. The cost is cold-start latency.

    The two can be combined: keep high-frequency lightweight models resident and load low-frequency large models on demand.

    6. Build Your Own Benchmark

    Public leaderboards and other people’s test data can only serve as references. How a model performs on your hardware, driver, inference configuration, and business prompts can only be obtained through actual measurement.

    6.1 Testing Principles

    • Fix the prompt: use the same input each time for easy comparison.
    • Discard the first result: the first call includes cold-start overhead and should be recorded separately, not included in warm-run statistics.
    • Take the median of multiple runs: single results fluctuate considerably; the median is more stable.
    • Record environment information: including driver version, VRAM usage, system memory, and inference configuration.

    6.2 Example Script

    1. import statistics
    2. import time
    3. def benchmark(generate_fn, prompt: str, runs: int = 5, warmup: int = 1) -> dict:
    4. """
    5. generate_fn: accepts a prompt and returns the number of tokens generated for this run.
    6. warmup: number of warmup runs; results are excluded from statistics.
    7. """
    8. for _ in range(warmup):
    9. generate_fn(prompt)
    10. latencies, throughputs = [], []
    11. for _ in range(runs):
    12. start = time.perf_counter()
    13. token_count = generate_fn(prompt)
    14. elapsed = time.perf_counter() - start
    15. latencies.append(elapsed)
    16. throughputs.append(token_count / elapsed)
    17. return {
    18. "median_latency_s": round(statistics.median(latencies), 3),
    19. "median_tokens_per_s": round(statistics.median(throughputs), 1),
    20. }

    This code calculates end-to-end latency and average throughput. It does not separate first-token latency. If first-token latency is needed, record the arrival time of the first token during streaming output.

    6.3 Test Set Design

    The test set should cover real task types in the business and include expected outputs. For classification tasks, measure accuracy; for formatted output, measure parsing success rate; for summarization and rewriting, manually sample and score the results, or design rules that can be checked automatically.

    7. Model Selection Decision Workflow

    The following table can serve as a starting point for initial screening. Specific values should be based on actual measurements.

    Scenario Preferred model type Metrics to watch Notes
    Classification, tagging, short rewriting Small pure-text model First-token latency, format stability Keep resident; suitable for parallelism
    General Q&A and writing Mid-sized pure-text model Chinese quality, throughput Check VRAM under long context
    Screenshot and chart understanding Multimodal model Image understanding accuracy, latency Invoke only when image input is present
    Complex reasoning and long code Large model or remote service Reasoning accuracy Design a fallback path for local failures

    The decision process can proceed in the following order:

    1. Confirm available VRAM and system memory, and estimate the weight footprint of candidate models.
    2. Reserve headroom for KV cache and runtime overhead, and eliminate candidates that do not fit.
    3. Divide the pipeline by task type and determine the capabilities required at each node.
    4. Run benchmarks on a fixed test set and compare quality, latency, and stability.
    5. Check chat templates and output formats to confirm that migration cost is manageable.
    6. Run a trial under real load for a period and observe VRAM, temperature, and stability.

    8. Common Pitfalls

    8.1 Bigger Parameters Are Always Better

    Increasing parameter scale usually means a higher capability ceiling, but it also means higher VRAM usage and longer latency. For simple tasks, the quality gain from a large model may be limited while the speed loss is obvious.

    8.2 Looking Only at Public Leaderboards

    Leaderboards use specific datasets and evaluation methods that may not match a specific business. A model leading on a leaderboard may perform only average in Chinese business scenarios or under specific format requirements.

    8.3 Ignoring VRAM Headroom

    Selecting a model only by weight size can easily lead to out-of-VRAM errors with long contexts or concurrent requests. Tests should cover the longest input and output to confirm that peak VRAM remains within a safe range.

    8.4 Hand-Writing Chat Templates

    Manually assembling message formats is error-prone, especially when switching models. Using the standard interface provided by the inference service and letting the framework handle templates can reduce a large amount of troubleshooting time.

    8.5 Drawing Conclusions from a Single Test

    A single test is heavily affected by caching, background processes, and temperature. Test multiple times and recheck at different times to confirm that the conclusion is stable.

    9. Summary

    The core of local model selection is to judge hardware constraints, task types, and measured data together. First use the VRAM formula to eliminate models that do not fit, then distinguish cold starts from warm starts, and combine small models, mid-sized models, and multimodal models into a pipeline according to the task. Finally, build your own benchmark with a fixed test set and median statistics, and check the stability of chat templates and output formats.

    Following this order, most personal development machines and small team environments can find a local setup that is both usable and economical.