Evaluating LLM Selection: Cost, Usage, and Discount Cycles
This article provides a practical framework for comparing large language model (LLM) services beyond sticker prices. It explains how to unify billing metrics, account for usage multipliers and promotional discounts, track consumption variations, and calculate the true cost per successful task. The guide includes a step-by-step evaluation flow, a Python example for cost calculation, common pitfalls, and rollout recommendations for production environments.
The Essence of Model Selection
The goal of model selection is to balance cost, output quality, and service stability. Many teams compare only list prices and overlook actual consumption. The same task can consume several times more billing units on different models, so list prices are only a starting point for comparison.
Unifying Billing Metrics
LLM services are typically billed based on input tokens, output tokens, and additional items. Providers differ in how they weight input versus output, discount cache hits, and count reasoning tokens as output. Before evaluating, complete these three steps:
- Confirm the billing unit: per character, per token, or per call.
- Break down the price structure: separate input, output, cache reads, and other items, and record each unit price.
- Run the same set of real tasks on all candidate models and record actual consumption. The gap between theoretical unit prices and real consumption often determines the final cost.
Promotional Discounts and Usage Multipliers
Temporary promotions commonly include time-limited discounts, usage multipliers (e.g., double tokens), credit grants, and time-based pricing tiers. These policies affect only the current effective cost; model capabilities remain unchanged. Evaluate promotions by splitting them into two parts:
- Current effective cost: calculated using the actual multiplier during the promotion period.
- Long-term cost: calculated using the restored standard price.
If long-term costs for two options are similar, choose the one with lower migration cost. If long-term costs differ significantly, treat the promotion as temporary benefit and not as a basis for long-term selection. Also assess migration costs after the promotion ends—for example, whether prompts need re-optimization, whether APIs need changes, and whether teams need retraining.
Usage Fluctuation and Hidden Consumption
A single model may show different consumption at different times. Common causes include service load variations, changes in context length, adjustments in the model’s internal reasoning strategy, and differences in client call patterns. Relying on subjective feelings to judge usage is unreliable; draw conclusions from logs:
- Count calls and consumption per hour to identify recurring peaks.
- Fix a task sample set and compare the median consumption across different time periods to exclude task-specific differences.
- Record abnormal peaks and compare them with server-side version change logs to detect strategy adjustments.
For experimental versions, explicitly note their stability. Experimental versions may have billing rules and quotas adjusted at any time, so they should not be directly included in production budgets.
Cost per Successful Task as the Core Metric
A lower unit price does not necessarily mean lower total cost. If a model has a low success rate, retries are needed; if output quality is unstable, manual rework is required. Both scenarios raise actual costs. Use the following metric:
Cost per successful task = (average cost per task) ÷ (task success rate)
The success rate is determined by human spot checks or automated tests. Success criteria must be defined before testing, such as whether code passes unit tests, whether answers contain all required elements, or whether the format meets downstream system requirements.
Building an Evaluation Process
- Define a task set: cover typical scenarios such as code generation, code modification, Q&A, long-text understanding, with a sample size per category.
- Control running conditions: use the same prompt templates, the same sampling parameters, and restrict context length to the same value.
- Collect metrics: record cost, latency, success rate, and human scoring.
- Calculate a weighted score: assign weights to each metric based on business priorities to avoid a single metric dominating the conclusion.
- Create a migration plan: record configuration items that need changes for switching models, and list the scope of regression testing.
Example: Calculating Cost per Successful Task
The following code demonstrates how to compare effective costs across candidate models. The sample data is fictional and used only to illustrate the calculation method; it does not represent any real model’s pricing or performance.
from dataclasses import dataclass@dataclassclass Candidate:name: strunit_price: float # unified unit price (yuan per 1,000 tokens)quota_factor: float # effective usage multiplier; 1.0 = standard, 2.0 = double usageavg_tokens: int # average token consumption per tasksuccess_rate: float # task success rate, between 0 and 1def cost_per_success(c: Candidate) -> float:raw_cost = c.unit_price * c.avg_tokens / 1000effective_cost = raw_cost / c.quota_factorreturn effective_cost / c.success_ratecandidates = [Candidate("Plan A", unit_price=1.0, quota_factor=2.0, avg_tokens=3000, success_rate=0.85),Candidate("Plan B", unit_price=1.5, quota_factor=1.0, avg_tokens=2500, success_rate=0.92),Candidate("Plan C", unit_price=0.6, quota_factor=1.0, avg_tokens=4000, success_rate=0.70),]for c in sorted(candidates, key=cost_per_success):print(f"{c.name}: cost per successful task = {cost_per_success(c):.3f} yuan")
The key point of this code is putting the discount multiplier, average consumption, and success rate into the same formula. The result reflects price, usage, and quality simultaneously. In practice, replace the data with your own real task samples and recalculate periodically.
Common Pitfalls
- Comparing only list prices and ignoring success rates and rework costs.
- Treating promotional pricing as the long-term cost.
- Judging usage based on subjective impressions without log data.
- Ignoring migration costs, such as prompt re-optimization, API adaptation, and team learning curves.
- Using experimental versions for core business, accepting unpredictable quota and stability risks.
Recommendations for Implementation
Create a model selection document that records the evaluation method, test data, and conclusions, and review it quarterly. Keep model choice decoupled from business code. By calling models through a unified gateway or adapter layer, you can switch models without modifying business logic. For critical business, set budget alerts and usage limits to prevent abnormal consumption from scaling up quickly, and to leave a complete audit trail for later cost analysis.
