A Practical Methodology for Selecting Chinese LLMs: From Use Cases to Evaluation

    This article provides a structured, scenario-driven approach for evaluating and selecting Chinese large language models (LLMs) for production use. It covers decomposing business requirements into task types, designing evaluation dimensions with adjustable weights, building a custom test set, implementing an abstraction layer to reduce switching costs, and deploying models with shadow testing, canary releases, and rollback strategies. The guide also highlights common pitfalls such as over-relying on public benchmarks and ignoring version drift, offering a reproducible evaluation workflow that balances performance, cost, latency, compliance, and stability.

    1. Why Selection Needs an Independent Methodology

    Chinese LLMs are being released and updated at a rapid pace. The same vendor may publish several new versions within months, and capabilities across code generation, long-context handling, multilingual tasks, and other areas can vary significantly between versions. Public leaderboards can reflect how models perform on certain standardized tasks, but they cannot replace a business team’s judgment based on its own data and workflows.

    The core selection question is: which model or combination of models best fits our business scenarios, cost constraints, compliance requirements, and operational capabilities? There is no universal answer—it can only be determined through a structured evaluation process.

    2. Break Down Use Cases Before Evaluating Models

    Before selecting a model, decompose your business requirements into concrete task types. Common categories include:

    • Knowledge Q&A: Depends on factual accuracy and faithfulness to retrieved results. Key metrics are hallucination rate and citation accuracy.
    • Text generation and rewriting: Focus on language quality, style control, and instruction-following ability.
    • Structured extraction: Extracting fields from contracts, tickets, or reports. Requires stable output format and the ability to return results in a specified structure.
    • Code assistance: Emphasizes code correctness, context understanding, and adaptation to an existing codebase.
    • Agent and tool calling: The model must decide when to invoke external tools, structure parameters, and handle exceptions returned by tools. This scenario places the highest demands on instruction following and multi-turn state management.
    • Long-document processing: For example, reviewing documents dozens of pages long. Verify that the model reliably retrieves information across long contexts, rather than relying solely on the advertised context length.

    A single business process may combine multiple task types. After decomposition, you can evaluate each task type separately and then decide whether to unify them under one model.

    3. Evaluation Dimensions and Weight Design

    Selection should use a multi-dimensional scoring system. The following table offers a generic set of dimensions; teams can adjust them to their own context.

    Dimension Description Suggested Weight
    Task performance Accuracy, completeness, format compliance on your own test set 35%
    Inference cost Input/output cost per call, estimated using average token usage 15%
    Response latency Time to first token and full response; track P50 and P95 15%
    Tool-calling capability Correct parameter construction, completion rate for multi-step tasks 10%
    Deployment and compliance Whether data can leave your region, private deployment options, log retention and audit 15%
    Stability and version management Update frequency, how long old versions remain available, behavior drift under the same API 5%
    Ecosystem and maintainability Documentation quality, examples, community responsiveness 5%

    Weights are not fixed. For real-time customer-facing chat, raise latency weight to 25% or more. For internal systems handling sensitive data, prioritize deployment and compliance.

    Keep in mind that the best single dimension rarely yields the best overall choice. A model may have the highest performance but also higher unit cost and slower latency—your team must decide on the trade-off between effect and cost.

    4. Building Your Own Evaluation Set

    Public benchmark questions usually differ significantly from actual business data, so a custom test set is the most valuable asset in model selection.

    4.1 Sample Sources

    Prefer samples from real business logs, after anonymization. Prepare 200–500 samples per task type, covering three categories:

    1. Regular samples: The majority, representing daily requests.
    2. Edge cases: Incomplete input, ambiguous phrasing, conflicting information.
    3. Adversarial samples: Requests designed to elicit out-of-scope output, expose system instructions, or induce fabrication.

    4.2 Annotation Guidelines

    Each sample needs a clear reference answer or scoring rubric. For open-ended tasks, define scoring criteria explicitly, for example, “must include three required elements” or “must cite the specific number found in the given document.” Have at least two business stakeholders score a small pilot set first, check consistency, and then finalize the guidelines.

    4.3 Scoring Methods

    Three approaches are practical:

    • Rule-based validation: Best for format, fields, and numeric values that can be programmatically checked. Lowest cost and most reliable.
    • Human scoring: Required for language quality and domain-specific accuracy. Use sampling and double-checking.
    • Model-as-judge: Use another LLM to score according to the rubric. This is efficient, but the judge model may have its own style preferences, so calibrate it with human-scored samples and periodically check for bias.

    5. Abstraction Layer Design: Reducing Switching Costs

    Model selection is not a one-time activity. After deployment, model versions, pricing, and capabilities can change. If business code directly couples to a specific model’s call details, switching becomes expensive.

    The recommended approach is to introduce a unified abstraction layer between business logic and models, covering:

    • A unified call interface: The business layer sends only prompts and parameters, without caring about the underlying provider.
    • Configurable model routing: Model names, endpoints, keys, timeouts, and retry policies reside in a configuration center or environment variables, not hardcoded.
    • Standardized request/response logging: Record input, output, latency, and token usage for later analysis and cost tracking.
    • Unified error handling: Distinguish between timeout, rate limiting, content filtering, and service exceptions, each with its own retry or fallback strategy.

    Below is a basic structure for such an abstraction layer. The actual call logic must be implemented according to the chosen provider’s documentation.

    1. import os
    2. class ModelClient:
    3. def __init__(self, name: str, endpoint: str, api_key: str, timeout: float = 30.0):
    4. self.name = name
    5. self.endpoint = endpoint
    6. self.api_key = api_key
    7. self.timeout = timeout
    8. def generate(self, prompt: str, **params) -> str:
    9. # Implement the actual network call and return the model-generated text.
    10. raise NotImplementedError
    11. def load_clients():
    12. # Retrieve keys from environment variables; never write them into code or logs.
    13. return [
    14. ModelClient(
    15. name="candidate-a",
    16. endpoint=os.environ["CANDIDATE_A_ENDPOINT"],
    17. api_key=os.environ["CANDIDATE_A_KEY"],
    18. ),
    19. ModelClient(
    20. name="candidate-b",
    21. endpoint=os.environ["CANDIDATE_B_ENDPOINT"],
    22. api_key=os.environ["CANDIDATE_B_KEY"],
    23. ),
    24. ]

    6. Evaluation Script Framework

    With the abstraction layer and test set in place, create a unified evaluation pipeline that applies the same samples and scoring rules to all candidate models.

    1. import time
    2. import statistics
    3. def evaluate(clients, cases, judge):
    4. report = {}
    5. for client in clients:
    6. scores, latencies = [], []
    7. for case in cases:
    8. start = time.perf_counter()
    9. answer = client.generate(case["input"])
    10. latencies.append(time.perf_counter() - start)
    11. scores.append(judge(case, answer))
    12. report[client.name] = {
    13. "avg_score": statistics.mean(scores),
    14. "p50_latency_s": statistics.median(latencies),
    15. "p95_latency_s": sorted(latencies)[int(len(latencies) * 0.95) - 1],
    16. }
    17. return report
    18. def weighted_total(metrics, weights):
    19. # The keys of metrics and weights must match; values should be normalized to 0–1.
    20. return sum(metrics[k] * weights[k] for k in weights)

    When running the evaluation, observe the following:

    • Use the same sample order and generation parameters (e.g., temperature, max output length) for every model.
    • Track cost data separately; do not rely only on quality scores.
    • Run the evaluation multiple times, because model outputs are stochastic—a single run is not conclusive.

    7. Rollout Strategy: Shadow Testing and Canary Releases

    Once a selection is made, do not switch all traffic at once. A reasonable rollout includes:

    1. Shadow testing: Run the new model and the existing model side by side on real requests, but only use existing model results. Record the new model’s outputs for analysis.
    2. Low-traffic canary: Gradually route a small percentage of requests to the new model. Monitor quality metrics, error rates, and latency.
    3. Per-scenario routing: Different task types may use different models. For example, structured extraction goes to a stable-output model, while complex reasoning goes to a more capable but costlier model.
    4. Rollback mechanism: Automatically switch back to the original model if the new one experiences timeouts or elevated error rates, and trigger alerts.

    Monitor at least: request volume, success rate, P95 latency, cost per call, and negative human feedback ratio. Log all metrics per model version.

    8. Common Pitfalls

    • Relying only on public leaderboards: Leaderboard items differ from business data; a top-ranked model may not perform best in your specific case. Use leaderboards to narrow the candidate pool, but not as a substitute for custom evaluation.
    • Comparing only unit price: A cheap model may produce verbose output or require multiple retries, raising total cost. Calculate the average cost to complete a business task.
    • Ignoring version drift: Different versions under the same model name can behave very differently. Pin the version after deployment and re-run the test set before any upgrade.
    • Treating demos as production performance: Demos use carefully chosen inputs. Production inputs are messier, and error handling and edge cases matter more.
    • Delaying compliance considerations: If the business involves personal data, trade secrets, or regulated data, decide on deployment mode and data flow early in the selection process. Adding compliance after a model is chosen often forces re-evaluation and architecture changes.

    9. Implementation Recommendations

    Follow this sequence for model selection: first inventory task types and constraints, then define evaluation dimensions and weights, build a custom test set and run a unified evaluation script, and finally complete the switch through shadow testing and canary releases. Document every step—evaluation data, scoring rules, version numbers, and decision rationale—so you can revisit and re-select later when circumstances change.