How to Evaluate Large Language Models: Pricing, Capability, and Agent-Ready Selection Methods

    Choosing a large language model often starts with a price sheet: sort candidates by cost per million tokens and pick a winner. This approach overlooks a key fact—unit price is only one component of total cost. A cheaper model may require multiple retries, manual fixes, or produce truncated output that cannot be used directly. What matters is the total cost of completing a task, including model fees, call counts, rework time, and the overhead of recovering from failures. This article walks through how to break down token-based pricing, define acceptance criteria before comparing capabilities, estimate per-task costs, run a reproducible evaluation workflow, and account for the special considerations of agent scenarios.

    Break the Cost Down First

    The cost of a single API call usually consists of several parts: input tokens, output tokens, thinking tokens in some reasoning modes, plus possible cache read or cache write fees. Use this formula:

    cost per call = input tokens × input price + (output tokens + thinking tokens) × output price

    Vendors do not price uniformly—some bill per thousand tokens, others per million, and some apply different tiers for long-context or specific calling modes. Before comparing, convert all prices to the same unit, and record the date you verified them, since both prices and specifications change over time.

    Define Acceptance Criteria Before Comparing Capabilities

    Capability comparison should start from business needs. Answer these four questions first.

    First, what is the input? Plain text, mixed text and images, scanned documents, long videos, or multi-file archives place very different demands on a model. If the task requires understanding video frames and temporal sequences, test models with native video input. If only key frames matter, extracting frames and feeding them as images is usually cheaper, at the cost of losing temporal information.

    Second, how much fits in the context window? Window size is only an upper limit and does not guarantee quality. Some models degrade in their ability to use information located in the middle of very long inputs. Test recall of key information with real long documents instead of relying on the window number alone.

    Third, what is the output budget? The maximum tokens a model can generate in a single response determines whether a long report, a complete code block, or a large batch of structured results can be produced in one pass. In some models, when thinking mode is enabled, the chain of thought and the final answer share the same output budget. Without sufficient headroom, responses may be cut off mid-way—manifesting as incomplete JSON or code missing its ending.

    Fourth, are tool calls reliable? Function calling and structured output are now standard capabilities of most mainstream models, but whether parameter formats are strictly followed, and whether parallel tool calls succeed, requires hands-on testing. Positioning suffixes in product names reflect marketing strategy, not test results.

    A Cost Estimation Example for the Same Task

    The example below shows how to normalize different models’ unit prices and usage into “cost per 1,000 tasks” for side-by-side comparison. The prices are placeholders—replace them with verified official prices in practice.

    1. def cost_per_1k_tasks(in_tok, out_tok, think_tok, price_in, price_out, retry_rate=0.0):
    2. # price_* unit: currency / million tokens
    3. calls = 1 + retry_rate
    4. per_call = (in_tok * price_in + (out_tok + think_tok) * price_out) / 1_000_000
    5. return per_call * calls * 1000
    6. candidates = {
    7. "ModelA": dict(price_in=1.0, price_out=4.0, retry_rate=0.05),
    8. "ModelB": dict(price_in=3.0, price_out=12.0, retry_rate=0.01),
    9. }
    10. for name, p in candidates.items():
    11. cost = cost_per_1k_tasks(in_tok=6000, out_tok=800, think_tok=1500, **p)
    12. print(name, round(cost, 2))

    This code factors the retry rate into cost. A cheaper model with a noticeably higher retry rate may end up costing more overall. Human time spent on rework should also be converted into cost.

    A Layered Trial Order

    You don’t need to compare all candidates at once. A more practical approach is to layer by task type.

    For high-frequency, structured text-and-image tasks such as invoice recognition, form extraction, or chart-to-table conversion, call volume is large, so establish a cost baseline first. Pick a stable, cost-effective model as the baseline, then compare every candidate against it.

    For budget-sensitive tasks requiring large single outputs, such as long-form summarization or bulk rewriting, treat output budget as the primary filter. Confirm each candidate’s maximum output can cover the longest result your business needs before comparing prices.

    For tasks involving direct video input, such as meeting recording analysis or surveillance clip review, test native video input first and compare it against a frame-extraction-plus-text approach. Measure the gap in accuracy, latency, and cost between the two approaches using the same set of videos.

    For complex agent tasks, run the full workflow—the final selection should be decided by its results.

    Build a Reproducible Evaluation Process

    The core of evaluation is controlling variables. Keep the following fixed: system prompt, sampling parameters such as temperature, max output length, tool definition schemas, retry policy, and timeout settings.

    The evaluation set should be sampled from real business data, covering common cases, edge cases, long documents, and known hard cases. Ideally, each sample includes a ground-truth answer or validation rule that can be checked automatically.

    Recommended metrics include:

    • First-pass rate: proportion of outputs usable directly without manual editing
    • Tool call success rate: proportion of calls with valid parameters and correct results
    • Average interaction rounds: number of model interactions per task
    • Distribution of input, output, and thinking tokens
    • Latency median and P95
    • Failure types: truncation, format errors, hallucinations, refusals, timeouts

    Here is a minimal evaluation skeleton:

    1. def run_eval(model_fn, dataset, validator):
    2. results = []
    3. for case in dataset:
    4. out = model_fn(case["prompt"], max_tokens=4096, temperature=0)
    5. ok, reason = validator(out, case)
    6. results.append({"id": case["id"], "ok": ok, "reason": reason})
    7. pass_rate = sum(r["ok"] for r in results) / len(results)
    8. return pass_rate, results

    Setting temperature to 0 reduces random variation but does not guarantee fully deterministic results. Run multiple rounds and use statistical aggregates for more reliable conclusions.

    Special Considerations for Agent Scenarios

    Agents differ from single-turn Q&A. Each round carries prior conversation, tool outputs, and intermediate results into the context, so cost grows with the number of rounds—often non-linearly. Therefore:

    • Truncate or summarize long tool returns, keeping only fields relevant to the decision;
    • Periodically compress conversation history into state summaries;
    • Set a maximum round count and timeout to prevent the workflow from looping;
    • Cache results of repeated tool calls.

    On security: web content, file contents, and email bodies returned by tools are all untrusted input, and may contain instructions attempting to alter agent behavior. Engineering practice should treat these as untrusted data and design appropriate defenses.