LLM Selection in Practice: Pricing, Capabilities, and Agent Use Cases

    Choosing the right large language model for AI agents is less about leaderboard rankings and more about measurable task outcomes. This article presents a four-dimension selection framework covering input modalities, context windows, output budgets, and billing, then explains how to convert per-token pricing into cost per completed task. It also outlines a scenario-based trial order and a practical A/B retest method with sample metrics, plus a tiered routing strategy for balancing cost and quality. Readers will learn how to use real business retest data, rather than spec sheets or model name suffixes, as the basis for model selection.

    1. The Problem: Same Task, Two Orders of Magnitude in Cost

    When building agent applications, teams often run into an awkward situation: the same workflow of reading documents, generating code, and calling external tools can cost only a few cents per turn with one model and several dollars with another. The difference is not mysterious. It usually comes from three stacked factors: input length, output length, and whether an explicit reasoning (thinking) process is triggered.

    So the first principle of selection is not to look at leaderboards, but to break the problem into two measurable sub-questions:

    1. Can a cheaper model pass on the first try, meaning does the first output meet the acceptance criteria?
    2. Can a more expensive model reduce rework, meaning does it lower the number of correction rounds and human interventions?

    If the gains from a higher first-pass rate outweigh the higher unit price, the expensive model is actually more economical. Conversely, for structured, enumerable, fault-tolerant tasks, a low-cost model is often the better choice.

    2. A Four-Dimension Selection Framework

    2.1 Input Modalities: First Confirm What It Can Read

    Multimodal capability is a hard gate. If the business only needs to handle text and images, the options are broad; if it needs to understand video directly, the field narrows noticeably. The engineering advice is to use input type as the first filter, eliminate candidates that do not qualify, and only then move on to further comparison, so you avoid fine-tuning on the wrong candidate set.

    2.2 Context Window: Million-Level Does Not Mean “Unlimited”

    Most mainstream models now offer million-level context, but three differences matter:

    • Units are not stated consistently; some use K or M, others give exact token counts, and these cannot be treated as equivalent.
    • The maximum input length may be smaller than the advertised context, so you need to reserve room for output.
    • Long context brings attention dilution and higher cost, so retrieval augmentation is often more cost-effective than stuffing everything in.

    2.3 Output Budget: It Determines Success on Long-Form Tasks

    The single-response output limit is an underrated key metric. When generating complete code files, long reports, or large structured JSON, an insufficient output budget causes truncation, which leads to parse failures and retries, and cost spikes instead. A practical rule of thumb: the output budget should cover at least your P95 output length, with 20% headroom.

    2.4 Billing: Convert “Unit Price” into “Cost per Task”

    When comparing prices, normalize everything to the cost of completing one business task. The formula can be abstracted as:

    1. cost per task ≈ input tokens × input price
    2. + output tokens × output price
    3. + retries × cost per turn
    4. + human correction cost

    Retries and human correction cost are often ignored, yet they are usually the main variables in total cost.

    3. Scenario-Based Trial Order

    • High-frequency text and image plus structured extraction: start with a lightweight, low-latency, low-cost model to establish a cost baseline, then evaluate whether an upgrade is needed once it works end to end.
    • Budget-sensitive with a large generation budget: bring in candidates with a more generous output budget to reduce truncation retries.
    • Direct video input: prioritize candidates that support video understanding, and confirm frame extraction strategy and duration limits.
    • Complex agent orchestration: do not judge by naming suffixes; you must run an A/B retest with the same task set.

    It is worth stressing that suffixes like “Max,” “Flash,” and “Pro” in model names, as well as context length, do not directly prove agent success rates. Tool-calling stability, instruction following, and long-workflow memory retention can only be obtained through hands-on testing.

    4. A Practical Business Retest Method

    Step one: build 30 to 50 real task samples covering normal, boundary, and abnormal inputs. Step two: fix the prompts, temperature, and tool set, changing only the model. Step three: record four metrics: first-pass rate, average rounds, cost per task, and P95 latency. Step four: use the same scoring script for automatic acceptance to avoid interference from human preference.

    1. # Example: a unified retest record structure
    2. result = {
    3. "model": "candidate_a",
    4. "pass_first_try": True,
    5. "rounds": 2,
    6. "input_tokens": 18500,
    7. "output_tokens": 4200,
    8. "latency_p95_ms": 6800,
    9. "cost_per_task": 0.031,
    10. }

    5. Balancing Cost and Quality

    The recommended approach is tiered routing: simple requests go to a lightweight model, complex requests escalate to a higher-capability model. At the same time, enable prompt caching, result caching, and batching to compress repeated input overhead. On the engineering side, you can also segment and summarize long documents first, then hand them to the model for reasoning, reducing both input length and latency.

    6. Conclusion

    Selection is not a one-time decision but a process of continuous calibration. It is recommended to rerun the baseline with real traffic once a quarter, downgrading the spec sheet to a reference and upgrading business retest data to the basis for decisions. If an organization already uses relevant general capabilities from Baidu AI Cloud (such as object storage, log service, and monitoring and alerting), it can turn retest results into an observable dashboard, keeping cost, latency, and pass rate aligned in a single view.