LLM Selection for Agents: Capability and Cost Measured by Task Acceptance
This article explains how to select an LLM for production agent workflows by starting with input formats and acceptance criteria, then comparing expected task cost rather than sticker price. It covers specification-sheet caveats, thinking-token billing, tool-loop costs, a frozen test-set methodology, and common implementation pitfalls.
When enterprises connect large language models to workflows that read files, write code, and call tools, the billing differences are often striking: for the same class of task, one round may cost only a few cents while another costs several yuan. The price gap is worth examining, but two questions matter first: can the cheaper option pass acceptance in one attempt, and can the more expensive option reduce rework? Context window size and labels such as “flagship” or “lightweight” do not by themselves prove agent success rates.
Define Inputs and Acceptance Criteria Before Discussing Cost
The selection order should be reversed. First write down what the business will feed the model and what counts as done, then compare unit prices.
On the input side, distinguish at least four categories: plain text; mixed text and images; cases that require direct video understanding; and very long materials such as contract packages, logs, and repository slices. On the output side, write acceptance criteria rather than “answers professionally.” For example: are all fields present; do citations land on exact source snippets; are tool parameters executable; does the code pass the specified tests; and does the run finish within budget instead of being truncated midway?
Without acceptance criteria, a low-cost model easily looks “usable,” while a high-cost model can be convincing because of one lucky long answer. Neither result is reproducible.
The recommended trial order is based only on task shape, not brand:
- For high-frequency image-text and structured extraction, start with a lower-cost general-purpose model with acceptable latency to establish a baseline.
- For budget-sensitive tasks that must produce very long outputs in a single run—long code, long reports, multi-step plans—add candidates with a larger maximum output budget to the same test set.
- If the business must send video directly rather than first extracting frames or transcribing, filter for candidates that support that modality. If the pipeline can transcribe first and understand later, do not pay a modality premium for a video input.
- For complex agents, the final choice should be determined only by pass rate, rework count, and total cost on the same task set.
How to Read Specification Sheets
Public documentation commonly lists four columns: input types, context length, maximum output per call, and whether “thinking” and direct answer are separated. Read the definitions, not the numbers as an effectiveness ranking.
“One million tokens of context” only means how much can theoretically fit. In practice you must subtract system prompts, tool definitions, conversation history, and safety margin. Some services cap maximum input below total context, and some default output far below the remaining window. If you stuff a whole repository or an entire video into the prompt, you will often hit input-side truncation first—not a model that “cannot understand.”
Output budget determines whether a task stops halfway. Limits for non-thinking and thinking modes often differ: the thinking process itself consumes generation quota, the user-visible answer becomes shorter, and latency and cost rise. If a product shows only the final answer but still bills thinking tokens, the cost model must account for them; otherwise it will be systematically low.
Price definitions must be broken apart: input price, output price, cache-hit price, batch price, whether thinking tokens are priced the same, and whether images or videos are billed by token, second, or image. Comparing only “per million tokens” without stating the modality is meaningless.
The following illustrative numbers show the arithmetic; they are not real prices from any vendor. Suppose input is CNY 2 per million tokens and output is CNY 8 per million tokens. A round with 20,000 input tokens and 4,000 output tokens costs about 0.04 + 0.032 = CNY 0.072. If thinking generates another 20,000 tokens billed at the output price, the round costs about CNY 0.23. For an agent over ten rounds, with long history resent each round, cost accumulates close to linearly. With context caching, repeated prefixes should be recalculated at the cache price; do not multiply the first-round price by the number of rounds.
Why Does the Same “Tool Call” Cost an Order of Magnitude More?
Agents are expensive usually not because of the model name but because of the loop.
A typical round includes system prompts and tool schemas, the user goal, retrieved file snippets, model planning, one or more sets of tool parameters, tool responses, and another generation. A failed attempt is not a retry of half a sentence; the whole context is sent again. If a low-cost model needs three attempts on average to pass the test, its total cost may be higher than a high-cost model that passes once.
Therefore the unit of comparison should be “expected cost to complete one accepted task,” not the list price per call:
Expected cost ≈ (average rounds × input/output cost per round) + converted human rework time + downstream compute for failed reruns.
Human rework is often more expensive than tokens. If a code task requires an engineer to re-read the diff, the few cents saved by the model can be ignored. Conversely, batch ticket structuring that allows sampling inspection should push down unit price and latency, not pay for unnecessary long reasoning.
Tool-calling capability should be judged by whether parameters conform to the schema, whether the model hallucinates nonexistent tools, whether it can revise parameters based on error messages after failure, and whether it stops when it should. These must be retested with a fixed tool set; they cannot be inferred from a documentation line saying “supports function calling.”
Business Retest Method
Prepare a frozen test set, preferably 30–50 cases, covering the real distribution rather than demo samples. Each case includes the input, allowed tools, time limit, and an automatically judgeable acceptance script. Divide it into at least four groups: short-text structuring, long-document Q&A, image-text, and multi-step tools (read file—edit code—run tests, or query—calculate—write back). If video is not a required modality, make it a separate group so it does not drag down the rest of the comparison.
For each group, record: one-pass rate, average rounds, truncation rate, tool-parameter error rate, P95 latency, total tokens, and total cost. Keep temperature and tool definitions consistent; treat the thinking switch as a separate factor and do not change it at the same time as the model. Set the output budget to the real upper bound the task needs, to avoid artificial truncation that creates a “cheap but failed” result.
The decision rule can be fixed: if the baseline model already meets the one-pass rate target and latency is acceptable, do not switch to a more expensive model. Upgrade only when the expensive candidate reduces rework rounds enough to offset the price difference, or unlocks a modality the baseline cannot handle. Long-tail hard cases can be routed to a stronger model while high-frequency simple cases stay on the baseline; this is usually cheaper than “replace everything with the flagship.”
Cost aggregation does not need to be tied to any platform; a local table is enough:
task_id, model_tier, rounds, in_tokens, out_tokens, cache_tokens, pass, latency_ms
Keep unit-price configuration external. When changing vendors or adjusting prices, change only the configuration, not the test set. The weekly report should look at pass rate and expected cost per task, not who has the longer context.
Common Implementation Pitfalls
Treating window length as memory quality. Long contexts still lose middle details; key clauses should be sent as retrieval chunks, not stuffed in as a whole package.
Ignoring output limits. A plan may be long, the body may be truncated, downstream parsing may fail, and the cost has already occurred.
Testing production distribution with demo prompts. Sales materials, scanned documents, dialects, and very large tables are the real difficulty of image-text tasks.
Treating thinking as free quality. It improves stability on some reasoning tasks and also increases latency and bills; simple extraction often does not need it.
Looking only at first-token price. Video, batch discounts, caching, failed retries, and rate-limit queuing all change the total bill.
Specification documents are good for candidate screening: exclude those that do not support the required modality; exclude those whose output limit is below the task minimum. After screening, ranking must come from your own test set. Documentation numbers change; keep retest dates and configurations on file so stale prices do not become conclusions.
Conclusion
Model selection is an engineering problem: first lock down input forms and acceptance, then use low-cost candidates to establish a baseline, and expand the candidate set only when output budget, modality, or one-pass rate is clearly insufficient. Million-token context means “it fits,” not “it gets it right.” Price differences must be converted into the expected cost of completing a task, including rework. After running the same tools and the same test set, the model that remains is the answer for that scenario; a specification sheet cannot replace that run.
