How to Choose an Open-Source LLM: A Hands-On Selection Guide After a Full-Size Model Family Release
A practical guide to evaluating and selecting open-source LLMs, using a recently released full-size model family as a sample: two on-device small models (E2B/E4B), a 26B Mixture-of-Experts (MoE) model (26B A4B), and a 31B dense model. It walks through a five-step methodology—license compliance, on-device validation, architecture tradeoffs (MoE vs. dense), benchmark interpretation, and inference performance stress testing—and adds cloud hosting practices plus a scenario-based selection matrix. Learn to look beyond "just pick the biggest" and choose models based on real, reproducible metrics.
Introduction: Choosing a Model Is No Longer “Just Pick the Biggest”
Over the past two years, open-weight model releases have followed a clear pattern: instead of shipping a single “flagship size,” vendors now cover a full-size matrix spanning from on-device small models to large models with tens of billions of parameters. A recent open-source model family is a case in point: its lineup includes two on-device small models (E2B/E4B), a 26B-class Mixture-of-Experts (MoE) model (26B A4B), and a 31B dense model. At the same time, the license has shifted toward more permissive terms.
For developers, this is both a benefit and a burden. A wider range of choices makes it easier to find a model that fits your scenario, but “which one to pick, how to evaluate it, and how to deploy it” quickly becomes the core question.
Using this model family as an observation sample, this article abstracts a reusable methodology for evaluating and selecting open-source models. It breaks down into five steps—license compliance, on-device validation, architecture tradeoffs, benchmark interpretation, and performance stress testing—and adds a section on cloud hosting and a scenario-based selection matrix.
Note: The data in this article comes from public sources and hands-on developer feedback. It reflects results only under specific hardware, inference frameworks, and sampling parameters. Re-test in your own environment before production use.
1. Licensing: The First Gate for Evaluating Open-Source Models
1.1 From “research use” to “commercial-friendly”
Perhaps the most noteworthy change in this model family is arguably not the parameter count but the license: it is the first to adopt a permissive open-source license such as Apache 2.0. Earlier open-weight models typically used custom community licenses with conditions attached—for example, setting thresholds based on monthly active users in commercial scenarios. For teams planning to embed the model into commercial products, such terms often mean long legal review cycles and blurry compliance boundaries.
A permissive license brings four direct benefits:
- Commercial freedom: You can embed the model into commercial products and offer it as a service, generally without needing to declare or pay based on user scale;
- Modifiability: You may quantize, distill, continue pre-training, fine-tune for specific domains, and make structural changes such as pruning;
- Redistributability: You may distribute the model or derivative models alongside software, and may also host it as an external service;
- Ecosystem-friendly: It is easier for the community to build evaluations, quantizations, and toolchains around the model, reducing long-term maintenance costs.
1.2 “Permissive” doesn’t mean “zero obligations”
Permissive is not the same as obligation-free. Before going live, you should at least confirm the following:
- Attribution and notices: When distributing the model with your product, whether you need to retain license text, copyright notices, and other files;
- Trademarks: Open-source licenses typically do not grant trademark rights, and derivative models generally cannot reuse the original model’s name or branding;
- Training data and third-party components: Beyond the model weights, the code, tokenizer, and dependency libraries may each carry their own licenses and need to be reviewed together;
- Usage boundaries: Some permissive licenses include “prohibited use” clauses, or explicitly withhold patent and trademark rights. For sensitive domains such as medical and judicial, you should conduct additional assessment in light of applicable AI regulations and industry oversight requirements.
Therefore, license evaluation should be the first step of the selection process—a hard admission criterion for candidate models, not an afterthought.
2. Validating Small Models: The Deciding Factor for On-Device and Edge Scenarios
2.1 Capability boundaries
The two E2B/E4B models mainly target resource-constrained environments such as phones, PCs, and edge devices. Officially published data includes:
- Runs with as little as about 1.5 GB of memory, and mainstream mid-range phones can handle it easily;
- An agent workflow with 4,000-token input across 2 skills can complete within 3 seconds;
- On a device with 6 GB of VRAM, generation speed outperforms other similar small models the developer tested, delivering a smoother interactive experience.
2.2 Structured output: The key to whether an on-device model can “get real work done”
The most common landing spot for on-device models is tasks that require returning structured results—information extraction, intent recognition, tool calling—where downstream programs depend on parsing fixed fields and therefore demand extremely stable structured output. When evaluating, it is recommended to validate across three layers:
- Format compliance rate: The proportion of outputs that can be strictly parsed into the target format (such as JSON);
- Field accuracy rate: Among successfully parsed results, the proportion where field values match the labeled answers;
- Constraint adherence: Whether it exceeds bounds when facing constraints like enum values or numeric ranges, and the extra latency under constrained decoding.
In engineering practice, three approaches are usually combined to improve stability:
- On the inference side, enable JSON Schema-constrained decoding or function-calling interfaces;
- On the prompting side, provide clear field descriptions and examples;
- As a fallback, apply limited retries to failed results, and degrade to rule-based parsing when necessary.
import jsonTOOL_SCHEMA = {"type": "object","properties": {"tool": {"enum": ["search", "calc", "answer"]},"args": {"type": "object"},"reason": {"type": "string"},},"required": ["tool", "args"],"additionalProperties": False,}def call_structured(client, model, user_input: str, max_retry: int = 2):"""Ask the small model to output tool-call arguments conforming to the Schema; retry with feedback on failure."""prompt = ("You are a device assistant. Output only a JSON object that conforms to the ""following JSON Schema, and nothing else:\n"f"{json.dumps(TOOL_SCHEMA, ensure_ascii=False)}\n"f"User input: {user_input}")for attempt in range(max_retry + 1):# response_schema / guided_json are generic parameter names;# in a specific inference framework they may be called response_format, guided_json, etc.resp = client.chat(model=model,messages=[{"role": "user", "content": prompt}],response_schema=TOOL_SCHEMA,temperature=0,)try:data = json.loads(resp)if set(TOOL_SCHEMA["required"]).issubset(data):return dataexcept json.JSONDecodeError:passprompt += f"\nThe last output could not be parsed: {resp}\nPlease output valid JSON again."raise ValueError("Structured output failed multiple times; please fall back to rule-based parsing.")
2.3 Agents and end-to-end experience
“Completing an agent workflow across multiple skills within 3 seconds” is an end-to-end metric that already includes intent understanding, tool-parameter generation, and result summarization. When evaluating, it is recommended to start from user perception rather than comparing only the latency of a single interface:
- Time to first token (TTFT): The time from sending the request to the first visible character appearing, which directly determines the intuitive sense of “lag”;
- Task success rate: The proportion of multi-turn tasks that ultimately complete, which better reflects real usability than single-turn answer quality;
- Failure recoverability: Whether the error messages the model gives are clear and can guide users to correct course.
Official and community apps on mobile let more users experience the model’s capabilities directly on their phones. When trying such apps, it is recommended to separately watch three points: first-load speed, memory usage during continuous conversations, and whether long conversations trigger a model reload.
3. Architecture Tradeoffs: The Essential Difference Between MoE and Dense
3.1 Decoupling compute from memory footprint
A dense model uses all parameters to compute every token. An MoE model uses a router to select a small number of experts for each token (usually Top-2), activating only a portion of the parameters.
The key difference: memory footprint depends on the total parameters, while compute depends on the activated parameters. Take 26B A4B as an example: it has about 26B total parameters but activates only about 3.8B per token:
| Dimension | Dense (e.g., 31B) | MoE (e.g., 26B A4B) |
|---|---|---|
| Memory/VRAM footprint | Proportional to total parameters | Proportional to total parameters, usually lower |
| Per-token compute | All parameters participate | Only activated experts participate |
| Batched prefill | Compute grows linearly with batch size | Different tokens hit different experts, allowing more compute to be used in parallel |
| Inference implementation complexity | Relatively simple, mature ecosystem | Must handle routing, expert parallelism, and load balancing |
3.2 Quality gap: Reading public benchmarks side by side
From public benchmarks, the 31B dense model holds only a limited advantage over the 26B A4B:
- Human-preference battle leaderboard: About 10 points higher in Elo—a “perceptible but not lopsided” gap;
- Hard math competition problem set: About 1 percentage point improvement;
- Real-time code generation benchmark: About 2–3 percentage points, the direction where the gap is relatively clear;
- Graduate-level scientific reasoning QA: About 1–2 percentage points improvement.
This shows that 26B A4B achieves near-parity with about 12% of the activated parameters (3.8B vs. 31B). At the same time, note that benchmark scores are affected by sampling parameters, prompt templates, and evaluation implementations, and a 1–3 percentage point gap may not be significant in a single evaluation and should not be the main basis for selection. A more reliable approach is to build an evaluation set from your own business data:
CASES = [{"input": "Move the 8:30 meeting to 10 o'clock", "expect": {"tool": "update_event", "args": {"start": "10:00"}}},{"input": "Check tomorrow's weather in Shanghai for me", "expect": {"tool": "search", "args": {"q": "Shanghai weather tomorrow"}}},# ... 20-100 cases drawn from real business]def eval_cases(model, cases=CASES, runs=3):"""Run multiple times and average, outputting end-to-end executable rate, format validity rate, and average call count."""ok = valid = 0calls = 0for case in cases:for _ in range(runs):try:data = call_structured(model_client, model, case["input"])valid += 1if data.get("tool") == case["expect"]["tool"]:ok += 1except ValueError:passcalls += 1n = len(cases) * runsprint(f"Format validity rate {valid / n:.1%} | End-to-end accuracy {ok / n:.1%} | Average retries {calls / n - 1:.2f}")
4. Inference Performance: Breaking “Fast” Into Quantifiable Metrics
4.1 Four core metrics
- Prefill throughput (prefill tok/s): The speed at which the model reads the input before generating the first token; it determines time to first token;
- Decode speed (tok/s): The speed of generating token by token, which determines how fast “typing” is; mainly limited by memory bandwidth;
- Peak VRAM: Weights plus the KV cache. The KV cache grows with context length and concurrency, and in long-context scenarios it often becomes the real bottleneck;
- Long-range stability: Whether repetition, going off-topic, or giving up midway occurs during long reasoning.
4.2 Interpreting hands-on tests
A developer tested 26B A4B on a high-end desktop-class processor platform via a general-purpose local inference framework (such as llama.cpp): at a 20k context length, prefill was about 1000 tok/s and generation about 60 tok/s, matching the speed of larger 35B/3B-class MoE models on the same platform.
Let’s do the math: 20k tokens of input takes about 20 seconds to read; a 400-token answer takes about 7 seconds to generate. This kind of configuration is better suited to offline batch processing, code assistance, and other scenarios that do not require instant responses. If you are targeting online interaction, you would need greater concurrency capacity or a shorter context.
In an independent agentic coding evaluation, 26B A4B generated at about 135 tok/s, compared with about 136 tok/s for the comparison model—a gap of about 1%. This shows that speed is no longer the deciding factor; code quality and stability are.
4.3 A reproducible stress-testing method
import statisticsimport timedef bench_stream(model, prompt: str, max_tokens: int = 200, runs: int = 3):"""Streaming stress test: measure time to first token (TTFT) and decode speed (tok/s), both taking the median."""ttfts, tps_list = [], []for _ in range(runs):start = time.perf_counter()first_at = Nonen = 0for _ in model.stream(prompt, max_tokens=max_tokens):now = time.perf_counter()if first_at is None:first_at = nown += 1end = time.perf_counter()ttfts.append(first_at - start)# Decode speed should exclude the prefill time before the first tokentps_list.append((n - 1) / (end - first_at))return statistics.median(ttfts), statistics.median(tps_list)# Test at different context lengths to observe the impact of long context on time to first tokenfor ctx_len in (2000, 8000, 20000):prompt = "Sample text\n" * ctx_len + "\nPlease summarize the key points above in one sentence:"ttft, tps = bench_stream(model, prompt)print(f"context={ctx_len}: TTFT={ttft:.2f}s, decode={tps:.1f} tok/s")
When stress testing, it is recommended to fix the inference framework version and quantization format, measure after warm-up, and record the peak VRAM at the same time. Only then can you get comparable, reproducible results.
5. Selection Decisions: Why “Bigger” Isn’t Always “Better”
5.1 Why the 31B dense model isn’t recommended
Based on developers’ hands-on feedback, the 31B dense model’s shortcomings concentrate in three areas:
- Slow generation: Every token requires computing all parameters, and the real-time interactive experience clearly lags;
- Unstable long reasoning: During long-chain reasoning, it tends to repeat, go off-topic, or give up midway, with large fluctuations in output quality;
- High resource overhead: Large weight and KV cache footprints mean fewer concurrent requests can be served on the same hardware.
By comparison, a 27B-class dense open-source model performs more evenly in terms of speed and output stability. While all kinds of models suffer from hallucinations to varying degrees, the 31B dense model’s hallucination tendency is relatively more pronounced in hands-on tests. In other words, a dense model with more parameters is not necessarily more reliable; when selecting, you should pay more attention to “overall performance per unit of resource.”
5.2 Replacing cloud models: Capability alignment is only the starting point
In terms of capability alignment, 26B A4B can serve as a replacement for a certain cloud vendor’s low-latency, lightweight online model, while the 31B dense model roughly targets a more capable online model. But whether it can truly replace them still needs to be judged against cost, latency, throughput, and compliance needs.
MoE has an easily overlooked characteristic in offline batch scenarios: since each token activates only a few experts, at small batch sizes memory bandwidth is dragged down by large amounts of unused expert weights; as batch size grows, different tokens hit different experts, allowing compute to be used more fully. Therefore:
- Offline batch processing: 26B A4B has a clear advantage;
- Single-request real-time interaction: You need to combine it with actual concurrency stress testing to confirm whether throughput meets requirements.
5.3 Scenario selection matrix
| Scenario | Core need | Recommended direction |
|---|---|---|
| On-phone/on-PC local assistant, offline tools | Low memory footprint, instant response | On-device small models (E2B/E4B class) |
| Structured extraction, lightweight agents | Stable format, controllable latency | On-device small models with constrained decoding |
| High-concurrency online service, general QA | Maximize output per unit of compute | MoE models (e.g., 26B A4B) |
| Long-document analysis, complex reasoning | Prioritize capability ceiling | 31B-class dense or cloud online models |
| Offline data processing, batch generation | Prioritize throughput, cost-sensitive | MoE models, larger batch sizes |
| Private scenarios where data can’t leave the domain | Compliance and controllability | Candidate models deployable locally, with your own hardware |
6. Cloud Hosting in Practice: Bringing Open-Source Models into Production
If a team doesn’t have enough local compute, or needs elastic scaling and unified management across multiple environments, it can host open-source models in the cloud. The relevant process can be completed using general capabilities offered by cloud platforms such as Baidu AI Cloud:
- Model and image management: Use object storage to save model weights and versions, and use container image services to manage inference images, ensuring the environment is reproducible and rollback-able;
- Inference servitization: Deploy inference services on a container platform, use elastic scaling to handle traffic fluctuations, and then distribute requests via load balancing;
- Observability: Collect request and response logs through a logging service, and use monitoring and alerting to track time to first token, generation speed, error rate, and VRAM utilization;
- Security: Apply rate limiting and authentication at the gateway layer, and combine with content safety capabilities to compliantly filter inputs and outputs.
When deploying MoE models in the cloud, VRAM footprint is determined by the total parameters, so container specs need to be planned according to weight loading and KV cache budgets—they cannot be estimated from the activated parameter count.
7. Conclusion: The Five-Step Evaluation Method
- Check the license first: A permissive license is the admission threshold for candidate models, but you still need to complete attribution, trademark, and compliance reviews;
- Look at constraints on-device: Small models perform well in memory footprint, structured output, and end-to-end agent tasks, making them suitable for latency-sensitive scenarios;
- Look at form through architecture: MoE trades a small number of activated parameters for near-dense results, offering better cost-effectiveness in batch and concurrency scenarios;
- Look at metrics for performance: Prefill throughput, decode speed, peak VRAM, and long-range stability are all indispensable;
- Look at scenario for selection: More parameters don’t equal a better experience. The 31B dense model’s disadvantages in speed, stability, and resource footprint make it better suited to offline or capability-first scenarios.
Competition among open-source models is shifting from “parameter scale” to a combined contest of “license friendliness, architectural efficiency, and scenario fit.” Building a reproducible evaluation process and making choices based on your own business data is the right way to make good use of open-source models.
