Choosing a Chinese LLM: An Engineering Framework from Evaluation to Production

    A practical framework for selecting a Chinese large language model (LLM) for real-world applications. This article explains how to treat model selection as a multi-objective optimization problem, build a capability evaluation matrix, combine offline and business-specific benchmarks with human review, estimate per-task costs, and roll out models safely through a unified gateway with multi-model routing. It also covers data compliance, deployment options, and a three-phase path from proof of concept to scale.

    1. The Essence of Selection: Not “Which Is Strongest,” but “Which Fits Best”

    A common mistake in selecting Chinese LLMs is relying on public leaderboard rankings or comparing only per-call prices. Leaderboards reflect some general capabilities, but they rarely cover the input distribution, output format constraints, latency requirements, data compliance boundaries, and engineering integration costs of real business scenarios.

    A more sound approach is to treat selection as a multi-objective constraint optimization problem: find the right balance among quality, latency, throughput, cost, and maintainability, while meeting security, compliance, and business quality thresholds.

    Before evaluating any model, answer four questions first:

    1. What is the task type? Text generation, summarization, classification, information extraction, coding assistance, knowledge Q&A, or multimodal understanding? Different tasks demand very different capabilities.
    2. What are the input/output characteristics? Average and peak context length, output length, structured output requirements, tool calling needs, and multi-turn conversation support.
    3. What are the service level requirements? Average and tail latency, concurrency, availability, retry policies, and whether streaming responses are needed.
    4. What are the constraints? Can data leave your environment? Is a private or dedicated instance required? Can logs be retained? What are the content safety and audit requirements?

    Only after quantifying these questions can evaluation results be meaningfully compared.

    2. Build a Capability Evaluation Matrix

    Break candidate model capabilities into observable dimensions instead of vague descriptions like “smart” or “easy to use.” A practical evaluation matrix may include:

    • Core language ability: consistency in understanding, generation, summarization, rewriting, and Q&A.
    • Instruction following and format constraints: whether the model outputs in the specified structure, and how often it drops fields or answers out of scope.
    • Long-context handling: retrieval over long documents, cross-section citation, and retention of information in the middle of the context.
    • Structured output: parseable output ratio, field completeness rate, and malformed output rate.
    • Tool calling and orchestration: parameter extraction accuracy, call ordering stability, and failure recovery.
    • Domain knowledge: handling of Chinese business terminology, industry knowledge, and integration of private enterprise knowledge.
    • Safety and refusal: robustness against sensitive requests, unauthorized requests, and prompt injection.
    • Engineering usability: streaming output, concurrency behavior, version management, and completeness of observability metrics.

    Public leaderboards are useful for initial screening but cannot replace business-specific evaluation. In particular, avoid making procurement decisions based on a single leaderboard score.

    3. Evaluation Method: Combining Offline Sets, Business Sets, and Human Review

    Your evaluation dataset should include at least three types of data:

    1. General regression set: covers common tasks and detects capability drift after model upgrades.
    2. Real business set: sampled from historical tickets, Q&A logs, and documents, covering both high-frequency and long-tail scenarios.
    3. Adversarial and edge-case set: includes prompt injection, format manipulation, overly long inputs, empty inputs, and mixed-language content.

    Track both quality and engineering metrics:

    • Quality: task accuracy, human-usable rate, format compliance rate, hallucination rate, and refusal accuracy.
    • Engineering: average latency, P95/P99 latency, throughput, error rate, timeout rate, and per-request cost.
    • Operations: version switching cost, rollback time, log completeness, and troubleshooting efficiency.

    For generative tasks, purely automated metrics can be misleading. Introduce small-scale blind human review, and use business acceptance rate as the pass threshold.

    4. Deployment Options and Cost: Convert “Unit Price” into “Per-Task Cost”

    Model services typically come in three forms: hosted API calls, dedicated instances, and self-hosted deployment. Hosted APIs offer fast onboarding and elasticity, suitable for validation and fluctuating traffic. Dedicated instances suit stable high concurrency and stricter data boundary requirements. Self-hosted deployment offers the most control but higher operations and hardware costs.

    Cost evaluation should not stop at per-token pricing—calculate per-task cost instead:

    1. Per-task cost ≈ input token cost + output token cost + retry and failure cost
    2. + gateway and logging cost + operations and labor cost

    Also consider how cache hits, batching, mixed long/short requests, and rate-limiting policies affect cost. Latency evaluation should not rely on averages alone—P95/P99 tail latency often determines user experience and timeout rates.

    5. Engineering Integration: Unified Gateway and Multi-Model Routing

    In production, avoid tightly coupling business code to a specific model service. A safer approach is a unified model gateway that handles authentication, rate limiting, retries, timeouts, fallback, log masking, and metrics collection. This enables gradual traffic switching and routing tasks to different candidate models.

    Example configuration:

    1. gateway:
    2. routes:
    3. - task: general_qa
    4. primary: candidate_a
    5. fallback: candidate_b
    6. timeout_ms: 30000
    7. max_retries: 1
    8. - task: structured_extract
    9. primary: candidate_b
    10. fallback: candidate_a
    11. require_json: true

    Pseudocode example:

    1. def handle(request):
    2. route = router.select(request.task, request.sla)
    3. try:
    4. resp = call_model(route.primary, request)
    5. if not validator.check(resp, request.schema):
    6. raise FormatError
    7. return resp
    8. except (TimeoutError, FormatError, ServiceError):
    9. metrics.inc("fallback")
    10. return call_model(route.fallback, request)

    The gateway should also log request volume, error rate, P95 latency, output format failure rate, refusal rate, and cost buckets to support continuous optimization. Avoid storing sensitive information in plaintext; apply masking and tiered retention where needed.

    6. Security, Compliance, and Data Boundaries

    Data boundaries must be a precondition in model selection. Clarify: which data can be sent to hosted services and which must stay in a private environment; whether logs contain personal information; whether input and output require content safety checks; and whether model version changes require approval. For enterprise scenarios, establish data classification, permission auditing, masking rules, and emergency rollback mechanisms. When deploying in the cloud, general-purpose categories such as container platforms, object storage, logging services, and monitoring/alerting—such as those offered by Baidu AI Cloud—can help build an isolated, observable, and auditable runtime environment.

    7. From POC to Scale: A Three-Phase Approach

    Proceed in three phases:

    1. Offline POC: evaluate 2–3 candidate solutions on your business dataset to establish quality and cost baselines.
    2. Small-scale gray release: integrate the unified gateway, split traffic by user or request ratio, and monitor P95 latency, error rate, and human-usable rate.
    3. Scaling and multi-model routing: once stable, route by task, tenant, or cost strategy, keeping fallback models and fast rollback capability.

    Define exit criteria in advance—for example, format compliance rate above the threshold, P95 latency within SLA, human-usable rate met, per-task cost within budget, and security audit passed. After launch, keep running regression tests across versions to prevent hidden drift from model upgrades.

    8. Common Pitfalls and Conclusion

    Common pitfalls include relying only on public leaderboards, comparing only unit prices, ignoring tail latency, overlooking structured output stability, ignoring vendor lock-in and exit costs, and extrapolating POC results directly to full traffic.

    The right way to select a Chinese LLM is to break down business constraints first, then build a quantifiable evaluation matrix, and converge step by step through offline evaluation, gray releases, and a unified gateway. The end goal is not to pick the “forever strongest” model, but to build a model-serving capability system that is evaluable, switchable, observable, and governable.