Large Model Selection and Agent Deployment: A Practical Guide to Cost, Capability, and Scenario-Based Evaluation

    Choosing the right large language model for AI agents is less about the sticker price and more about the effective cost per successful output. This article breaks down model selection across four dimensions—input modalities, context window limits, output and reasoning budgets, and billing models—and explains why retries and thinking tokens can make a cheaper model more expensive in practice. It also outlines a scenario-based trial order and a minimal evaluation loop with sample code for tracking pass rate, retry count, token usage, and per-task cost, plus a cost-control checklist and common pitfalls to avoid. The goal is a reproducible, data-driven selection process based on your own task distribution rather than model names or headline specs.

    1. The Problem: Why the Same Task Can Cost Two Orders of Magnitude More

    For typical workloads such as reading files, writing code, and calling tools, the per-turn cost of different large models can range from a few cents to several dollars. On the surface, this looks like a difference in unit price. In reality, it is determined by three variables: the input tokens actually consumed per request, the generated tokens (including reasoning), and the number of retries required to achieve a “one-shot pass.”

    The first principle of model selection, therefore, is not to compare list prices but to compare the effective cost per unit of usable output:

    1. effective cost = (input tokens × input price + output tokens × output price) × average attempts / accepted samples

    This formula shows that a model with a lower unit price but three retries per task may have a higher effective cost than a more expensive model that passes on the first attempt. In engineering practice, “acceptance pass rate” and “average attempts” should be collected as first-class metrics rather than judged by subjective impression.

    2. Breaking Down Capability Across Four Dimensions

    2.1 Input Modalities: Text, Images, and Video Are Three Different Capability Curves

    Mainstream flagship models generally support text and image understanding, but native support for direct video input is the dividing line. Video input means the model must process temporal frame sequences internally, which significantly increases both engineering complexity and token consumption. Recommendations:

    • For batch image-text extraction, receipt and screenshot understanding: validate lightweight-tier models first to establish a cost baseline;
    • When the model must directly understand video content (rather than manually extracting frames and converting them to images): filter for models that support the video modality first;
    • For text-only long-document processing: do not pay for modalities you will not use.

    2.2 Context Window: Million-Level Is Now Standard, but “What Fits In” Is Not “What Can Be Output”

    Flagship and lightweight models from multiple vendors now offer million-level context, but there are two common misreadings:

    1. The input limit is smaller than the total window. Some models have a 1M total window, but the maximum single input is capped at around 960k, with the remaining space reserved for generation.
    2. Input and the current turn’s generation share the total budget. You cannot assume that after filling the context with a million input tokens you can still output another million.

    A reusable engineering practice is to chunk and summarize-compress very long documents:

    1. def chunk_and_summarize(doc, chunk_size=200_000, keep_ratio=0.3):
    2. chunks = [doc[i:i+chunk_size] for i in range(0, len(doc), chunk_size)]
    3. # compress first, then concatenate to avoid filling the context at once
    4. return [compress(c, keep_ratio) for c in chunks]

    2.3 Output Budget and Reasoning Mode: The Most Overlooked Cost Amplifier

    The maximum output budget per request varies noticeably across models, from 64k to 384k. More importantly, there is the reasoning (thinking) mode:

    • Some models allow a higher thinking-mode limit than non-thinking mode, but the chain of thought and the final answer share the same generation budget—the longer the reasoning, the less budget remains for the answer;
    • Default output and maximum output are two different concepts, constrained by the remaining context;
    • The reasoning process is billed as output tokens, so long chains of thought can multiply costs.

    Practical advice: make “thinking on/off” a switch that can be toggled per task—turn it off for simple extraction tasks and enable it only for complex reasoning and planning tasks.

    2.4 Billing: Watch for Caching, Batch, and Tiered Differences

    Billing dimensions are not uniform across platforms. Common differences include separate pricing for input and output, discounts for context-cache hits, reduced rates for batch asynchronous jobs, and tiered token pricing. When budgeting, always plug in your “actual request profile” rather than multiplying list prices directly.

    3. A Scenario-Based Trial Order That Works in Practice

    1. High-frequency image-text and structured extraction: run the full pipeline with a lightweight-tier model first to establish a cost baseline;
    2. Budget-sensitive workloads that need a larger generation budget: bring in a tier with stronger long-output capability for comparison;
    3. Direct video input: keep only candidates that support the modality and eliminate the rest;
    4. Complex agents: use the same task set for the final decision, and do not infer capability from naming suffixes (such as Max/Flash/Pro).

    It is worth emphasizing that neither context length nor naming suffixes can prove agent success rates. Tool-calling support is common to all four and therefore does not serve as a differentiator.

    4. Business Re-Testing: Turning “Gut Feeling” into Data

    Build a minimal evaluation loop with a fixed task set, automated acceptance, and cost aggregation:

    1. tasks = load_tasks("agent_eval_v1.jsonl") # each entry contains input, expected schema, and a verify function
    2. report = []
    3. for model in candidates:
    4. for t in tasks:
    5. resp = call_model(model, t.input, thinking=t.needs_reasoning)
    6. ok = t.verify(resp) # schema validation + business assertions
    7. report.append({"model": model, "ok": ok,
    8. "in_tok": resp.usage.input,
    9. "out_tok": resp.usage.output})
    10. # aggregate: pass rate, average attempts, effective cost per unit

    Metrics should include at least: first-attempt pass rate, average retries, input/output token distribution, cost per task, and timeout rate. Observe continuously for a week before deciding, to avoid being misled by a single incidental result.

    5. Cost-Control Checklist

    • Turn off unnecessary thinking modes; use lower tiers for simple tasks;
    • Compress long documents before feeding them to the model to reduce wasted input;
    • Use structured output constraints (JSON schema) to reduce rework;
    • Enable caching for repeatable shared prefixes;
    • Route batch offline jobs through asynchronous channels;
    • Set token-consumption thresholds in monitoring and alerting.

    6. Common Pitfalls

    1. Treating maximum output as the answer length; 2. Treating a million-token context as infinitely fillable; 3. Inferring agent capability from the model name; 4. Comparing only unit price and not pass rate; 5. Ignoring the billing of thinking tokens.

    7. Conclusion

    Selection is not about choosing the “strongest” model, but the one with the lowest effective cost on your task distribution. First screen by modality and budget, then re-test with a unified task set, and put pass rate and token consumption into the same report—that is the reproducible engineering path to a decision. If you are already using the relevant model services from Baidu AI Cloud, it is equally advisable to run a localized re-test with the framework above and let data drive the final choice.