Selecting Chinese LLMs and Multi-Model Comparison: A Practical Engineering Guide
This article explores practical engineering approaches to selecting and comparing Large Language Models (LLMs). Rather than relying on public leaderboards, it emphasizes evaluating models based on specific business requirements, failure costs, and engineering constraints. It covers establishing multi-dimensional evaluation criteria, standardizing API integration, conducting reproducible multi-model experiments, and implementing production-grade architectures with gateways, fallback routing, and observability. The goal is to build an auditable, swappable, and resilient LLM ecosystem for enterprise applications.
1. Clarify the Problem: Selection is About Matching, Not Rankings
With an increasing supply of models, developers can access multiple Chinese LLMs through unified integration methods. On the surface, this is a problem of an enriched shelf; however, from an engineering perspective, the real question is: how to choose a stable, swappable, and operable model combination for specific business needs under controllable costs, acceptable latency, and compliance requirements. Public leaderboards, one-off experiences, and subjective feelings can only serve as references and cannot replace business-oriented validation.
Therefore, before selection, you should answer three questions:
- What is the task type? Is it general Q&A, code assistance, long-document summarization, structured information extraction, or multi-turn customer service? Different tasks have different requirements for reasoning ability, context length, instruction following, and output stability.
- How high is the cost of failure? Internal knowledge retrieval and creative drafts can tolerate some fluctuation; contract review, production work orders, and financial field extraction require stricter validation, retries, and manual review.
- What are the engineering constraints? Is private or dedicated cloud deployment mandatory? Are high concurrency, low latency, and streaming output required? Are audit logs, data desensitization, and key rotation necessary?
Only by breaking down business goals into verifiable metrics can subsequent model comparisons be meaningful.
2. Establish Evaluation Dimensions: Balancing Capability, Cost, Stability, and Compliance
It is recommended to replace “single-metric decisions” with a multi-dimensional scoring table. Common dimensions include:
| Dimension | Key Questions | Verification Method |
|---|---|---|
| Task Capability | Do instruction following, reasoning, coding, and language expression meet the scenario? | Fixed test set + blind evaluation |
| Context Processing | Can it stably extract key information from long documents? | Segmentation, truncation, citation consistency tests |
| Output Stability | Is structured output parsable? Is there format drift? | JSON/table parsing success rate |
| Latency & Throughput | First token latency, full response time, concurrency performance | Stress testing and online sampling |
| Cost | Single call cost, retry cost, cache benefits | Estimated by business token distribution |
| Operability | Are rate limiting, retries, monitoring, and version changes controllable? | Gateway and logging system verification |
| Compliance & Security | Data flow, permissions, audit, desensitization requirements | Security review and process checks |
It is important to emphasize that model capability is not static. Version updates, parameter changes, and context length adjustments can all affect performance. Therefore, the selection result should retain a “retesting mechanism” rather than being finalized in a single pass.
3. General Access Process: Account, Authentication, Client, and Gateway
Regardless of the type of model service used, the access process can usually be abstracted into four steps: register and complete identity verification, create an access key, configure the service endpoint and model identifier, and initiate calls from the client or server. In engineering practice, it is not recommended to hardcode keys directly into frontend code or configuration files; they should be managed centrally through a server-side gateway.
A general call example is as follows. The focus is to abstract the entry point, key, and model ID, avoiding binding to a specific platform:
import requests# The focus is to abstract the entry point, key, and model ID, avoiding binding to a specific platformdef call_chat(endpoint, api_key, model, messages, timeout=60):headers = {"Authorization": f"Bearer {api_key}","Content-Type": "application/json",}payload = {"model": model,"messages": messages,"temperature": 0.2,}resp = requests.post(endpoint, headers=headers, json=payload, timeout=timeout)resp.raise_for_status()data = resp.json()return data["choices"][0]["message"]["content"]
In a multi-model comparison scenario, you can send the same prompt to multiple models simultaneously and record the output, time consumed, and parsing results:
models = ["model-a", "model-b", "model-c"]prompt = [{"role": "user", "content": "Please extract fields from the given text and return them in JSON."}]# Record the output, time consumed, and parsing resultsfor m in models:try:result = call_chat(endpoint, api_key, m, prompt)print(m, "OK", result[:200])except Exception as e:print(m, "FAILED", repr(e))
This code does not depend on a specific product and is suitable for inclusion in an internal evaluation script. In a production environment, you should also add timeout handling, retries, rate limiting, log desensitization, and result caching.
4. Multi-Model Comparison Experiment: Unify Variables, Keep Reproducible Records
The most common pitfall in multi-model comparison is “different prompts, different parameters, and different samples,” which ultimately leads to incomparable conclusions. It is recommended to follow this process:
- Fixed test set: Sample from real business, covering simple, complex, boundary, and abnormal inputs.
- Fixed prompts and parameters: Keep temperature, maximum output length, and system prompts consistent; if a model must be adjusted, record it separately.
- Combine blind evaluation with automated metrics: Manual blind evaluation focuses on accuracy, completeness, and readability; automated metrics focus on format parsing success rate, field hit rate, and time consumed.
- Log versions and environments: Model identifiers, call times, service endpoints, and client versions should all be logged.
- Summarize by scenario: Do not just give an overall score; compile statistics separately for scenarios like Q&A, extraction, coding, and summarization.
A simplified scoring record can include: Correctness 0-5 points, Format compliance 0-1, Average latency, Failure rate, Single call cost estimate, and Manual notes. During final selection, prioritize a model combination that “stably meets standards in core scenarios and can be degraded in edge scenarios,” rather than striving for first place in all dimensions.
5. Engineering Implementation: Gateway Abstraction, Fallback Routing, and Observability
When a business moves from “trial” to “production,” model calls should be converged into a unified gateway. The gateway layer should at least bear the following responsibilities:
- Unified authentication and key hosting: Keys are only stored on the server side, isolated by environment and tenant, and rotated regularly.
- Model routing: Select models based on task type, cost limit, latency requirements, and health status.
- Fallback and retry: Switch to a backup model when the primary model times out or is rate-limited; retries must have an upper limit and avoid repeated side effects.
- Rate limiting and quotas: Set concurrency and daily call limits by business line to prevent single-point traffic from overwhelming the whole.
- Logging and monitoring: Record time consumed, error codes, token usage, and parsing failure rates; desensitize sensitive content.
- Caching: Cache stable Q&A or repeated extraction results to reduce costs and latency.
For clients that require multi-model parallel answering, a side-by-side or columnar display can be used to facilitate manual comparison. However, parallel calls amplify costs and rate-limiting risks. It is recommended to enable this only in scenarios such as evaluation, customer service assistance, and critical decision review, with a total timeout and result merging strategy in place.
6. Common Pitfalls and Mitigation Advice
First, key leakage. Do not write access keys into frontend code, public repositories, or screenshots; use server-side proxies and least privilege policies. Second, ignoring timeouts and streaming parsing. Streaming output requires handling fragments, stream interruptions, and reconnections, while non-streaming calls need reasonable timeouts. Third, context truncation. Long documents should be segmented, retrieved, or summarized before being sent to the model to prevent key information from being truncated. Fourth, format drift. Add parsing validation and failure retries for structured output; if necessary, require the model to return strict JSON. Fifth, version drift. Model identifiers may be updated; evaluation scripts should pin versions or record change times. Sixth, compliance risks. When dealing with personal information, trade secrets, and external services, data classification, desensitization, auditing, and vendor security reviews should be completed.
7. Conclusion
The coexistence of multiple Chinese LLMs is a good thing for developers, but it also means that selection must be upgraded from “checking leaderboards” to “doing experiments, building gateways, and leaving fallbacks.” It is recommended to start with business scenarios, conduct multi-model comparisons using unified prompts and real samples, and then form a model combination based on cost, latency, stability, and compliance requirements. The ultimate goal is not to select the single best model, but to build a model usage system that is evaluable, swappable, degradable, and auditable. This way, no matter how the model supply changes, the business can maintain stable evolution.
