Open-Source LLM Deployment Guide: From Parameter Efficiency to Edge Inference

    A practical guide to deploying open-source large language models, covering parameter efficiency, three-tier model evaluation methodologies, Mixture of Experts (MoE) architectures, native multimodal capabilities, and strategies for edge deployment including VRAM estimation and quantization.

    1. Why Parameter Efficiency Matters

    In recent years, discussions around large language models (LLMs) have largely focused on total parameter count. While more parameters typically equate to greater knowledge capacity and potentially stronger reasoning capabilities, training and inference costs also rise. For most enterprises and individual developers, the actual constraints are VRAM, response latency, power consumption, and whether data can leave the local environment. Consequently, the capability achieved per parameter—parameter efficiency—has become a crucial metric during model selection.

    Improvements in parameter efficiency come from two main directions. First, advancements in training data and strategies enable models of the same scale to learn more effective capabilities. Second, architectural optimizations ensure that only a portion of the computational resources is utilized during each inference. The popularization of open-weight models allows these advancements to be directly verified and reused, meaning teams do not have to rely solely on vendor claims.

    2. How to Properly Evaluate a Model

    Public leaderboards provide only a single reference dimension. Leaderboard scores are influenced by the distribution of evaluation questions, prompt templates, and scoring methods, which may not align with specific business performance. It is recommended to establish a three-tier evaluation system:

    1. General Capabilities: Assess reasoning, math, coding, and knowledge QA performance using common benchmarks to shortlist candidates from a large pool of models.
    2. Business Capabilities: Build an evaluation set using real-world business samples, covering standard inputs, boundary inputs, and historical failure cases. Record accuracy and human acceptance rates.
    3. Engineering Metrics: Include Time to First Token (TTFT), tokens generated per second, peak VRAM, concurrent throughput, and stability in long-context scenarios.

    The evaluation set can be organized in a unified structure for batch execution and comparison:

    1. eval_set = [
    2. {"input": "What are the order refund rules?", "expected_keywords": ["7 days", "original payment method"], "category": "Standard"},
    3. {"input": "What if the order number from last week doesn't exist?", "expected_keywords": ["cannot be found"], "category": "Boundary"},
    4. ]
    5. def keyword_hit_rate(answer: str, expected_keywords: list[str]) -> float:
    6. """Calculates the ratio of expected keywords hit in the answer as a rough automated score."""
    7. if not expected_keywords:
    8. return 0.0
    9. hits = sum(1 for kw in expected_keywords if kw in answer)
    10. return hits / len(expected_keywords)

    Keyword hit rate is only for initial screening; tasks involving factual accuracy and reasoning processes still require manual spot checks.

    3. Sparse Activation Architecture: Mixture of Experts

    The Mixture of Experts (MoE) architecture splits the feed-forward network into multiple expert sub-networks, with a router selecting a small number of experts to participate in the computation for each token. The total parameter count determines the model’s knowledge capacity, while the actual activated parameters during each forward pass determine the computational cost. Viewing these two aspects separately is essential to understanding the benefits and trade-offs of such models.

    Sparse architectures introduce three sets of metrics that require balancing:

    • Computation: Related to the number of activated parameters. Under the same total parameter count, inference speed is typically faster than that of dense models.
    • VRAM: All expert weights must reside in memory or VRAM, so memory usage is close to the level corresponding to the total parameter count.
    • Routing and Load Balancing: If routing persistently favors a few experts, those experts will become overloaded while others are insufficiently trained. During training, this issue is usually constrained through auxiliary losses or capacity limits.

    The table below compares the deployment differences between the two architectures:

    Dimension Dense Models Mixture of Experts Models
    Total Parameters & Weight VRAM Directly corresponds to parameter count Corresponds to total parameter count, close to a dense model of similar scale
    Computation per Token Related to all parameters Related to activated parameters
    Inference Throughput Decreases as scale grows Typically higher when VRAM allows
    Deployment Complexity Lower Requires attention to routing, expert distribution, and parallelism strategies

    When selecting a model, VRAM and compute power should be estimated separately. If the device has sufficient VRAM but limited compute, the throughput advantage of sparse models is significant. If VRAM is tight, a smaller dense model might fit the device more easily.

    4. Engineering Significance of Native Multimodal Capabilities

    Multimodal models can process text, image, audio, and video inputs within the same set of weights. Early common practices involved concatenating vision or speech modules with a language model, requiring extra data conversions and service calls between modules. Unified modeling makes cross-modal reasoning more direct and reduces data transfer and latency in intermediate steps.

    Typical scenarios suitable for deployment include:

    • Offline Audio Processing: Noise reduction and voice separation for meeting recordings or field audio, followed by generating text transcriptions and translations.
    • UI Reconstruction: Inputting hand-drawn sketches or page screenshots to generate structured frontend code drafts, which developers then supplement with interaction logic and data interfaces.
    • Document Understanding: Parsing scanned documents, tables, and charts to extract fields and output structured data for downstream business systems.

    From an engineering perspective, three things must be noted. First, multimodal inputs consume a significant amount of context length. Image resolution and video frame extraction rates should be set according to business needs and should not always default to the maximum value. Second, sampling rates, frame rates, and encoding formats for audio and video need to be standardized, and the preprocessing pipeline should be reproducible. Third, code generated by the model must go through compilation, unit testing, and manual review before going live; it cannot be deployed directly.

    5. Edge Deployment: VRAM Estimation and Quantization

    The first step in running a model on edge devices or entry-level GPUs is estimating VRAM. Weight memory usage can be roughly calculated using the following formula:

    Weight VRAM ≈ Number of Parameters × Bytes per Parameter

    The number of bytes per parameter is determined by the quantization precision. A 16-bit float takes about 2 bytes, an 8-bit integer takes about 1 byte, and 4-bit quantization takes about 0.5 bytes. Actual runtime also requires space to store activations, the KV Cache, and runtime caches. The size of the KV Cache grows with context length and can become the primary overhead in long-text scenarios. At the starting phase, it is advisable to reserve a 20% to 30% margin.

    1. def estimate_weight_memory_gb(params_billion: float, bits_per_weight: int)