LLM Selection Guide: Pricing, Capabilities, and Agent Practices

    This guide presents a vendor-neutral framework for evaluating large language models based on four core dimensions: context window, input modalities, output budget, and billing logic. It explains why benchmark scores and per-token prices alone are unreliable, outlines a step-by-step selection process for AI Agent scenarios, and highlights common misconceptions along with engineering recommendations for building observable, replaceable model integrations.

    1. The Selection Dilemma: Why Benchmarks and Unit Prices Fall Short

    In real engineering projects, teams often receive vague requirements from users, such as inconsistent abbreviations for a model’s name, or a selection process that focuses only on the price per thousand tokens. The problem with this approach is that model capability is a multi-dimensional vector, while price is just a scalar. What truly determines a system’s success is how well the capability dimensions match the business scenario, and whether the output budget and context management strategy are compatible with the Agent’s loop structure.

    Therefore, this article does not recommend any specific vendor product. Instead, it abstracts a general evaluation framework that helps developers make rational decisions when facing any candidate model.

    2. Four Core Evaluation Dimensions

    2.1 Context Window: Nominal Value vs. Usable Value

    Context length is the most easily misread metric. In engineering, you must distinguish three concepts:

    • Nominal context: the maximum number of tokens claimed in the documentation;
    • Maximum input length: the upper limit of input allowed in a single request, usually smaller than the nominal value;
    • Remaining usable context: the actual headroom after deducting the system prompt, conversation history, and tool return results.

    Vendors do not use a consistent notation for K (thousand) and M (million), and 1M is not strictly equal to 1,048,576 under different conventions. During selection, treat the maximum input length as a hard constraint and reserve a 10%–20% safety margin to avoid truncation failures in long-document scenarios.

    2.2 Input Modalities: The Engineering Cost of Text, Images, and Video

    Multimodal input may seem like simply supporting one more type, but it significantly changes the cost structure. Images and videos often convert into a large number of tokens after encoding, and a short video clip can consume tens of thousands of tokens of budget. If your Agent only needs to process screenshots or scanned documents, a mid-tier model with image and text input support is sufficient. If you must parse long videos, focus on evaluating the model’s token conversion rules for video frame sampling, and perform preprocessing and downsampling in the architecture.

    2.3 Output Budget: A Key Constraint for Long Agent Chains

    The single-response output limit directly determines whether an Agent can produce a complete code file or long structured result in one pass. Common tiers range from 64K to 380,000 tokens, a huge difference. Key points include:

    • The output limit in thinking mode and non-thinking mode may differ, and the reasoning chain consumes output budget;
    • Some models dynamically limit the default output value based on the remaining context, so the “declared maximum” may not be fully available every time;
    • Structured output (such as JSON Schema constraints) usually saves more tokens than free text, but relies more on the model’s ability to follow the format.

    2.4 Billing Logic: A Three-Part Structure of Input, Output, and Cache

    General billing typically consists of input tokens, output tokens, and cache hits, with the output unit price generally higher than the input. In Agent scenarios, multiple rounds of tool calls repeatedly carry the same prefix, so whether prefix caching is supported and how the cache discount is calculated often affects total cost more than the unit price itself.

    3. A Selection Method for Agent Scenarios

    A typical Agent loop is “plan—call tools—observe results—replan.” It places three requirements on the model: stable instruction following, controllable structured output, and information retention in long contexts. The recommended decision process is as follows:

    1. Clarify the input form: pure text, image and text, or video; first eliminate candidates that do not meet the hard input requirements;
    2. Estimate the context peak: add up the worst cases of the system prompt, historical turns, and tool returns, and compare against the maximum input length;
    3. Verify the output budget: confirm whether the target artifact (such as a complete code file) can be generated in a single pass; otherwise, design segmented generation and concatenation;
    4. Build a small-scale evaluation set: run A/B tests with 50–100 real business samples, focusing on format compliance rate and task completion rate rather than general benchmarks;
    5. Calculate total cost: measure it as “average token consumption per task × unit price,” not just the listed price.

    Illustrative pseudocode can be used to uniformly wrap different models:

    1. def run_agent(model_client, task, max_input, max_output):
    2. ctx = build_system_prompt() # Reserve a safety margin
    3. for step in range(MAX_STEPS):
    4. prompt = fit_context(ctx, max_input * 0.85)
    5. resp = model_client.chat(prompt, max_tokens=max_output)
    6. if resp.done:
    7. return resp.result
    8. ctx = append_observation(ctx, resp.tool_call)
    9. return fallback()

    4. Common Misconceptions and Engineering Recommendations

    • Misconception 1: A larger context is always better. Extra-long contexts cause attention dilution and higher costs; retrieval augmentation is often more economical.
    • Misconception 2: A higher output limit is always better. An excessive budget encourages verbose output, so pair it with explicit format constraints.
    • Misconception 3: Ignoring unit conventions. Mixing different notations causes capacity misjudgment; always use the precise values from the official documentation and normalize them.
    • Recommendation: Abstract model calls into a replaceable adapter layer, retaining multi-provider routing and fallback capabilities. At the same time, use the logging, monitoring, alerting, and object storage capabilities of general cloud platforms such as Baidu AI Cloud to build an observability system for token consumption and failure rates, turning selection from a one-time decision into a continuously measurable engineering practice.