How to Choose an LLM: A Guide to Evaluation and Production Deployment
Choosing a large language model (LLM) is no longer about picking the highest leaderboard score. This guide explains how engineering teams should evaluate and deploy LLMs, covering a multi-dimensional evaluation system (basic capabilities, coding, multimodal inputs, and cost), the trade-offs between open-source models and cloud APIs, total cost of ownership, and a production architecture built around observability. It includes ready-to-use evaluation tables, a step-by-step hourly cost formula with a worked example, the core components of a model application stack, and a pre-launch checklist so teams can match models to their business goals, cost budgets, safety boundaries, and operational capability.
1. How to Choose a New Model: Answer the Business Questions First
The pace of large model releases has clearly accelerated. New models no longer compete only on parameter count, context length, or multimodal input; they are also pulling apart in specific scenarios such as code generation, front-end interaction, tool calling, and complex reasoning. For developers and enterprises, having more models does not mean “easier selection” — it means higher selection complexity.
A common mistake many teams make is treating leaderboard scores as the sole basis for decisions. One model may excel at code generation but be unbalanced in long-text understanding, tool calling, multi-turn dialogue, structured output, or cost control. Another may look average in overall rankings yet be more stable and easier to maintain in a specific business scenario.
So when facing questions like “how do we choose among new models,” “what if the leaderboard misleads us,” “open source or cloud service,” and “can a code model go into production,” enterprises need an engineering judgment framework rather than chasing short-term hype. The core of selection is not finding the single “strongest model,” but finding a combination of models that matches business goals, cost budgets, safety boundaries, and operational capability.
2. Don’t Evaluate on a Single Total Score: Build a Multi-Dimensional Evaluation System
The most common mistake in LLM evaluation is treating an “overall score” as the only standard. In real business, user experience is often determined by multiple sub-items. For example, if a coding assistant has a high code correctness rate but is slow to respond, produces messy output formats, and cannot explain the reason for a change, developers may still abandon it. If a customer service model answers fluently but refuses questions inaccurately, makes factual errors, and lacks sensitive-information detection, it also cannot truly go live.
So enterprises need to shift evaluation from “looking at leaderboards” to “looking at tasks.” It is recommended to cover at least basic capabilities, code capabilities, front-end capabilities, multimodal capabilities, safety capabilities, and cost capabilities.
2.1 Basic Capability Evaluation Table
Basic capabilities determine whether a model can serve as a stable foundation. Design an evaluation table across the following dimensions:
| Evaluation Item | Recommended Sample Size | Judgment Method | Target Threshold | Regression Frequency |
|---|---|---|---|---|
| Long-text summarization | 100–200 items | Human scoring: completeness, accuracy, redundancy | Completeness ≥ 90 | On model or prompt change |
| Multi-turn dialogue | 100+ turns | Context retention, coreference resolution, topic-switch handling | Context retention rate ≥ 90% | Every two weeks |
| Instruction decomposition | 150 items | Whether complex tasks are decomposed and executed accurately | Decomposition accuracy ≥ 85% | On every upgrade |
| Structured output | 200 items | Whether JSON, tables, and field extraction are parseable | Parseable rate ≥ 98% | On every upgrade |
| Clarification ability | 100 items | Whether the model proactively clarifies ambiguity | Effective clarification rate ≥ 80% | Monthly |
The key to basic capability evaluation is not chasing a single impressive point, but verifying that the model can be used stably in real business over the long term.
3. Code Capability Evaluation: From “Can Write Code” to “Can Enter the Development Workflow”
Code capability is one of the areas developers care about most. Evaluating code models cannot look only at “whether they can generate a runnable piece of code”; it must also consider whether they fit into the development workflow, reduce rework, and meet security, maintainability, and engineering requirements.
It is recommended to build an evaluation set across six task types: code completion, code generation, code explanation, refactoring suggestions, unit test generation, and front-end code generation.
| Metric | Sample Size | Pass Criteria | Measurement | Target Threshold | Regression Frequency |
|---|---|---|---|---|---|
| Task pass rate | ≥ 200 items per task type | Automated tests, static checks, and a human rubric combined score ≥ 0.8 | Passed cases / total cases | Overall ≥ 75%, high-risk modules ≥ 85% | On every model or prompt change |
| Human adoption rate | 100–300 real development requests | Direct adoption or minor edits counts as adopted; heavy rewriting counts as not adopted | Adopted items / generated items | ≥ 60% | Every two weeks |
| Defect rate | ≥ 200 generation calls after launch | Serious defects, wrong dependencies, or security risks within 7 days | Defect count / adopted generations | ≤ 2% | Monthly |
| Mean time to fix | All adopted defect samples | Median time from feedback to a merged fix | Median and P90 | Median ≤ 4 hours, P90 ≤ 8 hours | Weekly |
In code capability evaluation, automated checks can cover syntax validation, static scanning, unit test pass rate, and API call success rate; human review focuses on readability, maintainability, naming conventions, edge-case handling, and business fit.
For front-end code generation, add the following acceptance points: whether semantic tags are used, whether keyboard focus operation is supported, whether loading, empty, and error states are handled, whether styles are over-nested, whether the output is easy to modify further, and whether the layout remains reasonable across different screen sizes. Models with strong front-end capabilities usually rely not only on code generation but also on understanding interface structure, component patterns, and interaction paths.
4. Multimodal Input Evaluation: Replace Vague Judgment with Thresholds
Multimodal inputs such as text, speech, and images are becoming common capabilities in new models. But multimodal does not mean out-of-the-box usable. Before going live, enterprises need to turn vague judgments like “is the image description accurate” into quantifiable thresholds.
The following multimodal evaluation approach is recommended:
| Evaluation Item | Sample Size | Judgment Method | Target Threshold | Failure Handling |
|---|---|---|---|---|
| Image description accuracy | 200 images | Human labeling of whether key objects, scenes, and actions are consistent | ≥ 90% | Low-confidence cases go to human review |
| Key object recognition | 150 images | Whether people, objects, text, and layout elements are recognized correctly | ≥ 95% | Errors on key objects trigger blocking |
| Speech transcription quality | 200 audio clips | Character error rate, sentence error rate, punctuation usability | Character error rate ≤ 8% | High-noise audio transcribed to text or handled by humans |
| Image-text semantic consistency | 150 items | Whether image and text match; whether contradictions exist | ≥ 88% | Conflicting content downgraded or refused |
| Multimodal failure rate | 500 calls | Timeout, format error, parse failure, unusable content | ≤ 3% | Switch to a backup model or text fallback |
| Latency | 500 calls | End-to-end response time | Real-time scenarios P95 ≤ 3 seconds | Make asynchronous or downgrade |
| Privacy masking rate | 200 sensitive samples | Recognition and masking of phone numbers, ID numbers, bank cards, addresses, etc. | ≥ 98% | Unmasked content prohibited from entering logs |
Multimodal applications also need data normalization rules, such as unified image resolution, unified audio sample rate, file size limits, and a format whitelist. For privacy-sensitive content, masking, filtering, and access control should be completed before model integration. On failure, do not simply return an error; design a fallback path: prompt for re-upload when image quality is insufficient, switch to text when speech is unavailable, and switch to a backup model or human review when the model is abnormal.
5. Open Source and Open APIs: Not Either/Or, but Phased Selection
When a new model is released, “open source” often becomes a focus. The value of open-source models lies in controllability, customizability, and deployment flexibility. Enterprises can fine-tune, quantize, compress, or deploy privately according to business needs. But open source does not mean zero cost — model inference, operations, security, monitoring, and version upgrades all require engineering investment.
When evaluating open-source models, do not look only at capability; also consider compliance and resource thresholds:
- License compliance: Confirm whether the license allows commercial use, redistribution, further training, and derivative release. Licenses such as Apache-2.0 and MIT are usually more permissive, but the specific model terms still need to be checked.
- Weight usage restrictions: Some models set restrictions on use cases, user scale, region, retraining, or commercialization.
- Vulnerability and upgrade mechanisms: Clarify the patch cycle and version support cycle for the model, inference framework, and dependency libraries.
- Version rollback capability: Retain historical weights, images, inference configurations, and prompt versions to ensure fast rollback on failure.
- Resource thresholds: Assess GPU memory, CPU, memory, quantization options, concurrency, and elastic scaling costs.
Compared with open-source models, cloud open APIs have the advantages of fast integration, strong elasticity, and low operational pressure, making them suitable for quickly validating business value. But enterprises also need to watch long-term costs, data compliance, service stability, rate-limiting policies, and vendor lock-in risk.
A more reasonable strategy is not to simply choose open or closed source, but to advance in layers according to the business stage:
- Validation stage: Prioritize open APIs to quickly validate requirements and reduce trial-and-error costs.
- Growth stage: Build an internal evaluation set for high-frequency, high-value scenarios and compare the cost-performance of different models.
- Scale stage: Adopt hybrid deployment for core scenarios — keep highly sensitive data in a controllable environment and route general requests to cloud models.
- Optimization stage: Reduce costs through prompt optimization, retrieval augmentation, caching, routing, and small-model assistance.
If you use a mainstream cloud platform, model services can also be combined with common capabilities such as object storage, logging, monitoring and alerting, and elastic containers to form a more complete application infrastructure. The key is not stacking tools, but making data, models, logs, monitoring, and costs form a closed loop.
6. Cost Governance: Similar Prices Do Not Mean Controllable Total Cost of Ownership
When inference prices are no longer significantly lower than mainstream market levels, enterprises need to focus more on total cost of ownership (TCO) rather than just the per-call price. Cost estimation should at least cover input/output tokens, multimodal preprocessing, long context, failed-retry overhead, cache routing, evaluation maintenance, security compliance, and private deployment operations.
You can use the following simplified formula for hourly cost estimation:
Effective hourly call cost = QPS × 3600 × (1 − cache hit rate) × (1 + retry rate × average retries) × base cost per call
Base cost per call = (average input tokens × input unit price + average output tokens × output unit price) / 1,000,000
Total hourly cost = effective call cost + multimodal preprocessing cost + private deployment allocation cost + operations allocation cost
Example: Assume QPS is 20, so requests per hour = 72,000. The cache hit rate is 30%. The retry rate is 10%, with 1 retry per attempt on average. The average input is 1,500 tokens and the average output is 500 tokens. The input unit price is 0.8 per million tokens, and the output unit price is 4 per million tokens.
Base cost per call = (1500 × 0.8 + 500 × 4) / 1,000,000 = 0.0032.
Effective number of calls = 72000 × 0.7 × 1.1 = 55,440.
Effective call cost = 55440 × 0.0032 = 177.41.
If multimodal requests account for 20% — that is 14,400 calls — at a preprocessing cost of 0.01 per call, the multimodal preprocessing cost is 144. If the private inference and operations allocation cost is 300 per hour, then the total hourly cost is about 177.41 + 144 + 300 = 621.41.
In real systems, you can reduce unit business cost in the following ways:
- Request routing: Send simple tasks to lightweight models and complex tasks to stronger models.
- Result caching: Reuse historical results for high-frequency, low-variation questions.
- Context trimming: Keep only the fragments most relevant to the current task to avoid ineffective context inflation.
- Streaming output: Reduce perceived waiting time and improve interaction efficiency.
- Batch processing: Use batch processing for offline tasks to improve resource utilization.
- Failure fallback: Automatically switch to a backup model or rules engine when a model is unavailable.
- Evaluation regression: Re-run evaluation after every model, prompt, or routing strategy change to avoid cost optimization degrading quality.
The goal of cost governance is not simply to push down the unit price, but to balance quality, latency, security, and cost.
7. Engineering Architecture: Model Integration Is Just the Start; Observability Is Key
Many enterprises treat model integration as a single API call, but in production a model application is closer to a distributed system. Model services may time out, degrade, be rate-limited, or output anomalies, so a complete engineering architecture must be built.
A fairly complete model application architecture should include at least the following modules:
7.1 Model Gateway
The model gateway should uniformly handle authentication, rate limiting, retries, timeouts, logging, and auditing, avoiding business code depending directly on a specific model API. The gateway is recommended to record at least the following fields:
- requestId: unique identifier for a single request
- traceId: full-chain tracing identifier
- tenantId: tenant or business line
- appId: application identifier
- taskType: task type
- modelName: the model actually called
- promptVersion: prompt version
- inputTokens / outputTokens: input and output token counts
- latencyMs: response latency
- status: success, failure, or degraded
- errorCode: error code
- retryCount: number of retries
- fallbackModel: fallback model
- cacheHit: whether the cache was hit
- cost: cost of this call
- riskLevel: risk level
- sensitiveFlag: whether sensitive information was matched
7.2 Routing and Policy Center
Select different models or parameter configurations based on task type, user tier, cost budget, and security level. High-risk tasks should prioritize stable models or human review; low-cost tasks can use lightweight models.
7.3 Context Management
Responsible for conversation-history compression, knowledge retrieval, sensitive-information filtering, and input length control. More context is not always better; irrelevant context can increase cost, latency, and error rate.
7.4 Evaluation and Regression Platform
Automatically run the evaluation set after model upgrades, prompt changes, business rule changes, or routing strategy changes to prevent quality regression. The regression platform should support version comparison, threshold alerting, and automatic reporting.
7.5 Logging and Monitoring
Record request latency, output quality, failure reasons, user feedback, and cost consumption to form a traceable chain. Monitoring metrics should include at least success rate, P95 latency, retry rate, cache hit rate, human adoption rate, defect rate, and unit cost.
7.6 Security and Compliance Control
Perform sensitive-information recognition, permission checks, and audit trails on inputs and outputs. For high-risk scenarios such as access control, payments, data processing, and infrastructure configuration, model output should not be allowed to enter production directly.
7.7 Gray Release Mechanism
New models or new prompts should first be validated in a small-traffic environment before gradually expanding. It is recommended to roll out step by step at 1%, 10%, 50%, and 100%, with automatic rollback thresholds set.
Models will change, but the engineering system should remain stable. Only by wrapping model calls under a unified architecture can enterprises avoid being locked into a single model or a single vendor.
8. Enterprise Implementation Checklist: Confirm Item by Item Before Launch
Before an official launch, teams are advised to confirm the following checklist item by item, avoiding the situation where model capability is strong but the engineering system is missing.
| Check Item | Key Content | Acceptance Criteria |
|---|---|---|
| Business metrics | Clarify whether the goal is accuracy, adoption rate, cost, or response speed | Quantifiable metrics and a designated owner |
| Internal evaluation set | Covers common, edge-case, failure, and high-risk samples | Can auto-regress on every model change |
| Routing strategy | Distinguishes strong models, lightweight models, cache, and fallback paths | Cost and quality can be adjusted dynamically |
| Security review | Sensitive information, permissions, payments, and data operations need human or rule-based backstops | High-risk output does not go directly to production |
| Gray release | Small-traffic validation, monitoring alerts, and rollback mechanism | Can roll out by ratio and roll back quickly |
| Cost model | Includes tokens, retries, cache, multimodal, and operations | Can be estimated hourly or by business line |
| Observability | Logs, metrics, tracing, and alerting are complete | Anomalies can be traced to a specific request |
During implementation, define business metrics first, then choose models; build the evaluation set first, then optimize; ensure security and rollback-ability first, then pursue scale. Model capabilities can change quickly, but an enterprise’s engineering capability, evaluation capability, and cost governance capability are the real long-term competitive advantages.
