LLM Selection and AI Agent Deployment: Cost, Capability, and Scenario-Based Acceptance

    A practical guide to selecting large language models for real engineering workloads. Learn why identical tasks can differ in cost by orders of magnitude, how input formats and shared context windows affect token usage, and how to build a total cost of ownership model based on pass@1 and rework. Includes quantifiable acceptance criteria, a neutral comparison of four model profiles, a reproducible evaluation loop for AI agents, and a recommended testing order.

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

    In engineering practice, a task that looks identical—“read a file, write some code, call a tool once”—can cost anywhere from fractions of a cent to several yuan per turn depending on the model. Developers often assume that a higher price means a stronger model, but the real reason is usually a combination of three layers:

    1. Different input formats: Plain text, mixed text and images, and video frame sequences are converted to tokens differently. Preprocessing and frame extraction strategies can significantly change the input size.
    2. Different generation budgets: Whether the thinking (chain-of-thought) mechanism is enabled, the maximum output limit per call, and the constraint that input and the current generation share a total window all affect actual consumption.
    3. Different acceptance criteria: The total cost of passing on the first try (pass@1) versus multiple rounds of rework often determines the bill more than the unit price.

    So the right question is not “which one is cheapest,” but: Can the cheap one pass on the first try, and can the expensive one reduce rework?

    2. Define Input and Acceptance First, Then Talk Price

    2.1 Input Format Determines the Candidate Set

    • High-frequency text-and-image tasks and structured extraction: Start with a cost-baseline model to establish a lower bound and verify that “good enough” is sufficient.
    • Budget-sensitive tasks that need a larger generation budget: Add models that support large output budgets to the candidate set to reduce secondary calls caused by truncation.
    • Direct video understanding: Only models that support video input enter the candidate set; the rest are eliminated to avoid introducing errors with pseudo-solutions based on frame extraction and concatenation.

    2.2 Acceptance Criteria Must Be Quantifiable

    Break acceptance into four categories of metrics. If any category fails, the model does not advance to the next round:

    • Correctness: Field completeness rate for structured output, unit test pass rate for code, and parameter validity rate for tool calls.
    • Stability: Result variance across multiple samples of the same input, timeout rate, and rate-limit trigger rate.
    • Cost: Total tokens per task, cost per task, and the multiplier effect of rework rounds.
    • Latency: Time to first token and end-to-end latency. For multi-turn agent scenarios, estimate as “number of rounds × per-turn latency.”

    3. Specification Comparison: Clarify “Unit Basis” and “Shared Constraints”

    Based on verifiable public documentation, the abstract specifications of four mainstream models can be summarized as follows (neutral descriptions are used here in place of specific model names, while preserving the engineering meaning):

    Capability Dimension Option A (Multimodal Flagship) Option B (Low-Cost Baseline) Option C (Large Output Budget) Option D (Long-Window Balanced)
    Input types Text, image, video Text, image Text, image Text, image, video
    Context Million-level Million-level (slightly lower max input) Million-level About one million (1,048,576)
    Output budget per call ~130K non-thinking; ~260K thinking Max ~64K Max ~384K Default ~130K, limited by remaining window

    Two engineering constraints must be emphasized:

    • Output budget ≠ final answer length. The thinking process also consumes generation tokens; in thinking mode, the chain of thought and the final answer share the budget.
    • Input and generation may share the total window. You cannot assume that after filling a million tokens of input you can still output another million. Capacity planning must be calculated based on a shared pool.

    In addition, vendors use different notation and rounding conventions for K/M. When comparing across tables, treat them as being of the same order of magnitude rather than exactly equal.

    4. Cost Model: Use Total Cost of Ownership Instead of Unit Price

    Use the following formula for normalized estimation (illustrative):

    1. Cost per task = (input tokens × input price + output tokens × output price) × rework rounds
    2. Rework rounds ≈ 1 / pass@1
    3. End-to-end latency ≈ rounds × per-turn latency + queue latency

    The key point is that rework rounds are a multiplier. If model A’s unit price is twice that of model B, but pass@1 improves from 0.5 to 0.9, then A’s actual cost per task is lower. In engineering, measure pass@1 on a small sample first and then plug it into the formula, rather than making decisions based on list price.

    5. AI Agent Scenarios: Max/Flash in the Name Does Not Indicate Success Rate

    All four options support tool calling. Context length and naming suffixes cannot prove agent success rates. Agent success depends on:

    1. Tool description quality: Whether the parameter schema is clear and whether error messages are recoverable.
    2. State management: Context compression strategies for long tasks and mechanisms for retaining key information.
    3. Failure recovery: Whether the agent can self-correct after a tool error rather than repeating ineffective calls.
    4. Budget control: Reserve tokens for the chain of thought and tool results to avoid mid-task truncation.

    5.1 A Reproducible Acceptance Task Set

    Construct 30–50 tasks covering: single tool calls, chained multi-tool calls, conditional branches, error recovery, long-document Q&A, and video/text-and-image understanding. For each task, record pass@1, average rounds, total tokens, and cost, then compare with a radar chart.

    5.2 Illustrative Evaluation Loop

    1. def evaluate(model_client, tasks):
    2. results = []
    3. for t in tasks:
    4. r = model_client.run(t, max_rounds=8)
    5. results.append({
    6. "pass": r.success,
    7. "rounds": r.rounds,
    8. "tokens": r.total_tokens,
    9. "cost": r.cost,
    10. })
    11. pass_at_1 = sum(x["pass"] for x in results) / len(results)
    12. avg_cost = sum(x["cost"] for x in results) / len(results)
    13. return pass_at_1, avg_cost
    • Step 1: Use a low-cost baseline option for high-frequency text-and-image and structured tasks to establish a cost floor.
    • Step 2: Introduce a large-output-budget option to cover scenarios requiring long generation, and observe whether the truncation rate decreases.
    • Step 3: When direct video input is involved, keep only options that support video for comparison.
    • Step 4: Use the same task set for complex agents to make the final decision; do not substitute a specification table for actual testing.

    7. Common Pitfalls

    • Treating context length as “input that can be filled in one go,” ignoring the shared window.
    • Treating maximum output as “final answer length,” ignoring chain-of-thought consumption.
    • Making decisions based on unit price rather than total cost of ownership, ignoring the rework multiplier.
    • Inferring agent capability from model name suffixes, ignoring tool descriptions and state management.
    • Directly comparing rounded K/M values across vendors as if they were exactly equal.

    8. Conclusion

    The core of model selection is converting the “specification sheet” into “re-testable engineering metrics”: first lock down the input format and acceptance criteria, then normalize prices with a total cost of ownership model, and finally validate agent success rates with a unified task set. If you need a managed large-model service along with general cloud capabilities such as object storage, logging, and monitoring and alerting to support evaluation and production traffic, Baidu AI Cloud can provide the corresponding general product categories, but the final selection should still be based on your own business re-testing results.