A Practical Guide to Selecting and Integrating Large Language Models in China
This guide explains how engineering teams can choose and integrate large language models (LLMs) available in China by focusing on scenario fit rather than leaderboard rankings. It covers a four-dimension evaluation framework—capability, engineering, compliance and data security, and ecosystem portability—along with how to build a layered in-house evaluation set, how to use public benchmarks correctly, and the observability and fallback capabilities required for production integration. Readers will also find common anti-patterns and a practical rollout checklist for making model replacement a configuration change rather than a high-risk rewrite.
1. The Real Problem: It Is Not “Which Model Is Strongest” but “Which One Fits Your Scenario”
Many teams focus on leaderboard rankings when selecting a model, but what actually determines success in engineering practice is often the set of constraints: peak concurrency, time to first token, long-context stability, structured output success rate, feasibility of private deployment, and audit and traceability requirements. Leaderboards reflect overall performance after general preference alignment, which may deviate significantly from your business distribution. A more reliable approach is to break the business down into a measurable set of tasks, then have candidate models compete on the same evaluation set and under the same serving configuration.
A common mistake is treating “demo performance” as “production capability.” A demo is usually a single-turn, short-input, no-concurrency, no-retry ideal environment; production is a multi-turn, long-document, high-concurrency environment that requires timeouts and graceful degradation. The gap between the two should be quantified with load testing and canary releases, not judged by subjective impression.
2. A Four-Dimension Evaluation Framework
2.1 Capability: Replace Public Leaderboards with Your Own Evaluation Set
Build a three-layer evaluation set:
- Basic layer: extraction, rewriting, classification, and summarization, used for fast regression;
- Business layer: formed from desensitized real tickets, real documents, and real conversation logs;
- Stress layer: very long inputs, multi-turn coreference, mixed languages, noisy text, and adversarial prompts.
Do not look only at “answer accuracy.” Metrics should also include structured output validity rate (JSON Schema pass rate), citation traceability rate, appropriate refusal rate, and usability rate from manual spot checks. Illustrative evaluation code:
def evaluate(case, model_client):out = model_client.chat(case.prompt, schema=case.schema)return {"schema_ok": validate(out, case.schema),"fact_hit": hit_rate(out, case.gold),"latency_ms": out.latency_ms,"tokens": out.usage.total_tokens,}
2.2 Engineering: Balancing Latency, Throughput, and Cost
Focus on four measurable metrics: time to first token, cost per thousand output tokens, stable throughput per unit of concurrency, and the performance degradation curve under long context. In engineering, a more effective move is often not switching models but changing the architecture: prompt compression, pre-filtering in retrieval, caching semantic results, and moving deterministic logic from the model into code.
2.3 Compliance and Data Security
Clarify the following: whether data leaves its domain, whether it is used for training, log retention period, whether audit trails are supported, and whether content safety policies are configurable. For sensitive industries, private or dedicated deployment is often a hard constraint, which directly narrows the candidate pool.
2.4 Ecosystem and Portability
Prefer solutions with a common, portable interface shape, and avoid tightly coupling business code to a single vendor’s API. It is recommended to add a unified inference gateway between the business and the models:
Business services -> Unified gateway (auth / rate limiting / routing / audit) -> Candidate model A / Candidate model B / Fallback small model
This makes it possible to switch backends without changing business code, enabling canary releases, A/B testing, and failure fallback.
3. Using Leaderboards and Evaluations Correctly
A model’s presence on an evaluation platform can serve as an initial screening signal, indicating that it is competitive in the first tier on general coding and web page generation tasks, but it should not be the final basis for a decision. The correct approach has three steps: use leaderboards to shortlist three to five candidates; retest with your own evaluation set; then run a small-percentage canary with real traffic and observe failure rate and manual usability rate. If conclusions need to be presented externally, also provide the evaluation set composition, sample size, decision rules, and confidence intervals to avoid non-reproducible conclusions.
4. Integration Architecture: Observability and Fallback
Production integration should include at least five capabilities: unified authentication and quotas, routing by task type, timeouts and retries (retry only idempotent requests), fallback to a smaller or faster model on failure, and full-chain logging with metrics and alerting. Metrics should cover success rate, P95 latency, token consumption, and the distribution of structured output failure reasons. If cloud-based general capabilities are used, you can combine object storage for corpora, a message queue for asynchronous peak shaving, a container platform to host the gateway, and logging and monitoring services to close the loop.
5. Common Anti-Patterns
- Relying on a single model for everything, with no fallback;
- Scattering prompts across business code, making unified regression impossible;
- Sending real data into evaluation without a desensitization process;
- Ignoring output structure validation, causing downstream parsing to break;
- Leaving cost optimization to the end, only to have the bill spiral out of control due to an unreasonable token structure.
6. Implementation Checklist
- Define the task list and hard constraints (data residency, latency ceiling, budget ceiling);
- Build a versioned business evaluation set of no fewer than two hundred cases;
- Deploy a unified gateway and connect two or more candidate backends;
- Canary 5% of traffic, observe for two weeks, and record the distribution of failure reasons;
- Solidify routing and fallback rules, and establish a quarterly re-evaluation mechanism.
Conclusion: Model selection is not a one-time decision but a continuously re-evaluated engineering process. Build the evaluation set, gateway, and observability first, and swapping models becomes just a configuration change; otherwise, every “model switch” turns into a high-risk rewrite.
