A Practical Guide to Selecting and Deploying Domestic LLMs for Inference
This article provides a systematic approach to choosing and deploying domestic (Chinese) large language models in production. It introduces a six-dimension evaluation framework, an assessment workflow combining offline evaluation, blind testing, and online canary rollouts, and practical strategies for cost optimization, platform decoupling, and risk governance. The goal is to help developers and enterprises make reliable, replaceable, and cost-effective model selections under real-world constraints.
A Practical Guide to Selecting and Deploying Domestic LLMs for Inference
As the model supply shifts from “a few options” to “many models coexisting”, model selection is no longer about comparing leaderboard rankings. It becomes a systematic decision involving business fit, engineering cost, deployment form, and governance capability. Recent trends show that some inference platforms have started integrating more domestic models, and several of those models perform well in public benchmarks. This reflects two underlying shifts: the growing capability of domestic large models, and the increasing role of inference platforms as the primary entry point for model distribution and execution. For developers and enterprises, the real question is not “which model is the strongest” but “under my scenario, budget, compliance, and operational constraints, which combination of models and platforms is most stable, most economical, and most replaceable.”
1. The Core Tension After Supply Diversifies: Capacity, Cost, and Controllability Cannot All Be Optimal at Once
The coexistence of multiple models first raises the cost of choice. Different models excel in different aspects: general dialogue, long-document understanding, code generation, structured output, multi-turn instruction following, content safety, and more. The same model may perform significantly differently under different prompts, context lengths, and concurrency loads. Public benchmarks can serve as an initial filter, but they cannot replace business evaluation, because the distribution of public test sets often differs from real business data.
Second, the cost structure becomes more complex. The cost of calling a model is not just the unit price. It includes retries, redundant context, cache hit rate, batch efficiency, dedicated resource utilization, operational labor, and failure recovery costs. A low-priced model with a high retry rate may not be cheap in the end; a high-capability model may be wasteful for simple tasks. Third, controllability becomes a concern. Model version updates, service rate limits, data boundaries, log auditing, content safety, and exit mechanisms all affect long-term operational stability. Therefore, the selection process must move from “single-model comparison” to a combined strategy of “scenario layering + multi-model routing + observable governance.”
2. Build a Six-Dimension Selection Framework: Turn Subjective Judgments into Scored Criteria
We recommend building a scoring framework using six dimensions, with different weights for different business scenarios.
Business capability fit: Build a business-specific evaluation set around real tasks, covering correctness, completeness, format adherence, citation consistency, multi-turn consistency, and safety boundaries. For code scenarios, add runnability, unit test pass rate, and edge-case coverage. For knowledge Q&A, add factual consistency and the reasonableness of refusals. Public leaderboards are only an initial filter; the business set is the basis for decisions.
Input form and context requirements: Distinguish short text, multi-turn dialogue, long documents, tables, code repositories, and multimodal inputs. Long context does not mean effective long context; verify the recall and stability of key information in long inputs. For scenarios that require structured output, focus on format stability and robustness under abnormal input.
Performance and stability: Pay attention to time-to-first-token, end-to-end latency, throughput, P95/P99 latency, error rate, rate-limit trigger frequency, and peak stability. Dialogue-oriented services are more sensitive to first-token latency, while batch processing tasks care more about throughput and unit cost. Evaluation should be conducted under target concurrency, not just with single requests.
Cost and resource efficiency: Build a total cost model: call volume × effective unit price + dedicated resource cost + operational cost + failure/retry cost. Check whether common optimization methods such as caching, batch processing, context trimming, parameter-efficient fine-tuning, and quantization deployment are available. However, do not directly count unverified optimization gains into the final selection conclusion.
Deployment form and data boundaries: Public interfaces are suitable for quick validation and elastic traffic; dedicated instances are suitable for stable throughput and data isolation; private or hybrid deployment suits strict compliance and low-latency intranet scenarios. During selection, clarify whether data leaves the domain, log retention policies, key management, network isolation, and disaster recovery requirements.
Governance and replaceability: Check version management, audit logs, content safety, quota management, SLAs, failure notifications, and exit plans. More importantly, maintain a model access abstraction layer to avoid business code being directly bound to one service form. Only when replacement is possible is selection not a one-time gamble.
3. Evaluation Workflow: Offline Evaluation, Blind Testing, and Online Canary Rollouts Are All Essential
A reusable evaluation workflow typically includes: defining scenario layers, building a golden set, offline batch evaluation, human blind review, statistical confidence analysis, canary rollout, and continuous regression. The golden set should cover high-frequency tasks, long-tail tasks, adversarial inputs, and safety boundaries. Blind reviews should hide the model source to reduce brand bias. When analyzing statistics, pay attention to confidence intervals and sample sizes—do not draw conclusions from a few samples.
Below is a pseudocode example that uses weighted scoring for initial screening, combined with threshold filtering and manual review:
candidate_models = [ModelA, ModelB, ModelC]dimension_weights = {business_capability: 0.35,stability: 0.20,cost: 0.20,deployment_control: 0.15,governance: 0.10}for model in candidate_models:hard_filter(model.data_boundary, model.compliance, model.context_limit)score = sum(dimension_weights[d] * normalize(model.score[d]) for d in dimension_weights)output(model, score, dimension_details)# Scenario-based selection:# High-value complex tasks -> capability first, higher cost acceptable# High-frequency simple tasks -> cost & latency first, with a quality floor# Sensitive data tasks -> deployment control & governance first
Scoring tables only assist the initial screening; they cannot replace real traffic validation. Before going live, run a small canary rollout, segmented by user layer, task type, or traffic ratio. After launch, monitor quality metrics, latency, error rates, cost, and safety interception rates. Keep the ability to roll back instantly and maintain multi-model routing.
4. Platform Decoupling and Deployment Forms: Do Not Hard-Code Business Logic into Model Calls
In the multi-model era, the value of platform integration lies in reducing integration cost, but the risk lies in vendor lock-in. It is recommended to add a unified abstraction layer between business logic and model services. This layer provides a unified request/response format, routing policies, rate-limiting and retries, caching, degradation, and log/metrics collection. In this way, even if the underlying model or service form changes, the business side only needs to adjust routing configuration—not rewrite calling logic.
Deployment forms can be layered by scenario: use public interfaces during the validation phase for quick experimentation; for stable core traffic, use dedicated resources to guarantee throughput and isolation; for strict compliance scenarios, use private or hybrid deployment; for non-sensitive, low-frequency tasks, keep public interfaces to control cost. When deploying in the cloud, you can build the runtime foundation using general inference services, container platforms, monitoring/alerting, and logging capabilities from cloud providers such as Baidu AI Cloud. However, the business side should still access models through the unified abstraction layer and avoid hard-coding calls to a specific service form.
5. Cost and Performance Optimization: Start with Routing, Then Caching and Batch Processing
Cost optimization should not sacrifice quality. Common strategies include: routing tasks to models of appropriate capability levels, caching results for repeated questions, batching non-real-time tasks, compressing prompts and context (removing irrelevant history), optimizing time-to-first-token for streaming output, and setting rate limits and circuit breakers to prevent retries from amplifying cost. For stable high-frequency tasks, consider parameter-efficient fine-tuning or distillation after sufficient evaluation, but always keep a fallback path to the base model.
Capacity planning should be based on target concurrency and P95 latency, not average traffic. Monitoring should cover call volume, success rate, error types, latency percentiles, cache hit rate, cost per task, and safety interception rate. Only when quality, performance, and cost are all on the same observability panel can the selection be continuously calibrated.
6. Risk Governance and Implementation Checklist
Key risks to govern include: version drift causing performance regression, single-point dependency leading to unavailability, data exfiltration and log leakage, hallucinations and inappropriate outputs, quota exhaustion and rate limiting, and cost blowouts. Corresponding measures include: fixing an evaluation baseline with periodic regression, implementing multi-model routing and degradation, data classification and masking, content safety and auditing, quota alerts, cost budgets and circuit breakers, and defining SLAs with exit plans.
For implementation, follow this checklist: define scenario layers and weights; build the business golden set; complete offline evaluation and blind review; verify latency and error rate under target concurrency; calculate total cost; confirm data boundaries and compliance requirements; design the unified abstraction layer; run small canary traffic; establish monitoring and alerting; and define rollback and multi-model routing plans. The final decision is usually not “choose only one model” but rather a combination of “primary model + backup model + task routing + continuous evaluation.” There is no single best model—only an engineering-optimal solution that is verifiable, governable, and replaceable under clear constraints.
