How to Choose a Large Language Model: From Pricing to Agent Retesting

    This article walks through a practical framework for selecting a large language model, covering how to define inputs and acceptance criteria, how to calculate effective unit cost including retry and failure penalties, how to break down billing details such as output pricing, reasoning tokens, caching, and tiered long-context pricing, and how to benchmark multimodal understanding, tool calling, and long-context capabilities with real samples.

    1. Define Inputs and Acceptance Criteria First, Then Look at Parameters and Price

    Most flagship models today support mixed image-text input, very long context windows, and tool calling. A similar capability checklist does not mean similar performance in your business. Many teams start by looking at leaderboards or spec sheets and end up with one of two problems: high-parameter models that require constant rework, or cheap models with low pass rates.

    A better approach follows four steps.

    1. Clarify input types. Is your business input pure text, mixed image and text, or does it require direct understanding of video or audio? Visual encoding and video frame sampling strategies vary significantly across models, so input type determines which models qualify as candidates.
    2. Define acceptance criteria. Criteria must be quantifiable. For example, code generation can require successful compilation plus unit test coverage above a preset threshold; document parsing can require key-field error below a preset tolerance; Agent tasks can require tool-call success rate above a preset floor. The figures used in this article—90%, 5%, 95%—are example thresholds only and should be calibrated against your own business risk.
    3. Validate with a small sample. Draw 100 to 200 samples from real business data. Each sample should include the input, the expected output, and penalty indicators such as safety violations, format errors, or code that fails to compile.
    4. Calculate effective unit cost. This is the actual cost of producing one acceptable output, not the listed price per million tokens.

    The simplified formula is:

    Effective unit cost = price per call ÷ first-pass rate

    Failed calls need retries, and the expected number of calls equals 1 divided by the pass rate, so this formula folds retry costs into the total.

    For example: Model A costs 0.02 yuan per call with a 60% pass rate; Model B costs 0.08 yuan per call with a 95% pass rate. Using the simplified formula, A comes to about 0.033 yuan and B to about 0.084 yuan—A is cheaper.

    But failure may cost more than one extra call. Suppose each failure requires manual review costing 0.5 yuan. Adding a failure penalty, the formula becomes:

    (price per call + failure rate × loss per failure) ÷ pass rate

    For A: (0.02 + 0.4 × 0.5) ÷ 0.6 ≈ 0.367 yuan. For B: (0.08 + 0.05 × 0.5) ÷ 0.95 ≈ 0.111 yuan. Now B is the better deal. The conclusion changes with the assumptions, so failure losses must be estimated from real data.

    2. How to Break Down the Billing Model

    All amounts in this article are in yuan per million tokens. Vendors differ widely in how they list prices, and the following items are the easiest to overlook.

    • Separate input and output pricing. Some models charge several times more for output than for input. Agent tasks that generate code or long documents may spend most of their budget on output, so estimates should use your actual input/output ratio, not just the input price.
    • Whether reasoning tokens are billed. With deep thinking enabled, models generate large volumes of reasoning tokens. Vendors handle this differently—some bill them separately, others bundle them into a fixed fee. Check the vendor’s official billing documentation before choosing, and run one long reasoning task to see the real bill.
    • Caching and batch discounts. Fixed prefixes such as system prompts and role definitions can use context caching, with discount levels varying by vendor. This benefit only applies when your workload has a “long fixed prefix plus short variable suffix” shape; otherwise you won’t see savings.
    • Tiered long-context pricing. Some models raise the unit price beyond a certain context length; check the official pricing page for exact thresholds. Test long-document Q&A, codebase analysis, and other key tasks with real text over 64K tokens, and record both output quality and billing changes.

    Here is a typical Agent request as an example. It includes a system prompt, tool descriptions, conversation history, and the current question: 5,000 input tokens, 800 output tokens, plus 2,000 reasoning tokens with deep thinking enabled. Assume input costs 2 yuan per million tokens, output costs 8 yuan per million tokens, and reasoning tokens are billed at the output rate:

    • Input cost: 5,000 × 2 ÷ 1,000,000 = 0.010 yuan
    • Output cost: 800 × 8 ÷ 1,000,000 = 0.0064 yuan
    • Reasoning cost: 2,000 × 8 ÷ 1,000,000 = 0.016 yuan
    • Total: 0.0324 yuan

    In this example, reasoning tokens cost more than the output itself. Reasoning costs must be measured empirically, not estimated from experience.

    3. How to Test Image-Text, Video, Tool Calling, and Long Context

    Vendors market these four capabilities in broad terms, so each needs its own test with a fixed sample set. For every test, record the sample type, the judging method, and the key fields.

    Image-text understanding. Samples should include formulas, tables, handwritten text, and low-resolution screenshots. Fields to record: image ID, question type, reference answer, model output, correctness, and whether the answer referenced the specific region of the image. Key-information extraction accuracy must meet your business threshold. If the model relies on OCR post-processing, complex charts and handwritten content typically fail more often and should be reported separately.

    Video understanding. Use instructional videos of roughly 20 seconds, for example asking about a person’s action appearing at the third second. Record the frame sampling rate, resolution, and number of frames sent to the model—these three factors directly affect both results and token consumption. Fields to record: video ID, sampling parameters, question, reference answer, model response, and whether the answer…