LLM Model Selection After Price Changes: Building a Cost-Performance Framework
When model prices change, the cost ranking shifts, but the basic method for choosing a model does not. This article explains how to define cost-performance as the total cost per valid result, break down token-based billing, choose between reasoning and fast modes, build an evaluation set from your own data, and route requests by difficulty to control spending.
1. Price Changes Require Recalibrating Selection Criteria
When model service prices change, many teams first compare the listed unit prices. But the unit price is only one part of the cost. The actual cost of a request also depends on input length, output length, whether reasoning is enabled, the number of retries after failures, and whether the result needs manual correction. For this reason, cost-performance should be defined as the total cost per valid result, while meeting the quality requirements of the business.
This definition includes three factors:
- Quality: whether the result is accurate, whether the format is compliant, and whether it can go directly into downstream processes;
- Cost: the cost of each call and the monthly spend, calculated according to the billing rules;
- Latency: how long a user or system waits for the result.
These three factors constrain each other. Simply chasing the lowest unit price may reduce accuracy, which increases the cost of manual review. Simply chasing the highest quality may cause many simple requests to pay unnecessary fees.
2. Break Down the Billing Structure First
Most large model services bill by token. A token is the basic unit a model uses to process text. The ratio between Chinese and English text depends on the tokenizer. Common billing items include:
- Input tokens: prompts, context, conversation history, and text fragments retrieved for the request;
- Output tokens: all text generated by the model;
- Reasoning tokens (when the service supports and charges for them): the internal computation the model performs before it gives an answer;
- Cache or reuse fees (when the service provides them).
You can estimate the cost of a single call with this formula:
Cost per call = input tokens × input price + output tokens × output price + reasoning tokens × reasoning price
Use the prices published by the service provider as the authoritative source. When estimating, keep in mind that in long-context scenarios, input tokens usually account for most of the cost. Trimming the system prompt and retrieving only the fragments relevant to the question often reduces costs more than switching models does.
3. Trade-offs Between Reasoning Mode and Fast Mode
Models with reasoning enabled usually perform better on complex tasks, such as multi-step math derivations, locating code defects, and logical judgments across documents. The cost is more output tokens and longer response times.
Fast mode is better suited to tasks with clear structure, such as:
- Text classification and sentiment labeling;
- Field extraction and format conversion;
- Short text summarization and title generation;
- Question answering based on fixed templates.
Choose a mode based on how much reasoning depth the task actually needs, not on the model name or marketing claims. A practical approach is to first run the full workflow in fast mode, then send only the failed samples to reasoning mode. This shows whether the quality gain justifies the added cost.
4. Build Your Own Evaluation Set
Public leaderboards indicate the general range of a model’s capabilities, but they cannot replace testing on your own business data. We recommend building an evaluation set with the following steps:
- Extract 200 to 500 samples from real business logs, covering high-frequency scenarios and edge cases;
- Define a standard answer or scoring rule for each sample;
- Group the samples by task type, and calculate accuracy, format compliance rate, average latency, and cost per sample for each group;
- Run the same batch of samples across different models and modes, and record the results.
Example code (structural illustration; replace the model call function with the SDK you actually use):
from dataclasses import dataclass@dataclassclass EvalResult:accuracy: floatformat_pass_rate: floatavg_latency_ms: floatavg_cost: floatdef evaluate(model_name, samples, call_model, check_answer, estimate_cost):correct, format_ok = 0, 0latency_total, cost_total = 0.0, 0.0for sample in samples:resp = call_model(model_name, sample["prompt"])if check_answer(resp.text, sample["expected"]):correct += 1if resp.is_valid_format:format_ok += 1latency_total += resp.latency_mscost_total += estimate_cost(resp.input_tokens, resp.output_tokens)n = len(samples)return EvalResult(accuracy=correct / n,format_pass_rate=format_ok / n,avg_latency_ms=latency_total / n,avg_cost=cost_total / n,)
The check_answer scoring function should be automated as much as possible. For open-ended outputs, you can add manual spot checks and record the agreement between different reviewers, so that the evaluation conclusions do not depend on one person’s subjective judgment.
5. Use a Cost-Quality Curve to Guide Selection
Plot the evaluation results as a scatter chart, with cost per sample on the horizontal axis and accuracy on the vertical axis. Prioritize options in the upper left, where cost is low and quality is high. If two options have similar quality, choose the one with lower latency and a more stable interface.
Most businesses do not need every request to use the same model. Tiered routing is a common engineering approach. First, lightweight rules estimate the difficulty of each request. Simple requests go to fast mode, and complex requests are escalated to reasoning mode.
def route(request):if request.task_type in ("classify", "extract"):return "model-fast"if request.estimated_tokens > 8000 or request.needs_multi_step:return "model-reasoning"return "model-default"
Routing rules also need to be validated with the evaluation set. If the difficulty estimate is wrong, sending simple requests to reasoning mode wastes money, and sending complex requests to fast mode lowers quality.
6. Engineering Considerations for Deployment
- Timeouts and retries: Set a timeout for each call, use exponential backoff for temporary errors, and limit the maximum number of retries to prevent costs from getting out of control.
- Key management: Inject API keys through environment variables or a key management service. Do not write them into code repositories or logs.
- Log redaction: When logging requests and responses, remove sensitive fields such as phone numbers and national ID numbers.
- Usage monitoring: Use logging and monitoring alerts to set thresholds for daily call volume and spending.
- Version regression: When the service provider updates a model version, rerun the evaluation set to confirm that key metrics have not declined.
If your team uses the large model services provided by Baidu AI Cloud, you can check the current billing rules, call quotas, and call logs in the console. Combine these with the methods above to build an internal evaluation process.
7. Summary
Price changes alter short-term cost rankings, but they do not change the basic method for choosing a model. A reliable approach is to define clear quality standards, break down the billing structure, complete evaluations with your own data, and then use tiered routing to keep costs within a reasonable range. Use the checklist below for team reviews:
- Have you defined the cost per valid result?
- Have you measured the share of input, output, and reasoning tokens?
- Have you set a default mode for each task type?
- Have you built a repeatable evaluation set?
- Have you monitored spending thresholds and model version changes?
