LLM Selection Guide: Cost, Capability, and Practical Evaluation Methods
Choosing an LLM is not about finding the strongest model but about optimizing capability, cost, and latency together. This article presents a measurable engineering approach: a five-part cost model, weighted scorecards, anonymous canary traffic, scenario-based test suites, same-environment A/B tests, and post-launch monitoring.
1. The Essence of Model Selection: A Three-Objective Optimization
After general-purpose LLMs entered a phase of commoditized competition, model selection is no longer about “finding the strongest model.” It is about finding a Pareto optimum among capability, cost, and latency. Any single-point conclusion—who is smartest or who is cheapest—can mislead decisions because the three objectives constrain one another: stronger reasoning chains often mean more output tokens; more aggressive caching introduces consistency risk; lower unit prices may come with higher retry rates.
This article therefore treats model selection as a measurable, reproducible engineering experiment rather than a one-off subjective evaluation.
2. Build a Cost Model Before Comparing Unit Prices
Comparing only “price per million input/output tokens” is the most common source of misjudgment. A real bill consists of five components:
- Input token cost;
- Output token cost;
- Discount from cache hits (hit rate is a key variable);
- Extra rounds from failed retries and multi-turn completion;
- Marginal amplification from long context.
A reusable estimation function is as follows:
def estimate_cost(reqs, price, cache_hit_rate=0.0, retry_rate=0.0):"""reqs: [{"in": int, "out": int}, ...]price: {"in": float, "out": float, "cache_in": float} # unit: CNY per million tokens"""total = 0.0for r in reqs:eff = 1 + retry_rate # retry amplification factorcached = r["in"] * cache_hit_ratefresh = r["in"] - cachedtotal += (fresh * price["in"] + cached * price["cache_in"]) * efftotal += r["out"] * price["out"] * effreturn total / 1_000_000
Key insight: a 2x difference in unit price does not necessarily mean a 2x difference in the bill. If a solution raises accuracy to a very high level by increasing sampling rounds, output tokens and call counts will rise together; conversely, a solution with a high cache hit rate can significantly dilute costs in scenarios with stable prefixes (system prompts, long documents, fixed tool definitions). Only by making cache_hit_rate and retry_rate explicit variables can “feels cheap” become “calculable.”
3. Read Leaderboards Correctly: Look at Sub-scores, Not Total Scores
Composite capability scores place 59 models on a capability-versus-single-task-cost plane, forming a cost-performance frontier: models on the leftmost frontier line mean “getting the same score for less money”; the large upper-right area means “spending more but still not reaching this score.”
But composite scores are only an entry point. Decisions must drill down into sub-scores:
- Code capability: most mainstream models are near saturation, and differences are often at the boundary of one test case;
- Agent/tool-calling capability: multi-step planning, error recovery, and long-horizon consistency begin to create gaps;
- Vision and front-end generation: layout fidelity, component structure, and runnability are dividing lines;
- Domain tasks (such as office documents and process automation): absolute score gaps can be large and need to be weighted by business importance.
The right approach is to build your own weighted scorecard and map the real business distribution into weights, rather than copying leaderboard rankings.
4. Anonymous Canary Release: Let Real Traffic Vote First
An anonymous canary release before launch—opening under a code name for one week on an aggregation routing platform—is an efficient capability probe. It removes psychological bias from brand expectations and lets real call volume and retention speak. Engineering-wise, it can be replicated as follows:
- Route requests to candidate models at the gateway layer by traffic percentage, without user awareness;
- Record call success rate, first-token latency, end-to-end latency, retry rate, and human adoption rate;
- After the canary period, aggregate results with the same scorecard to avoid noise such as launch-day traffic.
5. Scenario-Based Testing: Minimal Validation Sets for Three Task Types
Code tasks: Prepare 20 problems with hidden test cases; metrics are first-pass rate and repair rounds.
Agent tasks: Prepare 10 tasks requiring three or more tool calls; metrics are task completion rate, invalid call count, and average number of steps.
Vision/front-end tasks: Generate pages from the same requirement description; metrics are runnability, layout structure similarity, and interaction usability. Models can rank multiple candidate versions by preference, followed by manual spot checks.
The three task types share one request wrapper for horizontal comparison:
async def run_suite(model, cases, judge):rows = []for c in cases:r = await call_model(model, c.prompt) # unified timeout and retry policyrows.append({"id": c.id, "score": judge(r, c), "tokens": r.usage})return summarize(rows) # output: pass rate, average tokens, cost per run
6. Operationalizing A/B Tests
Putting two candidates into the same environment, the same prompts, and the same dataset for a full business cycle (including weekday and weekend load differences) is the only reliable way to compare costs. Implementation points:
- Fix random seeds and sampling parameters to avoid variance contaminating conclusions;
- Run scheduled jobs during off-peak hours to avoid impacting production;
- Persist each sample’s prompt, output, token usage, and score to a database, forming a traceable asset;
- Use daily cost curves rather than single-point averages, and observe cost elasticity on peak days.
7. Continuous Observation After Launch
Model selection is not the endpoint. The production environment needs three types of general infrastructure: a container platform to host an elastic inference gateway, a logging service to retain full-chain call records, and monitoring/alerting with thresholds for cost slope, error rate, and P95 latency. These can be built on general-purpose capabilities offered by cloud platforms such as Baidu AI Cloud (object storage, message queues, container platform, logging service, monitoring and alerting) to avoid tight coupling to a single model.
8. Conclusion Checklist
- Replace unit-price comparison with a five-component cost model;
- Replace composite-score ranking with a weighted scorecard;
- Replace subjective impressions with anonymous canary releases;
- Replace one-off benchmarking with a one-week same-environment A/B test;
- Turn one-time selection into continuous governance with monitoring and alerting.
The final “optimal solution” is often neither the strongest nor the cheapest, but the one that delivers the highest benefit per unit cost on your data distribution and can be continuously observed.
