How to Build a Reproducible LLM Selection Process
When flagship models ship in quick succession, teams often default to whatever is newest, has the longest context, or claims the lead. This article treats model selection as an engineering decision: fix the tasks, grading rules, and cost definitions first, then compare models on expected cost per strict success, inference effort, and task-based routing.
When flagship releases come in a dense wave, teams easily treat “newest,” “longest context,” or “officially leading” as the default route. A more reliable approach is to treat selection as an engineering decision: define the tasks, the grading rules, and the cost basis first, then compare models. Capability gaps are often smaller than the marketing language suggests, while the shape of the bill can be completely different. The sections below cover the evaluation protocol, cost, inference effort, routing, and production checks.
Compare the same workload
Comparisons must run on the same workload, not side-by-side launch summaries. Split the load into four classes and sample each one separately instead of replacing them with a single score:
- Multi-stage coding: clarify requirements, edit code, run checks, and revise from failure messages. Strict pass means every checkpoint passes, not that the result “looks like it runs.”
- Knowledge work: long-document summarization, table extraction, and citation alignment. Judge whether facts can be traced back, not whether the prose is fluent.
- Multimodal understanding: whether images, audio, video, and layout-heavy documents actually enter the context, or whether the model only describes them at filename level.
- Agent loops: tool-call count, recovery after failure, and whether the loop spins with no new information.
The time window belongs in the evaluation notes. If the team is still on a default model and default inference tier from several weeks ago, resample instead of reusing the old conclusion. The sample set needs fixed items, fixed checkpoints, and a fixed retry cap. Otherwise “which model is better” cannot be reproduced.
List price is only one layer of the bill
Public pricing is usually quoted per million tokens, with separate input and output rates. Some vendors also add a fast tier, a batch tier, or a long-context surcharge. During selection, look at all of the following at once, not only “price per million tokens”:
- Input volume: whether the system prompt, tool instructions, conversation history, and retrieved passages are resent in full on every call.
- Output volume: whether reasoning is billed separately, and whether the final answer is verbose.
- Call count: failed retries, self-reflection, and multi-candidate voting multiply usage.
- Cache and batching: whether repeated prefixes hit a cache, and whether offline work can use a lower priority.
A several-fold gap in input price between two flagships describes unit price only. It does not describe what one successful business task costs. Short Q&A may favor the cheaper-input model. With long context and many tool round trips, output and retries dominate. If a price is marked as about to change, record the pricing date in the report so a promotional window is not treated as steady-state cost.
Use cost per successful attempt as the primary metric
Define the primary metric as the expected spend to finish one strictly graded item within a fixed retry cap. A schematic calculation:
cost_per_attempt = input_tokens * input_price + output_tokens * output_price + extrasexpected_success_cost = cost_per_attempt * average_attempts / strict_pass_rate
Extras include inference-tier surcharges, tool calls, and human review. Pass rate must use the same checkpoints. Do not mix “partially correct” and “fully passed” in one score. Partial credit is useful for diagnosis, not as a launch gate.
A common contrast in practice: on the same multi-stage set, frontier models cluster in a narrow strict-pass band and differ by only a few checkpoints, while the cost of one successful task can differ by several times. Paying a premium to stay at the top of a leaderboard then often returns less than sending failures to a human or switching to a cheaper path. The report should show pass counts, cost, and cost variance together, so one or two oversized outputs do not skew the decision.
More inference effort is not a monotonic gain
Many services split inference into tiers. Higher tiers think longer and raise latency and cost. The intuition is that a higher tier always raises the pass rate. Measurement does not always agree. Longer reasoning creates three kinds of loss:
- Output inflation: the same fix is restated repeatedly, and the bill rises.
- Rewriting a solution that was already good enough, which introduces new errors and fails strict checkpoints.
- Longer latency: online timeouts trigger retries, which means paying again.
Each task family needs a small tier scan: at least low, medium, and high. Record pass count, cost, and latency percentiles. If a higher tier does not increase passes, lock that task to the lower tier instead of turning the highest tier on globally. Offline batch work can tolerate higher latency. For online interaction, put latency in the constraint and compare cost only inside that constraint.
Route by task, not by vendor slogans
Write routing rules as a testable policy, not an oral agreement. One workable layering:
- The default path uses a lower-cost model that meets the latency budget, covering format conversion, classification, and short summaries.
- Paths with a clearly higher strict pass rate and an acceptable success cost are reserved for multi-stage coding and critical extraction.
- The highest inference tier is enabled only for failed samples or high-value samples, with a call cap.
- Long-context or multimodal paths are used only when context exceeds the everyday window, or when layout and audio or video must be understood together.
- After consecutive failures hit a threshold, stop automatic retries and hand off to a human or a rules engine so the loop does not burn money.
The pseudocode expresses control flow only and is not tied to any vendor API:
function route(task):if task.type in {format, classify, short_summary}:return model_low_cost, effort_lowif task.needs_multimodal or task.tokens > daily_limit:return model_long_context, effort_mediumif task.value == high and task.attempts == 0:return model_quality, effort_mediumif task.attempts >= 1 and task.value == high:return model_quality, effort_highif task.attempts >= max_attempts:return human_reviewreturn model_low_cost, effort_medium
After launch, replay real traffic. Do not rely only on the small sample from the announcement. When the item distribution changes, the best route changes with it.
An evaluation report should at least record these fields
- Item source, whether items may have leaked into training data, and whether checkpoints can run automatically.
- Model version, inference tier, temperature, maximum output, and retry count.
- Pricing date, input and output unit prices, and whether cache hits are included.
- Strict pass count, average attempts, cost per successful attempt, and P95 latency.
- Failure type: misunderstanding, missed checkpoint, regression of existing behavior, timeout, or refusal.
A “measured comparison” without these fields cannot support a purchasing decision. Official claims of relative cost reduction are hypotheses only. Re-test them with this team’s prompts and tool chain.
Tie observation to the budget in production
Call logs should record task type, model tier, tokens, cost, whether the item strictly passed, and the failure reason. Those logs can go into the logging service, with cost and pass rate wired into monitoring alerts: falling success rate, success cost over budget, or an abnormal retry ratio. If compute and storage are already on Baidu AI Cloud, keep using the existing monitoring, alerting, and logging services. Do not add an unauditable spreadsheet just for model selection.
Set two budget gates at once: a daily spend cap, and a maximum number of attempts per task. A spend cap alone lets a low-pass model exhaust the budget in retries. An attempt cap alone still lets a high unit-price model spend most of the budget in very few calls.
Conclusion
Re-evaluating the default model is necessary, but the conclusion should not be “switch to the latest flagship.” Fix the multi-stage tasks and the strict grading first, then compute success cost including inference tier and retries, and finally route by task type. When capability is close, prefer the more predictable bill. Raise the inference tier only when a small sample shows a real gain. Selection then stays reproducible and reversible, and it is not pulled along by short-term marketing language.
