A Practical Guide to LLM Selection: Multi-Dimensional Evaluation and Deployment Decisions
This article provides a systematic methodology for selecting large language models (LLMs) in production environments. It covers building custom evaluation sets instead of relying solely on public benchmarks, six core assessment dimensions including capability fit, effective context length, inference performance, cost, stability, and engineering tooling, plus a comparison of deployment approaches and a unified API abstraction layer. The guide also outlines an offline-to-online evaluation workflow with gray release and rollback strategies, and highlights five common pitfalls in model selection.
From “No Choice” to “Model Supermarket”: Two Shifts in the LLM Landscape
Over the past two years, the supply side of large language models has undergone two significant shifts that together turn model selection from a one-time decision into an ongoing engineering practice.
The first shift is the explosion in model count. Both open-source and commercial models continue to iterate rapidly, with new generations released almost every quarter. The capability gap among models in the same tier is narrowing, while different models win on different tasks. The era of “one model leads in everything” is fading, replaced by a fragmented landscape where different models suit different scenarios.
The second shift is the convergence of access methods. Major cloud providers’ LLM platforms commonly adopt an aggregation model: one account, one authentication scheme, and a unified chat completion API format, with models from multiple sources displayed on the same shelf. This “model supermarket” approach reduces the cost of switching models from “renegotiating contracts, re-integrating, and rewriting code” to simply “changing a model name,” making multi-model comparison and on-demand switching practically feasible.
More choices are good, but they bring new decision costs: public leaderboards, vendor marketing, and community reputation are mixed together, and selecting based on impressions often means paying technical debt later in the project. This article does not review any specific model. Instead, it presents a general selection methodology: establish an evaluation framework first, expand dimension by dimension, and finally turn selection into a sustainable process with engineering practices.
First Principle: Build Your Own Evaluation Set Instead of Trusting Leaderboards
Third-party benchmark leaderboards can serve as an initial filter to quickly narrow down candidate models from the vast pool. However, directly using leaderboard rankings for final decisions carries two systemic risks:
- Task distribution mismatch. Leaderboards mostly assess general capabilities, but your business might involve long-document extraction, multi-turn ticket handling, or domain-specific Q&A—capabilities that may not be covered by the benchmarks. A high score does not guarantee good performance on your tasks.
- Potential for benchmark overfitting. Fine-tuning models specifically against public evaluation sets is not uncommon in the industry. A gap may exist between published scores and real-world experience.
A more reliable approach is to build your own evaluation set, following these steps:
- Sample source: Extract de-identified typical samples from real business logs, covering high-frequency scenarios, edge cases, and adversarial examples. Avoid using only “clean data.”
- Annotation standards: Define expected behavior or scoring dimensions for each sample, forming a golden set of dozens to hundreds of entries.
- Scoring method: Combine rule-based metrics (accuracy, format compliance rate, keyword hits) with model-as-judge (a stronger model scoring against a unified rubric) to reduce bias from any single scoring approach.
- Continuous regression: Put the evaluation set under version control. Re-run it each time a candidate model is upgraded to observe capability drift.
Six Core Evaluation Dimensions
3.1 Capability Fit
First, distinguish between “general capabilities” and “task-specific capabilities.” General capabilities include complex reasoning, code generation, math, and instruction following. Task-specific capabilities are those directly related to your business, such as domain Q&A, information extraction, structured output, function calling, and multi-step task execution. Additionally, pay close attention to hallucination rate and refusal behavior. A model that answers everything confidently can be a liability in serious business contexts. The ideal state is knowing what you know and clearly expressing uncertainty when appropriate.
3.2 Context Handling: Measure “Effective Length,” Not Just the Stated Limit
A model claiming 128K context support does not guarantee uniform utilization across the entire window. Research has shown that information placed in the middle of long contexts tends to be underutilized. Use two testing methods: first, the “needle-in-a-haystack” test, where key facts are embedded at different positions in a long document to check recall; second, direct end-to-end validation with real long-document tasks. Also, examine the context caching mechanism, as it significantly impacts cost for repeated-prefix scenarios such as fixed system prompts.
3.3 Inference Performance: Look Beyond Averages to the Tail
Key metrics include: time to first token (determining the responsiveness of streaming interactions), tokens per second, P95/P99 latency, and failure rates under high concurrency. Interactive scenarios are sensitive to first-token latency, while batch processing scenarios are sensitive to throughput. Always stress-test based on your actual load pattern, rather than relying on vendor-provided single-point data.
3.4 Cost: Unit Price Is Only the Starting Point
Token unit price is the easiest metric to compare, and the most misleading. The true total cost of ownership must account for: the price differential between input and output tokens, discounts for context caching and batch processing, hidden consumption from retries, and redundant spending for multi-model disaster recovery. If you consider self-hosting, factor in GPU depreciation, inference optimization staffing, and operational costs per request before comparing with API pricing.
3.5 Stability and Compliance
In production, you must verify: service level agreements and compensation terms, rate limits and quota policies, whether your data will be used for model training, data residency requirements, and whether private or dedicated instance deployment options exist. Content safety and moderation capabilities are equally essential for consumer-facing businesses.
3.6 Engineering Tooling
This covers: SDK and API compatibility, the quality of structured output and function-calling support, observability features such as call logs and token statistics, fine-tuning and distillation support, and model version policy—when old versions are deprecated and whether upgrade notices are provided in advance, as this directly determines your regression testing window.
Deployment Options and Unified Abstraction
| Deployment Mode | Best Suited For | Advantages | Trade-offs |
|---|---|---|---|
| Direct API calls | Validation phase, lightweight scenarios | Fast onboarding, no infrastructure management | Data leaves your environment; subject to platform policy constraints |
| Cloud-hosted inference | Production phase, data-sensitive workloads | Model weights under control, auto-scaling, unified multi-model management | Requires capacity planning and operational investment |
| Self-hosted inference cluster | Large scale, strict compliance | Full control, long-term cost optimization | Highest capital and staffing barrier |
Regardless of the deployment mode, add a unified abstraction layer between your business code and the models, so that switching models does not intrude on business logic. Below is a reference implementation using a widely adopted chat completion API format:
import json, time, urllib.requestclass ChatClient:"""Unified chat abstraction: switch models by changing the model name only"""def __init__(self, base_url: str, api_key: str, model: str):self.base_url = base_url.rstrip("/")self.api_key = api_keyself.model = modeldef chat(self, messages, temperature=0.2):payload = json.dumps({"model": self.model,"messages": messages,"temperature": temperature,}).encode("utf-8")req = urllib.request.Request(self.base_url + "/chat/completions",data=payload,headers={"Content-Type": "application/json","Authorization": "Bearer " + self.api_key,},)with urllib.request.urlopen(req, timeout=60) as resp:data = json.loads(resp.read())return data["choices"][0]["message"]["content"]
Building on this abstraction, an offline evaluation pipeline can be set up naturally:
def run_eval(clients: dict, cases: list) -> dict:"""Run the same evaluation set against multiple candidate models and output a comparison report"""report = {}for name, client in clients.items():records = []for case in cases:t0 = time.time()answer = client.chat(case["messages"])records.append({"case_id": case["id"],"rule_score": rule_check(answer, case["expect"]), # rule-based metric"judge_score": llm_judge(case, answer), # model-as-judge score"latency_s": round(time.time() - t0, 2),})report[name] = summarize(records) # aggregate mean scores, latency percentiles, failure ratereturn report
After Offline Evaluation: Production Gray Release and Continuous Regression
Offline scores are only a reference; the final judge is real production traffic. Follow a three-step approach:
- Gray release with traffic splitting: Let the new model handle a small percentage of traffic first, split by scenario or user group for controlled experiments. Monitor business metrics such as task completion rate, result acceptance rate, and manual intervention rate—not just technical metrics.
- Three-dimensional dashboard: Monitor quality scores, unit request cost, and latency percentiles simultaneously. Deterioration in any one dimension should trigger alerts.
- Disaster recovery and rollback: Configure primary/backup model routing with automatic fallback on timeout or errors. Keep the previous model version available to ensure rollback within minutes.
Five Common Pitfalls
- Treating leaderboard scores as conclusions: Leaderboards are for initial filtering; decisions must rely on your own evaluation set.
- Generalizing from a single-scenario result: Winning on one task does not mean winning across your entire business pipeline.
- Looking only at averages, ignoring the tail: P99 latency and failure rates are the hidden killers of user experience.
- Ignoring hidden costs: Long-context inputs, retry storms, and cache misses can double your bill.
- Overlooking exit costs: Before deeply binding to proprietary interface features, think through the migration cost you will pay later.
Conclusion: Make Model Selection an Infrastructure Practice
The “model supermarket” model has significantly lowered the cost of switching, which means “multiple models coexisting with scenario-based routing” will become the norm. The real competitive advantage lies not in betting on a single model, but in building the evaluation set, the unified access layer, and the monitoring dashboard as team infrastructure—turning every model upgrade into a low-cost regression validation. Regardless of which platform you ultimately choose—such as Baidu AI Cloud or other cloud providers offering managed LLM inference services—what determines the ceiling of your results is always this engineering-driven evaluation and iteration mechanism.
