Domestic LLM Selection: A Five-Dimensional Evaluation and Engineering Implementation Guide
As domestic large language models diversify across coding, long-document understanding, tool use, latency, cost, and private deployment, selecting a model by leaderboard rank alone is rarely sufficient. This article presents a reusable engineering approach: decompose business scenarios, build a five-dimensional evaluation framework, run POCs with real desensitized data, and use a model gateway with routing and fallback to turn model selection into an architectural capability. It also covers a scenario-based selection matrix, production architecture recommendations, common pitfalls, and a four-step closure for sustainable LLM operations.
Domestic LLM Selection: A Five-Dimensional Evaluation and Engineering Implementation Guide
When evaluating the growing number of domestic large language models, the most common selection mistake is looking for the single top-ranked model. Model capabilities are diverging quickly: some are stronger at code reasoning and tool calling, some focus on long-document understanding, some stand out for throughput, latency, and cost, and others offer advantages in private deployment and data isolation. For enterprises and developers, the real question is not “Which model is strongest?” but “Which model combination can reliably complete tasks under my business constraints and run at scale at acceptable cost?”
Model names and versions iterate quickly, and today’s leaderboard conclusions may become invalid within months. Therefore, this article does not recommend specific products. Instead, it abstracts the original selection problem into a reusable engineering method: first decompose scenarios, then build a metric system, then use real data for POCs, and finally solidify selection into architectural capability through a model gateway, routing, and fallback mechanisms.
1. Start by Decomposing Scenarios: Four Typical Requirements Determine Evaluation Priorities
1.1 R&D Productivity and Code Intelligence
Code-related tasks cannot be evaluated only by whether the model can generate a function. Real R&D scenarios include complex business logic implementation, system architecture design, cross-file refactoring, code review, test case generation, defect localization, and impact analysis of interface changes. These tasks require strong code understanding, long-code-context handling, tool calling, and iterative correction capabilities.
For evaluation, it is advisable to construct samples from the enterprise’s own code repositories rather than relying only on public programming problems. Consider the following metrics:
- Compilation or build pass rate;
- Unit test pass rate;
- First-pass rate for code review;
- Proportion of risks such as introduced defects, duplicated code, and unauthorized access;
- Completeness of cross-file modifications;
- Success rate in reading files, running tests, and fixing failed steps within a given toolchain.
If the code involves core assets, focus on private network deployment, permission isolation, log auditing, and boundaries for training data usage. In many cases, the final effectiveness of code intelligence depends not only on the model but also on context organization, tool permissions, and feedback loops in the coding assistant.
1.2 Long-Document Understanding and Multimodal Content Processing
Common knowledge-intensive business requirements include batch research report analysis, contract review, policy Q&A, meeting minutes summarization, technical document retrieval, understanding of drawings or scanned documents, and table extraction. Such scenarios may appear to be simply “the longer the context, the better,” but they are actually more complex: a large context window does not equal strong effective understanding; fitting a document into the context does not mean the model can accurately locate information, cross-reference it, and avoid hallucinations.
Real systems usually need to combine multiple capabilities:
- Document parsing: layout analysis, table structure reconstruction, and mixed understanding of images and text;
- Chunking and retrieval: indexing by chapter, paragraph, page number, and heading hierarchy;
- Long-context reasoning: cross-chapter summarization, comparison of conflicting information, and multi-hop Q&A;
- Citation and traceability: answers should be locatable to source snippets or page numbers;
- Multimodal understanding: unified processing of scanned documents, images, design drafts, and transcribed audio/video content.
Evaluation should not be limited to single-point information lookup. It should also cover multi-hop reasoning, cross-document conflicts, table calculation, citation correctness, and refusal capability. Pay particular attention to information recall in the middle of long contexts and whether topic drift occurs when the context becomes too long.
1.3 Tool-Based Agents and Process Automation
The core of an Agent scenario is not chat, but “understand the goal—plan steps—call tools—observe results—correct errors—complete the task.” Typical tasks include ticket handling, data queries, report generation, multi-system operations, R&D pipeline triggers, and content moderation assistance.
A production-ready Agent usually consists of a model, planning strategy, tool layer, memory and state management, permission control, retry mechanisms, observability, and evaluation sets. The model is only one part. During selection, focus on:
- Whether tool selection is accurate;
- Whether parameter generation conforms to the tool schema;
- Whether long-chain tasks are prone to repeated calls, infinite loops, or missing steps;
- Whether the Agent can retry based on error information after a tool failure;
- Whether it supports stepwise confirmation, human takeover, and rollback;
- Whether high-risk operations have permission boundaries and audit records.
Agents are not better simply because they are more autonomous. For enterprise systems, least privilege, idempotent design, sandbox execution, approval nodes, and full-chain traces are often more critical than “multi-agent” architectures.
1.4 Consumer-Facing High-Concurrency and Low-Cost Inference
Consumer-facing applications are usually more sensitive to latency, throughput, and cost, such as intelligent customer service, content generation, search Q&A, marketing assistants, and voice interaction. These scenarios should focus on:
- First-token latency and full response latency;
- p50, p95, and p99 latency, not just averages;
- Requests per second and concurrency stability;
- Comprehensive cost per successfully completed task;
- Rate limiting, fallback, caching, and multi-model routing capabilities;
- Content safety, sensitive information filtering, and abnormal output handling.
High-concurrency systems should not send all requests to the strongest model. A more common approach is layered routing: simple requests go to a low-cost fast model, complex requests are escalated to a stronger model; repeated questions use caching; long tasks use asynchronous queues; and when the primary model times out or is rate-limited, the system automatically switches to a backup model.
2. A Five-Dimensional Evaluation Framework: From Model Capability to System Capability
Dimension 1: Task Effectiveness and Generalization
Do not rely only on vendor marketing or public leaderboards. Build a layered evaluation set close to the business, including at least:
- Simple common tasks;
- Complex multi-step tasks;
- Boundary and anomaly tasks;
- High-risk tasks or tasks that must be refused;
- Inputs in different languages, formats, and lengths.
Scoring can use automated metrics plus human review. For generation tasks, use rule validation, structured validation, and sampled human evaluation. For Q&A tasks, distinguish between correct answers, correct citations, clear expression, and whether the model should refuse.
Dimension 2: Code, Tool Calling, and Structured Output
If the business requires the model to connect to external systems, evaluate its function calling, stability of structured outputs such as JSON, parameter correction, and multi-tool coordination. From an engineering perspective:
- Define clear schemas and examples for tools;
- Perform server-side validation on parameters and never blindly trust model output;
- Add idempotency keys, approvals, and sandboxes for write operations;
- Log the input, output, latency, and errors of each tool call;
- Include tool-call success rate in regression evaluation.
Dimension 3: Long-Context and Multimodal Understanding
Long-context capability should be evaluated by both “window size” and “effective utilization.” A very large window with poor recall of middle information has limited practical value. Consider the following tests:
- Locating key information in long documents;
- Cross-document comparison;
- Combined understanding of tables, formulas, and image captions;
- Constraint maintenance in ultra-long conversations;
- Stability and cost changes when input approaches the limit.
If document volume continues to grow, relying solely on long context is not economical. A more robust architecture is “retrieval augmentation + long-context close reading”: first retrieve candidate snippets, then send key content to the model for deep reasoning, and require citations in the output.
Dimension 4: Performance, Throughput, and Cost per Task
Model pricing should not be compared only by “price per thousand tokens.” Instead, calculate cost per successful task. A cheap model that requires multiple retries and manual rework may be more expensive than a higher-priced model that succeeds on the first attempt.
Record:
Cost per successful task =(input token cost + output token cost + tool call cost + retry cost + infrastructure cost)/ number of successful tasks
Also monitor peak concurrency, rate-limiting policies, and long-task queues. Private deployment must include hardware, operations, elastic scaling, and model upgrade costs; public API services require evaluation of quotas, stability, and data boundaries.
Dimension 5: Private Deployment, Security, and Governance
Government, enterprise, and core business scenarios usually require evaluation of:
- Whether data leaves the domain and whether VPC or local deployment is supported;
- Permissions, tenant isolation, log auditing, and key management;
- Input/output content safety and sensitive information identification;
- Model version pinning, rollback, and canary release;
- Whether custom dictionaries, tool integration, and business knowledge bases are supported;
- License agreements, weight availability, and redistribution boundaries;
- Vendor lock-in risk and migration cost.
Security evaluation cannot stop at the model layer. Prompt injection, unauthorized tool calls, data leakage, and Agent misoperations all require system-level protection.
3. Build a Selection Matrix by Scenario
| Scenario | Primary Goal | Recommended Capability Combination | Deployment Preference | Key Metrics |
|---|---|---|---|---|
| R&D code intelligence | Complex logic, cross-file understanding, tool calling | Strong code reasoning + codebase retrieval + test feedback loop | Internal network or dedicated environment preferred | Build pass rate, test pass rate, review pass rate, defect rate |
| Long-document knowledge analysis | Long context, multimodal parsing, citation accuracy | Document parsing + retrieval augmentation + long-context reasoning | Choose based on data sensitivity | Answer accuracy, citation correctness, refusal accuracy |
| Tool-based Agent | Stable planning, tool calling, error recovery | Planning model + tool gateway + sandbox + observability | Private deployment for core systems | End-to-end success rate, tool-call accuracy, average steps |
| Consumer high concurrency | Low latency, low cost, elasticity | Small model front end + strong model fallback + caching and rate limiting | Public service or hybrid architecture | p95 latency, concurrency stability, cost per successful task |
| Classified and government/enterprise | Data isolation, auditing, controllability | Private model + intranet retrieval + permission auditing | Private/dedicated environment | Data egress rate, audit completeness, recovery time |
| Multi-business platform | Unified governance, flexible switching | Model gateway + routing policies + unified evaluation | Hybrid deployment | Availability, switchover time, version stability, cost transparency |
The key point of this table is not to provide fixed answers but to remind teams that selection goals must align with business goals. Code scenarios should prioritize code and tool capabilities, knowledge scenarios should prioritize long documents and citations, traffic-oriented businesses should prioritize throughput and cost, and core systems should prioritize private deployment and governance.
4. How to Run a POC: Decide with Real Tasks, Not Demonstration Demos
4.1 Define Success Criteria
Before testing, define business success criteria, such as “ticket auto-classification accuracy reaches 95%,” “document Q&A citation correctness reaches 90%,” “code fix unit test pass rate reaches 70%,” or “p95 response time is below 3 seconds.” Without criteria, a POC easily becomes a subjective experience.
4.2 Build a Layered Evaluation Set
The evaluation set should contain 100 to 500 real desensitized samples, layered by task type, difficulty, input length, and risk level. Each sample should include input, expected output, scoring rules, and whether refusal is allowed. For high-risk tasks, set up dedicated adversarial samples and unauthorized-operation inducement samples.
4.3 Test Both Offline and Online Metrics
In the offline stage, focus on accuracy, stability, latency, and cost. In the online stage, validate real user experience through shadow traffic, A/B testing, or small-traffic canary releases. Pay special attention to consistency across repeated runs: whether the same input produces significantly different results across multiple calls, and whether failures can be recovered through retries.
4.4 Use a Model Gateway to Isolate Vendor Differences
It is advisable to add a unified gateway between business code and model services to implement unified protocols, authentication, rate limiting, retries, logging, metering, and version management. Example pseudocode:
function route(request):if request.containsSensitiveData:return privatePool.select(request.taskType, request.qualityLevel)if request.taskType == "coding":return gateway.select("coding-strong", fallback=["general-strong"])if request.inputLength > LONG_CONTEXT_THRESHOLD:return gateway.select("long-context", fallback=["retrieval-augmented"])if request.priority == "low-cost":return gateway.select("fast-small", fallback=["general-balanced"])return gateway.select("general-balanced")
Routing policies require canary release and observability, and model names should not be hard-coded into business logic. Otherwise, later switching, fallback, and cost optimization will become very passive.
5. Production Architecture Recommendations: Do Not Bet Reliability on a Single Model
1. Layered routing. Use small models for simple tasks and strong models for complex tasks; apply rule-based routing first, then model-based judgment. Set limited retries and escalation policies for failed requests.
2. Caching and deduplication. Use semantic or exact caching for high-frequency questions, fixed templates, and similar requests, but pay attention to permission isolation and freshness to avoid cross-tenant leakage.
3. Retrieval augmentation and citations. Knowledge-related businesses should adopt a “retrieval—reranking—close reading—citation” process. Answers must be traceable to source documents. When confirmation is impossible, explicitly refuse or hand off to a human.
4. Agent sandbox and least privilege. Tool calls must include parameter validation, permission checks, idempotency keys, timeout control, and auditing. High-risk write operations should be rehearsed or manually confirmed first.
5. Observability. Record request trace IDs, model versions, prompt versions, token consumption, first-token latency, full latency, tool call chains, error codes, and user feedback. Without observational data, selection cannot be continuously optimized.
6. Regression evaluation. Every model upgrade, prompt adjustment, or tool change should run a fixed evaluation set to prevent “local improvement but overall degradation after upgrade.” Evaluation should enter the release process rather than being a one-time report.
6. Common Pitfalls and How to Avoid Them
- Selecting models only by leaderboard. Leaderboards are only for initial screening; retest with business samples.
- Treating long context as a universal knowledge base. Ultra-long input increases cost and may reduce recall of key information; combine retrieval and citations.
- Assuming open source means zero cost. Private deployment involves hardware, operations, monitoring, security, and upgrade costs; calculate total cost of ownership.
- Making Agents too large. Multi-agent, multi-tool, long-chain designs amplify uncertainty; start with single-step controllable tasks and expand gradually.
- Ignoring version drift. Model service upgrades may change outputs; pin versions, keep rollback capability, and run continuous regression.
- Letting models directly execute high-risk operations. All write operations should have permission boundaries, auditing, and manual confirmation mechanisms.
- Lacking data desensitization and permission isolation. Knowledge bases, caches, logs, and evaluation sets can all become leakage channels and require end-to-end governance.
7. Implementation Conclusion: A Four-Step Selection Loop
Step 1: Decompose business scenarios such as code intelligence, long documents, Agents, and high concurrency, and define quality, latency, cost, and compliance constraints for each scenario. Step 2: Use real desensitized data to build layered evaluation sets, turn “effectiveness” into measurable metrics, and convert “cost” into cost per successful task. Step 3: Use a model gateway for multi-model routing, fallback, and canary release to avoid binding the business to a single service. Step 4: Establish continuous evaluation and observability so that model version upgrades, prompt adjustments, and tool changes are verifiable and rollback-capable.
There is no static answer for domestic LLM selection. A more reliable approach is to treat selection as an ongoing engineering problem: evaluate capabilities with real tasks, eliminate single-point dependency through architecture, protect security boundaries through data governance, and constrain scale expansion with a cost model. In this way, no matter how models iterate, teams can obtain stable, controllable, and continuously optimizable AI capabilities at low migration cost.
