Deploying Open-Source LLMs Locally: Model Selection and Speculative Decoding in Practice

    This guide explains how to choose an open-source LLM for local deployment across five dimensions—parameter size, quantization compatibility, context length, tool calling, and ecosystem support—and then covers how speculative decoding works and how to deploy an external draft model on an 8-GPU server with a model serving platform.

    Deploying Open-Source LLMs Locally: Model Selection and Speculative Decoding in Practice

    Open-source LLMs are improving rapidly, and more teams want to run inference on-premises or in private environments. Two questions usually come up first: which model to choose, and how to deploy it to fully utilize the available hardware. This article provides a selection framework, explains how speculative decoding works, and then walks through the deployment and benchmarking steps for an external draft model.

    I. Five Dimensions for Model Selection

    Don’t rely on leaderboard scores alone. Evaluate candidates across the following five dimensions.

    1. Parameter Size and VRAM Budget

    The lower bound of VRAM usage is roughly “number of parameters × bytes per parameter,” plus the space required for the KV cache. BF16 uses 2 bytes per parameter; FP8 uses 1 byte. As a rough reference:

    • Models in the 7B–14B range can fit on a single 24GB GPU after quantization, making them suitable for individual developers and lightweight workloads.
    • Models in the 30B–70B range typically require 2 to 4 data-center GPUs with tensor parallelism, fitting mid-sized teams building knowledge-base Q&A or code assistance.
    • MoE models with hundreds of billions of parameters activate only a fraction of parameters per forward pass, but all expert weights must stay resident in VRAM. Estimate VRAM based on total parameters, not active parameters.

    These numbers are only a starting point. Actual VRAM usage also depends on context length and concurrency.

    2. Quantization Precision and Inference Engine Compatibility

    Mainstream open-source models usually ship weights in multiple formats such as BF16 and FP8. FP8 reduces VRAM usage and increases compute throughput, but only if both the inference engine version and the GPU support the corresponding FP8 operators. Before committing, verify three things: the model’s quantization format, the inference engine version, and the GPU’s compute capability. All three must align.

    3. Context Length

    Long contexts multiply KV cache consumption. If your workload only involves single-turn Q&A or short documents, setting a 128K context window simply wastes VRAM. Use the --max-model-len parameter to cap the context length according to actual business needs.

    4. Tool Calling and Reasoning Output

    If your application involves agents or function calling, confirm the tool-calling format the model supports and configure the corresponding parser in the inference engine. If the model emits a structured reasoning trace, you must also configure the appropriate reasoning parser—otherwise the frontend cannot correctly separate the reasoning content from the final answer. Parser names vary by model, so always refer to the model’s official documentation.

    5. Ecosystem and Deployment Toolchain

    Prefer models with an active community, official deployment documentation, and native support in mainstream inference engines. This avoids the “weights downloaded, but nothing runs” scenario. If pulling from certain model hubs is slow in your region, consider mirrors or hubs that offer faster regional endpoints to shorten download times.

    II. How Speculative Decoding Works

    Once the model is chosen, most deployment-level optimization comes from the decoding strategy. Speculative decoding is a widely used acceleration technique with the following workflow:

    1. A draft model quickly generates several candidate tokens. The draft can be a smaller model or the main model’s built-in MTP (multi-token prediction) module.
    2. The main model verifies all candidate tokens in parallel, checking whether they match its own probability distribution.
    3. Accepted tokens are used directly; the main model only needs to regenerate starting from the first rejected position.

    Verification runs in parallel. The higher the acceptance rate, the more tokens each forward pass produces, and the faster decoding becomes. With standard rejection sampling, the output distribution matches the main model exactly, so generation quality is preserved.

    Two common forms of speculative decoding exist:

    • Built-in MTP: The main model ships with its own multi-token prediction module. Since the drafter shares the main model’s origin, acceptance rates are typically high and engineering is simpler.
    • External draft model: An independently released draft model is attached to the main model. This is flexible—the draft model can be upgraded separately—but the acceptance rate depends heavily on how closely the draft’s distribution matches the main model’s. If acceptance is low, the extra verification overhead can outweigh the gains and actually reduce throughput.

    III. Deploying an External Draft Model

    The following example shows how to deploy a “main model + external draft model” setup on an 8-GPU server through a model serving platform. Most steps can be completed in the web UI.

    Prerequisites

    Before starting, verify each of the following:

    • The server has 8 GPUs, and per-GPU VRAM is sufficient for the main model shard, the draft model, and the KV cache;
    • The host NVIDIA driver version is compatible with the CUDA version inside the container;
    • The platform supports custom inference backend versions and can access your chosen image registry;
    • The draft model and the main model must share the same tokenizer vocabulary—otherwise speculative decoding will not work;
    • The inference engine version must support speculative decoding with an external draft model. Check the engine’s official release notes to confirm which version introduced this feature.

    Step 1: Add a Custom Inference Backend Version

    Go to the platform’s inference backend management page, locate the vLLM backend, and click edit. Add a new version in the version configuration, entering the verified vLLM official image tag as the image address. Select the loading method as CUD