LLM Model Selection: Evaluating Quality, Cost, Latency, and Routing
Learn how to build a repeatable LLM selection process using task-specific acceptance criteria, normalized costs, and quality thresholds. This guide covers evaluation methods for document extraction, code generation, and research, along with safeguards for automatic model routing.
1. Model Selection Is Now an Engineering Problem
When teams first adopted large language models, they typically used only one or two models and chose between them based on experience or reputation. As more models become available, selection becomes an engineering decision that requires measurable evidence. Models differ in reasoning ability, format compliance, context length, cost per call, and response latency.
Sending every task to the most capable model can quickly increase costs, even when simpler tasks do not need that level of capability. Sending everything to the cheapest model can leave complex tasks below acceptable quality levels.
A more practical approach is to divide work into task categories, define a quality floor and a cost ceiling for each category, and select a model that meets those requirements. This process should become a repeatable evaluation workflow rather than a one-time comparison.
2. Normalize Billing Before Comparing Costs
Model services often use different billing methods. Common approaches include charging for input and output tokens, charging per request, and deducting credits from a pool using model-specific multipliers. Comparing invoice totals directly is not useful: the same task can produce substantially different charges under different billing methods.
Before comparing models, establish a consistent basis using three metrics:
- Resource consumption per task: The total credits or tokens required to complete one full task, including input, model output, and context generated during tool use.
- Cost per accepted task: The total cost of all attempts divided by the number of tasks that pass acceptance checks. Failed attempts still consume resources and must be included.
- Combined cost: Model usage charges plus human review time converted to a monetary cost using an hourly rate. In workflows that require human review, such as finance and legal work, review costs can exceed model charges.
For example, a model may have a low cost per call but pass acceptance checks only 60% of the time. Its average cost per accepted task must account for all calls and rework, divided by the number of accepted tasks. Looking only at the listed unit price can lead to the wrong decision.
3. Break Down Tasks and Design Evaluation Benchmarks
Before evaluating models, break business requirements into subtasks with explicit acceptance criteria. The following three scenarios illustrate this approach.
3.1 Structured Information Extraction from Financial Reports
This task typically has two parts: answering specific questions from long documents while keeping summaries within a length limit, and organizing key metrics into structured tables with source page references.
Acceptance criteria should be specific and verifiable:
- Summaries stay within the specified word limit.
- Every conclusion can be traced to a corresponding passage in the source.
- Table values match the source individually, and year-over-year changes use a consistent formula.
- Page references are correct, with no fabricated page numbers.
- Information absent from the report is marked as “not disclosed” rather than filled in through inference.
Prepare a sample document with reference answers, including annotated values, page numbers, and conclusions. After each run, use scripts to compare table values and have reviewers spot-check the written conclusions. Numeric comparisons are deterministic and should be automated wherever possible; the accuracy of written conclusions requires human judgment.
3.2 Generating a Usable Expense Reimbursement Tool
For code generation, correctness and maintainability are central acceptance criteria. An expense reimbursement tool may involve monetary calculations, tax rates, date validation, and approval rules. Errors in any of these areas can create financial discrepancies.
Acceptance checks can include:
- Monetary calculations use integer minor units, such as cents, or fixed-point decimals to avoid floating-point errors.
- The tool provides a clear warning when an expense date falls outside the submission window.
- Duplicate submissions of the same receipt are detected and blocked.
- Invalid input produces readable error messages rather than abruptly terminating the program.
- Tests cover edge cases and pass successfully.
Evaluate generated code at three levels: whether it compiles or runs, whether it passes a predefined test suite, and whether its structure and readability meet human review standards. The first two levels are suitable for automation; the third requires an experienced developer.
3.3 Web Research and Executive Briefings
Research tasks depend on timely information and reliable sources. Briefings should meet the following requirements:
- Every key fact includes a source link or citation.
- Factual statements, data-derived conclusions, and the author’s judgments are clearly distinguished.
- Conflicting sources are identified rather than resolved through arbitrary selection.
- An information cutoff date is included so readers can assess whether the briefing is outdated.
Evaluate these tasks by checking a sample of factual claims, measuring the proportion of incorrect statements, and verifying that cited sources exist and are accessible.
4. Evaluate Quality, Latency, and Cost Together
After defining the tasks, record the results of every run in a consistent dataset. Recommended fields include model identifier, task type, input and output token counts, pricing version, acceptance status, human review duration, and end-to-end elapsed time.
The following pseudocode illustrates the cost calculation. Pricing fields are placeholders and must be populated with the official rates applicable at the time of evaluation.
structure RunRecord:model_idinput_tokensoutput_tokensprice_per_1000_input_tokens // Placeholder; use current official pricingprice_per_1000_output_tokens // Placeholder; use current official pricingpassed_acceptancereview_minutesfunction run_cost(run, hourly_review_rate):model_cost = run.input_tokens / 1000* run.price_per_1000_input_tokens+ run.output_tokens / 1000* run.price_per_1000_output_tokensreview_cost = run.review_minutes / 60 * hourly_review_ratereturn model_cost + review_costfunction cost_per_accepted_task(runs, hourly_review_rate):accepted_runs = filter runs where passed_acceptance is trueif accepted_runs is empty:return infinitytotal_cost = sum run_cost(run, hourly_review_rate) for each run in runsreturn total_cost / count(accepted_runs)
Use integer minor units or fixed-point decimals for monetary calculations. This pseudocode expresses only the calculation logic; an implementation must use an appropriate numeric type for its programming language.
5. Select Models Using a Quality Floor
Once evaluation data is available, select models by task category. First filter out candidates that do not meet the quality floor, then choose the model with the lowest combined cost among those that qualify.
function select_model(task_type, candidates, quality_floor):qualified = empty listfor each candidate in candidates:if candidate.quality_score[task_type] >= quality_floor:add candidate to qualifiedif qualified is empty:return null // No qualifying model; use human handling or a fallbackreturn the candidate in qualified with the lowest unit_cost
Quality scores should come from the evaluation process described above, not from vendor claims. Unit costs must use the same normalized billing basis.
Set quality floors according to business risk. Financial data extraction should have a higher threshold than internal brainstorming.
6. Automatic Routing: Design and Risks
Many teams extend model selection into automatic routing, allowing the system to choose a model based on task characteristics. A common approach uses rules or a lightweight classifier to estimate task difficulty and route the task accordingly. This reduces manual switching, but introduces additional risks.
First, difficulty classification can be wrong. Routing a simple task to a more capable model wastes money. Routing a complex task to a less capable model can produce incorrect results that are difficult to detect.
Second, automatic routing can make results harder to reproduce. The same input may be sent to different models at different times. Log routing decisions, including input features, the selected model, and the reason for selection, to support later audits.
Use conservative safeguards:
- For tasks involving money, compliance, or external publication, use a fixed model by default rather than switching automatically.
- Set a sampling rate for reviewing automatically routed results and regularly compare them with human results.
- Define a fallback path for every routing rule. If a model call fails, switch to an alternative and log the reason.
- Rerun the evaluation suite whenever candidate models or prices change.
7. Implementation Checklist
Before introducing a multi-model workflow, confirm the following:
- Tasks are divided by business category, and each category has explicit acceptance criteria.
- The evaluation dataset includes reference answers and supports automated comparisons.
- Cost calculations include failed calls and human review time.
- Quality floors reflect business risk rather than arbitrary preferences.
- Automatic routing includes logging, sampled review, and fallback mechanisms.
- Pricing and candidate model lists are versioned for traceability.
- Tasks involving sensitive data have defined data-processing boundaries and access permissions.
8. Conclusion
A multi-model environment offers more options, but also makes selection more complex. A reliable process breaks work into well-defined tasks, measures costs on a consistent basis, evaluates quality through checks that can be automated where appropriate, and sets quality floors and cost ceilings according to business risk.
Automatic routing can improve efficiency, but it needs logging, sampled review, and fallback mechanisms. With these foundations, teams gain more than a lower-cost model list: they gain a repeatable selection method that remains useful as model versions and prices change.
