How to Choose an LLM: A Practical Guide to Capabilities, Costs, and Agent Performance

    Unit price is rarely what drives a model's monthly bill—first-attempt accuracy and rework do. This article presents a practical method for choosing a large language model: start by defining acceptance criteria, read specs across four dimensions (input types, context length, output budget, and billing), then convert token prices into cost per successful task with a simple formula. It also breaks down Agent scenarios—tool calling, structured output, long-conversation context management, rate limiting, retries, observability, and security—and closes with a trial order, a six-step retest workflow, and common pitfalls, so you can turn model selection into a reproducible engineering decision instead of a guess.

    Introduction: A bigger bill doesn’t always mean more usage

    For the same kind of task—“read a file, write some code, call a tool”—one model might cost a few cents per run while another costs a few dollars, so the monthly bill can easily differ by an order of magnitude. Most people start by comparing the per-million-token price, but that unit price is rarely what determines the monthly spend. Two questions matter more: can the cheaper model get the task right on the first attempt, and can the pricier one noticeably reduce rework?

    This article covers flagship-tier and lightweight-tier model services from two or more cloud providers. These services generally support image and text understanding, million-token context, and tool calling, so at first glance they look similar. In practice, details such as context window, per-call output budget, thinking modes, and billing rules directly affect both cost and quality. Rather than relying on public leaderboard rankings or treating a spec sheet as a capability ranking, this article offers a selection method and a reusable evaluation workflow that you can validate against your own business data.

    1. Define acceptance criteria first: selection doesn’t start with price

    Before choosing, be clear about “what the business actually needs.” Break the requirement into four categories—input, output, latency, and compliance—and write each as a decidable acceptance criterion, for example:

    • Input: mostly images, or does it include video? Is a single document a few pages of PDF, or dozens of turns of conversation history?
    • Output: a summary, or a function call with a clearly defined parameter structure? What is the minimum acceptable output length?
    • Acceptance: what counts as “correct”? Are all extracted fields exactly right, does the code pass unit tests, does the toolchain run end to end?
    • Constraints: P95 latency target, daily call volume, whether data can leave the region, whether a version needs to be locked for the long term.

    Only once acceptance criteria are set does price have a basis for comparison. Vague goals like “a slightly better answer” or “smarter” are hard to translate into a budget. Clear standards like “field-level exact-match rate ≥ 95%, P95 latency ≤ 5 seconds” can be mapped to a concrete model and calling strategy.

    2. Read the specs: four dimensions shape the experience

    2.1 Input types: they decide the business entry point

    Common model services fall into roughly three input tiers: text only; text and images; and text, images, and video. For businesses centered on document parsing or code generation, the first two tiers are enough. If you need to understand video frames directly inside workflows such as customer support or monitoring, confirm up front that the target model supports video input—don’t assume that “multimodal” means “supports video.”

    Even businesses that only use text often prefer models that support image and text, to leave room for later expansion—letting the model read screenshots, design mockups, or scanned receipts. That is a reasonable forward-looking choice.

    2.2 Context length: don’t treat it like seating

    Vendors define their million-token contexts differently:

    • Some write “1,000,000 tokens”;
    • Some write “1M, with a maximum input of 960K”;
    • Some use the binary definition and write 1,048,576 tokens.

    The differences are small, but for capacity planning you can’t treat different definitions as exactly equal—reserve headroom based on the smaller value. More importantly, in some models’ total window, the input and this generation share the same budget. With a 128K context, if you load 120K of history, only about 8K is left for the answer. Upper-limit parameters must be based on the vendor’s latest official documentation; the same parameter written different ways may correspond to different versions or billing tiers.

    Also, longer context does not necessarily mean more accurate recall. The industry widely observes that when a key detail sits in the middle of a long context, the model’s ability to retrieve it can drop. So “supports long context” does not mean “remembers everything in a long context.” When testing, design dedicated “needle in a haystack” cases, placing key information at the beginning, middle, and end, and observe the recall differences.

    2.3 Output budget: thinking tokens cost money and count toward length

    Output limits in mainstream services commonly come in tiers like 64K, 128K, and 256K, but there are two easy-to-misread points.

    First, the output budget is not the final answer length. Once thinking (reasoning) mode is on, the thinking process also consumes generated tokens. In some models, the chain of thought and the answer share the same output budget, so generating a summary of a few hundred words may first consume tens of thousands of tokens of thinking.

    Second, thinking tokens usually count toward output billing. Long-chain reasoning can improve accuracy on complex tasks while multiplying output cost. So “whether to enable thinking” should be a configurable option, evaluated per task type: call directly for simple extraction tasks; enable thinking for code debugging and multi-constraint planning, and set a separate output limit for them.

    2.4 Billing rules: unit price is only the starting point

    Most mainstream LLM services bill input and output tokens separately. Check the vendor’s official price page item by item:

    • Thinking tokens usually count as output;
    • Cache hits on input usually get a discount;
    • Batch, asynchronous calls may get an additional discount.

    So cost estimation must distinguish “listed input” from “actually billed input.” Caching matters especially for scenarios with high-frequency repeated context: put the system prompt, tool descriptions, and fixed knowledge in the prefix and keep it stable, which can significantly dilute input cost. All these numbers are subject to the vendor’s current prices—don’t build a budget from unit prices in an old article.

    3. A conversion method: from “token unit price” to “cost per successful task”

    3.1 Two formulas

    First, distinguish two concepts:

    • Single-request cost: the tokens actually consumed times the corresponding unit price;
    • Cost per successful task: the single-request cost divided by the first-attempt pass rate, plus the expected cost of retries or manual rework.

    Assuming every failure is retried independently until success, the expected number of calls is about 1/p (where p is the first-attempt pass rate). So:

    1. cost per successful task ≈ single-request cost / p + rework cost per attempt × (1 - p) / p

    In batch, no-human-in-the-loop scenarios, the rework cost is close to zero, so the cost per successful task is roughly the single-request cost divided by p. As long as the pass rate is not overwhelmingly better, the cheaper model usually wins.

    Once downstream has review, correction, or compensation steps, the rework cost becomes substantial. Using the data above as an example: the light tier costs about 1.2 cents per successful task and the premium tier about 4.3 cents; if manual rework costs $0.30 per instance, the light tier’s actual cost rises to about $0.34 while the premium tier only rises to about $0.05, and the conclusion completely reverses.

    This formula also explains a common “counterintuitive” phenomenon. If a lightweight model is 80% cheaper per token than the flagship on a short 20K-token request but only 40% cheaper on a 600K-token request, the reason is that the flagship’s unit-price discount often applies only to input, while the output share also rises on long requests. Choosing a model by listed price alone easily leads to a wrong calculation in long-context scenarios.

    3.2 An illustrative cost table

    The table below uses two sets of illustrative unit prices (for demonstrating the method only, not representing any vendor’s real prices) to compare the single-request cost of the same workload under different price combinations:

    Workload Avg. input (incl. history) Avg. output (incl. thinking) Light-tier price Light-tier cost/request Flagship price Flagship cost/request
    Short Q&A, information extraction 4K 1K $0.8 / $3 ≈ $0.0062 $6 / $24 ≈ $0.048
    Long-document summarization 40K 3K $0.8 / $3 ≈ $0.041 $6 / $24 ≈ $0.312
    Code generation (with thinking) 12K 6K (5K thinking) $1.6 / $6 ≈ $0.055 $8 / $32 ≈ $0.288
    Multi-turn Agent (incl. tool returns) 80K 5K $1.6 / $6 ≈ $0.158 $8 / $32 ≈ $0.800

    (Prices are per million tokens; all values are illustrative currency figures only.)

    Two things stand out from this table:

    1. The unit-price gap is amplified on short tasks and compressed on long ones;
    2. The higher the share of thinking tokens, the larger the impact of the output unit price.

    3.3 An estimation code example

    Below is a minimal cost estimator. Give it actual token consumption and it returns single-request and cost-per-successful-task figures; you can drop it straight into a load-test script:

    1. def estimate_cost(input_tokens, output_tokens, cached_tokens=0,
    2. in_price=1.0, cached_price=0.1, out_price=4.0,
    3. thinking_tokens=0):
    4. """Estimate single-call cost from per-million-token prices.
    5. thinking_tokens are already included in output_tokens and are listed
    6. separately only to surface thinking overhead.
    7. Fill the price arguments from the vendor's current price page;
    8. the sample values do not represent any vendor's actual pricing."""
    9. billable_input = input_tokens - cached_tokens
    10. cost = (billable_input * in_price
    11. + cached_tokens * cached_price
    12. + output_tokens * out_price) / 1_000_000
    13. return cost
    14. def cost_per_success(single_cost, pass_rate, rework_cost=0.0):
    15. """pass_rate: first-attempt pass rate; rework_cost: rework or
    16. compensation cost incurred per failed attempt."""
    17. if pass_rate <= 0:
    18. raise ValueError("pass_rate must be greater than 0")
    19. return single_cost / pass_rate + rework_cost * (1 - pass_rate) / pass_rate
    20. # Illustrative: the same workload across two price tiers and different pass rates
    21. for rate in (0.9, 0.7):
    22. cheap = cost_per_success(0.0062, rate, rework_cost=0.30)
    23. premium = cost_per_success(0.048, rate, rework_cost=0.30)
    24. print(f"Pass rate {rate:.0%}: light tier ${cheap:.3f}/task, "
    25. f"flagship ${premium:.3f}/task")

    4. Agent scenarios: the real dividing line

    4.1 Tool calling and structured output

    An Agent’s core is the model deciding which tool to call, what parameters to pass, and how to keep deciding based on the returned results. Evaluation can’t stop at “can the model call a tool”; it has to land on observable metrics:

    • Parameter schema compliance rate;
    • Invalid-call rate;
    • Average number of tool rounds per task;
    • The context-growth curve across multi-round tool calls.

    Mainstream services generally support function calling or JSON output, but structuredness, the maximum number of tools, and support for parallel calls vary widely. A reliable approach is to have the model return JSON under a constrained-output mode, then validate the schema on the business side and retry with the error message attached on failure, rather than letting the model improvise freely.

    4.2 Context management for long conversations

    After dozens of rounds, an Agent’s context fills up quickly with tool returns, logs, and message history. Engineering options include:

    • Truncating and summarizing tool returns;
    • Compressing history into structured state;
    • Splitting a long workflow into subtasks, each keeping its own context.

    Don’t expect a “million-token context” to solve all your memory problems. The longer the context, the higher the per-call cost and the greater the risk of the model missing details.

    4.3 Rate limiting, timeouts, and retries

    High-frequency Agents inevitably hit rate limits. Distinguish retryable errors (rate limits, timeouts, 5xx) from non-retryable ones (parameter errors, authentication failures, content-moderation rejections), and use exponential backoff with jitter for the former, with a maximum retry count. At the same time, plan capacity against minute-level and day-level quotas to avoid clustered failures during business peaks.

    4.4 Observability and cost control

    Log the model name and version, token consumption (input/output/cache hits recorded separately), latency, the tool-call sequence, and the final result for every call, and use that to aggregate “cost per successful task” by business dimension. On the engineering side, you can put these workflows on top of general cloud capabilities: use a message queue to decouple asynchronous tasks, use object storage to keep raw materials, and use logging and monitoring/alerting to track metrics. This avoids being locked into a single model’s interface shape.

    4.5 Security and permission boundaries

    An Agent that can call tools can also perform real actions. Recommendations:

    • Design least privilege on the tool side; write operations need a second confirmation or human approval;
    • Treat external return content (web pages, documents, emails) as untrusted input to guard against prompt injection;
    • Apply content moderation and length limits to model output, to prevent abnormal output from amplifying cost.

    5. Trial order: run one task set to the end before deciding

    When facing several models at similar price points, proceed in the following order rather than ranking by spec-sheet numbers:

    1. High-frequency, structured, batch tasks (information extraction, classification, summarization): first establish a cost baseline with a lightweight model, then compare pass rates against a flagship. If the lightweight model’s first-attempt pass rate is clearly good enough, choose it directly; if the gap is concentrated in a few hard cases, consider tiered routing—use rules or a lightweight model to triage first, then escalate hard cases to a flagship.
    2. Budget-sensitive tasks that also need long output (long-form writing, report generation): prioritize models with a larger output limit. Whether the output budget is enough often decides success or failure more than the input unit price.
    3. Video or multimodal input: first filter out models that don’t support the target input type, then discuss price. If the input capability isn’t met, no other metric matters.
    4. Complex Agents: don’t guess. Run the same task set and the same acceptance criteria, compare cost per successful task, P95 latency, and tool-call compliance rate, then decide the primary model and the fallback model.

    6. Business retest method: turn the choice into regressible data

    6.1 A six-step process

    1. Build a task set: sample 50–200 cases from real production requests, covering typical, edge, and exceptional cases, with a fixed random seed for reproducibility.
    2. Define acceptance: write a pass condition for each sample, and let a test script decide whenever possible rather than relying on subjective judgment.
    3. Unify configuration: keep temperature, output limit, whether thinking is enabled, the system prompt, and tool definitions consistent, avoiding a “compare with default parameters” situation.
    4. Collect metrics: first-attempt pass rate, cost per successful task, P95 latency, tool-call compliance rate, average rounds.
    5. Canary and regression: first canary on 1%–5% of traffic, watching cost and error rate; re-run the same task set after a model version upgrade to prevent silent regressions.
    6. Lock and archive: record the model version used, call parameters, and the evaluation-script version as a comparison baseline for later model changes.

    6.2 Evaluation record

    1. # Each evaluation record should include at least the following fields
    2. scorecard = {
    3. "task_id": "sample_001",
    4. "input_tokens": 4096,
    5. "output_tokens": 512,
    6. "cached_tokens": 0,
    7. "thinking_tokens": 0,
    8. "passed": True, # Decided by the acceptance script, not manual scoring
    9. "latency_ms": 1820,
    10. "tool_calls": 0,
    11. }

    6.3 Statistical approach

    • Measure quality with first-attempt pass rate rather than average score; averages hide long-tail failures;
    • Budget with cost per successful task rather than single-call cost;
    • Describe latency with percentiles rather than averages; averages hide the P95/P99 long tail;
    • Run a significance test (e.g., a two-proportion test) on pass-rate differences, and don’t draw conclusions when the sample size is too small.

    7. Common mistakes

    • Treating context length as a quality metric: being able to fit something in isn’t the same as using it well.
    • Treating the output limit as the answer length: thinking tokens eat into the budget.
    • Looking only at the input unit price: for tasks with a high output share, the cost structure is completely different.
    • Ignoring retries and rework: a model with a high failure rate can double its actual cost.
    • Comparing with default parameters: with different temperature and output limits, results aren’t comparable.
    • Ignoring version drift: after a silent model upgrade, both quality and cost can change.

    Conclusion

    LLM selection isn’t about picking the one with the highest specs; it’s about finding the one with the lowest cost per successful task—and stable regression—under your business’s acceptance criteria. First constrain the problem with acceptance criteria, then quantify the cost with the cost formula, and finally run canary and regression on a fixed task set. That turns selection from a subjective judgment into a reproducible engineering decision.