Large Language Model Selection: A Practical Guide Using Usage and Cost Metrics
Selecting the right large language model (LLM) requires moving beyond subjective experiences. This article explores how to interpret public usage and cost metrics to build a multi-dimensional evaluation framework covering task quality, cost, latency, context stability, compliance, and ecosystem integration. It also provides a reproducible evaluation pipeline with code examples, cost estimation methods, and practical recommendations for your model selection journey.
1. Why Subjective Experience is Insufficient for Model Selection
“Feels easy to use” is a subjective personal impression heavily influenced by prompt engineering, use cases, and UI habits. The same model might generate marketing copy smoothly but frequently fail at structured information extraction. If a team selects a model based solely on personal impressions, the conclusion is difficult to reuse. Change the person or the business scenario, and the conclusion might no longer hold.
Therefore, model selection requires breaking down “handiness” into measurable metrics. Measurable means: the same batch of inputs, the same scoring criteria, and anyone repeating the execution can achieve similar results.
2. How to Interpret Public Usage and Cost Data
Public leaderboard data typically provides two types of information: usage volume (request scale measured by tokens) and cost (expenditure calculated based on pricing rules). Comparing the two offers some reference value:
- High usage volume ratio indicates the model is widely adopted and suitable for diverse scenarios.
- High cost ratio indicates the unit value or price per call is relatively high.
- The ratio between the two can be defined as a “cost-performance index,” calculated as usage volume ratio divided by cost ratio. An index greater than 1 means the model handles a large volume of calls but is allocated a smaller budget share. An index less than 1 means users are paying a premium for quality or service.
Leaderboard data reflects overall market behavior and cannot be directly equated with your business performance. High usage volume might stem from low pricing, easy integration, or default configurations, not necessarily indicating the best performance for your specific tasks. Leaderboards are best used to narrow down candidate options, but the final conclusion must rely on your own evaluations.
3. Building a Multi-Dimensional Evaluation Framework
3.1 Task Quality
Quality is the primary metric and must be broken down by business task. Common tasks include text generation, information extraction, summarization, code generation and repair, multi-turn dialogue, and logical reasoning. Each task category should have at least 100 representative samples, covering both common and edge cases. Samples should originate from real business data and undergo desensitization.
3.2 Cost
Cost is not just about unit price. Total cost includes input tokens, output tokens, retry counts, prompt length, and the number of additional calls required to meet quality standards. A model with a lower unit price that requires multiple rounds of correction to yield a usable result may not necessarily have a lower total cost.
3.3 Latency and Throughput
For online interactive scenarios, focus on time-to-first-token (TTFT) and overall response time. For batch processing scenarios, focus on throughput and concurrency limits. Measurements should be conducted under near-production concurrency conditions, recording percentiles like P50 and P95 to avoid long-tail issues being masked by averages.
3.4 Context Length and Stability
Long document analysis and codebase Q&A rely on the context window. Testing must verify whether the model can accurately retrieve information from the middle of a long input, rather than just checking if it accepts long inputs. Simultaneously, record timeout rates, rate-limiting error rates, and format error rates, as these directly impact online availability.
3.5 Compliance and Data Security
When dealing with personal information, trade secrets, or regulated data, confirm data storage locations, whether data is used for model training, access logging and audit capabilities, and support for private or dedicated deployment. Compliance is a hard constraint and should be screened before quality and cost.
3.6 Integration and Ecosystem
Integration evaluation includes API protocol compatibility, SDK maturity, support for function calling and structured outputs, monitoring and alerting integration methods, and the integration cost with existing object storage, message queues, and logging services. Integration costs directly impact the go-live timeline.
4. Building a Reproducible Evaluation Process
The evaluation process can be divided into five steps: preparing the dataset, standardizing prompt templates, batch calling, automated scoring, and manual spot-checking. Below is a vendor-agnostic evaluation skeleton demonstrating the core logic:
from dataclasses import dataclassfrom statistics import meanimport time@dataclassclass EvalCase:prompt: strexpected: strdef judge(output: str, expected: str) -> float:# Example scoring: score 1 if output contains key information, otherwise 0.# In production, replace with rule validation, structured comparison, or manual review scoring.return 1.0 if expected.strip() in output else 0.0def run_eval(call_model, cases: list[EvalCase]) -> dict:scores, latencies, failures = [], [], 0for case in cases:start = time.perf_counter()try:output = call_model(case.prompt)except Exception:failures += 1continuelatencies.append(time.perf_counter() - start)scores.append(judge(output, case.expected))latencies.sort()return {"accuracy": mean(scores) if scores else 0.0,"p50_latency_s": latencies[len(latencies) // 2] if latencies else None,"failure_rate": failures / len(cases),}
Here, call_model is the adapter function for each model, responsible for converting the unified request format into specific API calls. Once encapsulated, the same dataset can be run sequentially across different models, and the results can be directly compared.
Note the following during implementation:
- Fix sampling parameters like temperature and record the model version number to ensure reproducibility.
- Repeat each set of experiments multiple times to observe the fluctuation range of results.
- Determine scoring rules before viewing model outputs to avoid adjusting standards retrospectively.
5. Cost Estimation Methods
The cost of a single request can be estimated using the following formula:
Single Cost = Input Token Count × Input Unit Price + Output Token Count × Output Unit Price
Monthly Cost = Average Daily Requests × Single Cost × 30 × (1 + Retry Rate)
The retry rate includes timeouts and calls re-initiated due to format errors. Placing quality evaluation results and cost estimates in the same table allows you to compare the “cost per qualified result.” This metric is more valuable for decision-making than simply comparing unit prices.
Calculation example: Assume a task has 10,000 daily requests, with an average of 800 input tokens and 300 output tokens per request, and a retry rate of 5%. Substitute the specific unit prices to get the monthly budget. Please refer to the latest pricing rules published by the service provider for unit prices.
6. Practical Recommendations
- First use public leaderboard data to narrow down candidates, typically keeping three to five models.
- Prepare evaluation sets based on business tasks, pass compliance thresholds first, then compare quality.
- Among models meeting quality standards, compare total cost and latency.
- After selecting the primary model, keep a backup model and regularly re-run evaluations, as model versions iterate rapidly.
- Integrate evaluation scripts into your continuous integration pipeline to automatically execute regression tests whenever the model version changes.
Model selection is not a one-time decision. Teams should document evaluation sets, scoring rules, and cost models so that every model update can be measured with the same yardstick. If your enterprise is already using large model services provided by Baidu AI Cloud, you can incorporate them into the same evaluation framework and compare them side-by-side with other candidate models.
