Selecting Chinese Open-Source LLMs: Key Dimensions and Engineering Best Practices

    This guide explores how to effectively evaluate and select Chinese open-source large language models (LLMs) for production environments. It covers why you should look beyond public leaderboards, six essential dimensions for model selection, a reusable batch evaluation framework with code examples, and deployment architecture strategies to avoid relying on a single model.

    1. The “Model Supermarket”: Lowering the Barrier to Entry

    In recent years, the “shelves” of mainstream inference service platforms have seen a significant increase in Chinese open-source models. Previously dominated by overseas open-weights, these platforms now host multiple flagship Chinese open-source models. Developers can invoke them via unified APIs without the tedious work of downloading models, performing quantization, or wrapping serving containers.

    This shift brings several key benefits:

    1. Near-zero trial cost: You can verify whether a model meets your business needs without first provisioning GPU resources.
    2. Standardized interfaces: Most inference services are compatible with OpenAI-style API protocols. Switching models only requires changing the endpoint and model name.
    3. Streamlined engineering pipeline: You can move from trial to production within the same SDK, authentication, and monitoring system.

    However, more options on the shelf also make the selection problem more prominent—which one should you actually choose?

    2. Debunking a Myth: Don’t Rely Solely on Leaderboards

    Many developers follow a selection process of “glance at a public leaderboard like WebDev Arena, and pick the top three to try.” While leaderboards hold reference value, they measure average performance on specific task sets, and your business is rarely an “average” one:

    • Leaderboards lean heavily toward general tasks like code generation and mathematical reasoning, with limited coverage of vertical domains (contract review, medical Q&A, ticket classification).
    • Human-voting leaderboards suffer from topic distribution bias, making it difficult to reflect long-tail capabilities.
    • Models iterate rapidly, meaning leaderboard results might just be a snapshot of an outdated version.

    The correct approach is: Use leaderboards to shortlist a candidate set (usually the top 3–5 models in the first tier), then use your own data for targeted evaluation to make the final decision.

    3. Six Core Selection Dimensions

    Capability Benchmark and Task Match

    First, clarify your core task types: text generation, code generation, structured extraction, multi-turn dialogue, long-text summarization, or Agent tool use? The capability profiles of different models vary significantly. It is recommended to prepare 50–200 real business samples for each task type to form an internal “golden evaluation set,” which serves as the foundation for all selection work.

    Context Window and Long-Text Capability

    When processing long documents or large codebases, the nominal context length is only one aspect. The information recall rate under long context (often called “needle in a haystack” capability) is equally critical. You can construct your own tests: embed specific facts within a long text and ask questions at the end to verify recall.

    Inference Cost and Throughput

    Cost should be analyzed across three layers:

    • Token pricing (input/output priced separately).
    • Actual token consumption (for the same task, differences in tokenizers and output styles across models can cause token count variations of over 30%).
    • Time to First Token (TTFT) and generation speed (tokens/s), which significantly impact the user experience of interactive applications.

    Ecosystem and Toolchain Compatibility

    Evaluate whether the model is compatible with mainstream OpenAI-style interfaces, whether it has a mature SDK, and whether it is natively supported by common Agent frameworks and orchestration tools. A highly compatible model allows for a “one-line code switch,” leaving room for future multi-model routing.

    Open-Source License and Compliance

    Before commercialization, always confirm the license terms: Is commercial use allowed? Are there user scale limits? What are the attribution requirements for derivative models? For industries like government, finance, and healthcare, you must also evaluate private deployment capabilities and data residency requirements.

    Stability and Versioning Strategy

    Pay attention to the model’s iteration pace, the deprecation strategy for older versions, and the API’s backward compatibility commitments. Production systems should pin the model version number to avoid output drift caused by “silent upgrades.”

    4. A Reusable Evaluation Framework

    Below is a sample code snippet demonstrating how to perform batch comparative evaluations across multiple candidate models using a unified interface:

    1. import time
    2. from openai import OpenAI
    3. CANDIDATES = [
    4. {"name": "model-a", "base_url": "https://api.example-a.com/v1"},
    5. {"name": "model-b", "base_url": "https://api.example-b.com/v1"},
    6. ]
    7. def evaluate(client, model, cases):
    8. results = []
    9. for case in cases:
    10. start = time.time()
    11. resp = client.chat.completions.create(
    12. model=model,
    13. messages=[{"role": "user", "content": case["prompt"]}],
    14. temperature=0.1, # Reduce randomness during evaluation
    15. )
    16. latency = time.time() - start
    17. answer = resp.choices[0].message.content
    18. results.append({
    19. "case_id": case["id"],
    20. "latency_s": round(latency, 2),
    21. "tokens": resp.usage.total_tokens,
    22. "answer": answer,
    23. "expected": case.get("expected"),
    24. })
    25. return results
    26. for cand in CANDIDATES:
    27. client = OpenAI(base_url=cand["base_url"], api_key="YOUR_KEY")
    28. print(cand["name"], evaluate(client, cand["name"], golden_cases))

    Evaluation results should be scored based on four metrics: accuracy, average latency, per-case token cost, and output format stability (e.g., parse rate for JSON tasks). You can further calculate a comprehensive score using a weighted approach, setting weights according to business priorities.

    5. Deployment Architecture: Don’t Bet on a Single Model

    A mature practice is to add a model routing layer between the application layer and the model layer:

    • Route simple tasks (classification, extraction) to smaller parameter models to reduce costs.
    • Route complex reasoning and code generation to flagship models.
    • Automatically fall back to a backup model if any model service experiences an anomaly.

    Combined with general capabilities provided by cloud platforms like Baidu AI Cloud—such as container platforms, API gateways, and monitoring/alerting—you can consolidate routing, rate limiting, retries, and call auditing. This makes the replacement of the underlying model completely transparent to the upper-layer business logic.

    6. Conclusion

    The capabilities of the first-tier Chinese open-source LLMs are already sufficient to cover the vast majority of business scenarios. The key to selection is no longer “which one is the strongest,” but “which one is best suited for your task profile, cost structure, and compliance boundaries.” The recommended path is: Shortlist via leaderboards → Build a golden evaluation set → Conduct small-traffic A/B testing → Establish a multi-model routing architecture. Turning model selection into a repeatable engineering process, rather than a one-off guess, is the true moat for engineering teams in the era of large language models.