Open-Source LLM Selection Guide: Edge Deployment vs. MoE

    This article provides a practical framework for choosing open-source LLMs across edge small models, MoE models, and Dense models. It covers license and model-card checks, edge memory estimation, structured-output failures in lightweight agent workflows, MoE versus Dense deployment constraints, reproducible evaluation methods, cloud-edge routing rules, monitoring metrics, and fallback risks.

    1. Confirm the Model Matrix and License Boundaries

    Before selecting a model, read the model card and license agreement carefully. A model card usually lists parameter scale, supported context length, recommended quantization formats, and inference frameworks. The license agreement determines whether the model can be used commercially, modified, and redistributed, and whether there are restrictions on user scale or use cases. Use the official source for both; do not rely only on secondhand summaries.

    The model matrix discussed here is roughly divided into three tiers: 2B and 4B-class edge small models, 26B-class MoE (Mixture of Experts) models, and 31B-class Dense models. These tiers indicate parameter scale only, not a performance ranking. Within the same tier, differences from training data and quantization methods are often larger than differences between tiers.

    2. Edge Small Models: Calculate Memory First, Then Discuss Speed

    The memory or VRAM on an edge device is a hard constraint. You can use the following formula for estimation:

    Memory footprint ≈ number of parameters × bytes per parameter + KV Cache + inference framework runtime overhead

    Take a 2B-parameter model as an example. With 4-bit quantization, each parameter takes about 0.5 bytes, so the weights are about 1 GB. Actual usage also includes KV Cache and the inference framework’s own overhead. KV Cache grows linearly with context length and the number of concurrent requests, so the same model may use very different amounts of memory at a 2K context versus a 16K context.

    Before deployment, confirm the following items one by one:

    1. The target context length, and the total number of tokens for the longest input plus the longest output.
    2. The number of concurrent requests. Edge devices usually handle only a single request path, but if there are background tasks, they need to be calculated separately.
    3. The quantization format. Lower-bit quantization saves memory but may affect output quality, especially for structured output and code generation.
    4. The inference framework version. The same model may use different amounts of memory and achieve different speeds in different frameworks.

    3. Lightweight Agent Workflows: Structured Output Is the Most Common Failure Point

    When small models perform intent recognition, parameter extraction, and simple scheduling on edge devices, common problems tend to concentrate on structured output. A typical workflow is: the model reads user input, determines intent, outputs JSON, and then the program calls the corresponding skill module.

    For troubleshooting, check in the following order:

    1. JSON parsing failure rate. Record whether each output can be parsed on the program side, and calculate the failure ratio.
    2. Schema validation. Use JSON Schema to check field names, types, and required fields. Missing fields are more common than format errors.
    3. Prompt constraints. Explicitly require JSON-only output and provide one or two complete examples.
    4. Retry strategy. When parsing fails, retry at most once or twice, each time with the error information attached. If retries still fail, route the request to a human or the cloud.
    5. Branch coverage. Turn all intent branches into test cases and confirm that each branch can be triggered.

    For multi-skill dispatch, also pay attention to input length. The longer the input, the more likely a small model is to miss constraints. If a single request needs to cross multiple skill modules, split it into multiple calls and let the program handle the orchestration instead of asking the model to complete all scheduling at once.

    4. MoE vs. Dense: Selection Depends on Constraints

    The core of MoE architecture is sparse activation. The model contains multiple expert networks, and the gating network selects only a subset of experts to participate in computation for each token. Therefore, a model’s total parameter count and active parameter count are two different numbers.

    This distinction directly affects deployment. All parameters of an MoE model need to be loaded into memory, so memory usage is determined by the total parameter count, not the active parameter count. The active parameter count affects the computation per token, so in compute-bound scenarios, MoE can usually achieve faster generation speed. In a Dense model, every token passes through all parameters, so both memory usage and computation are determined by the total parameter count.

    Comparison dimension MoE model Dense model
    Memory footprint Determined by total parameter count; all parameters must be loaded Determined by parameter count
    Per-token computation Related to active parameter count Related to all parameters
    Generation speed Usually faster under compute-bound conditions Usually slower on equivalent hardware
    Complex reasoning and code generation Varies widely by model; must be tested Usually more stable, but still must be tested
    Suitable scenarios High-throughput, low-latency services Quality-first, lower-concurrency tasks

    Quality gaps published by vendors or third parties are often small, but the gap varies by task type. When selecting a model, test it on your own tasks rather than directly adopting public leaderboard rankings.

    5. Reproducible Evaluation Methods

    If you want to compare two models, the evaluation report should include at least the following information:

    1. Hardware model, memory or VRAM capacity, driver and system versions.
    2. Model version, quantization format, inference framework, and version number.
    3. Context length, batch size, and sampling parameters (temperature, top_p, etc.).
    4. Prefill speed and decode speed must be measured separately. Prefill speed depends on input length, while decode speed depends on output length; the two cannot be conflated.
    5. Sample count and scoring criteria. For code generation tasks, you can calculate unit test pass rate and report the number of samples (for example, pass@1). Public benchmarks such as HumanEval and MBPP can be used as references, but you should still add your own business test cases.
    6. Failure sample analysis. Record concrete examples of logical breaks, hallucinations, and formatting errors, rather than only giving an aggregate score.

    Only numbers that include the above information are useful for reference. Speed numbers that lack test conditions cannot be used for cross-device comparison.

    6. Cloud-Edge Collaboration: Route by Conditions, Not by Model Name

    Edge models are suitable for handling high-frequency, low-complexity requests, such as intent recognition, casual conversation, and local document summarization. Complex reasoning, long-context analysis, and requests that require retrieval of external knowledge are better handled by cloud models.

    Routing decisions can reference the following conditions:

    1. The input length exceeds the edge model’s stable context limit.
    2. The edge model’s output confidence is low, or JSON parsing fails repeatedly.
    3. The task requires multi-step reasoning or external retrieval.
    4. The user’s latency requirement is lower than the edge model’s expected latency, and network conditions are good.

    After deployment, continuously monitor the following metrics:

    • Time to first token and generation speed, measured separately for edge and cloud.
    • JSON parsing failure rate and user retry rate.
    • Per-request compute cost, including cloud API charges and estimated edge-device energy consumption.
    • Error rate and timeout rate.

    Fallback strategies should also be designed in advance. When the edge model fails, forward the request to the cloud. When the cloud times out, return a cached result or clearly ask the user to retry later. Fallback paths need to be exercised regularly; otherwise, they may not work during a real failure.

    7. Conclusion and Risk Notes

    The new generation of open-source model matrices offers multiple choices for different hardware conditions. Edge small models are suitable for intent recognition and structured output in low-resource environments. MoE models provide a compromise between speed and quality, but the memory occupied by their total parameters cannot be ignored. Dense models may be more stable on complex tasks, at the cost of slower speed.

    This article does not provide universal performance numbers because speed, quality, and memory footprint all depend on hardware, quantization method, context length, and inference framework. Before procurement or launch, evaluate the model with your own hardware and tasks. This article is for technical selection reference only and does not constitute any procurement or performance commitment.