Multimodal LLM Selection and Agent Cost Evaluation: A Practical Guide

    This guide explains why identical AI agent workflows can produce bills that differ by orders of magnitude, and how to choose multimodal large language models based on measurable criteria instead of spec sheets. It covers a first-pass screening matrix by input modality, how to read context window and output budget specs, an expected-cost formula with caching and batching levers, the four factors that actually determine agent success, a four-step re-evaluation method with a suggested metrics table, common pitfalls, and a deployable selection order. Readers will get a repeatable engineering process for balancing quality, cost, and latency across text, image, and video tasks.

    1. The Problem: Why the Same “Read Files, Write Code, Call Tools” Workflow Differs by Two Orders of Magnitude in Cost

    In real engineering work, a task chain that looks identical—upload a document, extract fields, generate code, call an internal tool, write back the result—can cost anywhere from a few cents to a few dollars per run depending on the model. The gap does not come from unit price alone. It is the product of four multipliers: input token volume, output token volume, the number of retry rounds needed to meet acceptance criteria, and whether cache and batch discounts apply.

    So the first principle of model selection is not “find the strongest model.” It is to split the problem into two measurable sub-questions:

    1. Can a cheaper model pass acceptance on the first attempt (is pass@1 high enough)?
    2. Can a more expensive model meaningfully reduce rework (does the expected number of rounds drop)?

    If you treat a spec sheet as a capability ranking, the most common misjudgments are: assuming long-document tasks will pass reliably just because the context window is large; assuming long-form generation will not be truncated just because the “max output” number is big; assuming total cost is lowest just because unit price is low.

    2. Narrow the Candidates First: Screen by Input Modality and Acceptance Criteria

    Multimodal capability is usually divided into three input modalities: text, image, and video. In engineering, use an “input modality matrix” as a hard filter before discussing price.

    • Batch image-text extraction, receipt and form structuring: prioritize mid-tier, low-unit-price general-purpose models that support tool calling, and use them to establish a cost baseline.
    • Tasks needing a large single-generation budget (for example, producing a long codebase skeleton or a long report in one pass): add candidates with a high max output budget to the list.
    • Direct video input (without extracting frames and sending images first): keep only candidates that natively support the video modality; otherwise you take on client-side frame extraction, transcoding, and reassembly costs.

    Write acceptance criteria up front. At minimum they should include field-level accuracy, JSON structure validity rate, tool-call argument correctness rate, citation traceability rate, and “human acceptability rate.” Any comparison without acceptance criteria degrades into subjective impression.

    3. How to Read Specs: Context, Output Budget, and Unit Conventions

    General-purpose capabilities across the four categories can be abstracted into the following spec view (values are common industry magnitudes, used to explain how to read them, and do not represent any specific product):

    Capability dimension Common value form Engineering meaning
    Input modality Text+image / text+image+video Determines whether client-side preprocessing is needed
    Context window Million-token scale Determines whether a long document can be fed in as a whole
    Max input Slightly less than context Space must be reserved for output and system prompt
    Per-call output budget Tens of thousands to hundreds of thousands of tokens Determines whether long-form generation must be chunked

    Three key conclusions:

    1. The output budget is not the final answer length. The budget usually also includes the thinking/reasoning process, intermediate tool-call results, and hidden placeholder content.
    2. Vendors may use decimal or binary conventions when writing K and M. When comparing across platforms, keep the original wording and do not assume strict equality.
    3. Context is a “shared pool”: input, conversation history, tool returns, and output all consume it, and the remaining allowance dynamically compresses the usable output.

    4. The Cost Model: Write the Bill as a Computable Formula

    Use the following expected-cost model instead of looking at list price alone:

    1. E[Cost] = E[rounds] × (Cin × P_in + Cout × P_out)
    2. E[rounds] ≈ 1 / pass@1 (rough estimate; actual value depends on retry strategy)

    Here Cin is the input tokens per round (including system prompt, history, and tool returns), and Cout is the output tokens per round (including thinking and structured results). The three most effective cost-reduction paths in engineering:

    • Improve cache hit rate: put stable system prompts, spec descriptions, and few-shot examples first and keep their order fixed;
    • Compress tool returns: send back only necessary fields, and avoid pushing entire logs into the context;
    • Batch and go asynchronous: route offline extraction tasks through batch channels, and interactive chains through low-latency channels.

    Illustrative call skeleton (pseudocode; it only expresses the flow and does not point to any specific API):

    1. def run_agent(task, tools, budget):
    2. history = [system_prompt(task.spec)]
    3. for step in range(budget.max_steps):
    4. resp = model.generate(
    5. messages=history,
    6. tools=tools,
    7. max_output=budget.step_output,
    8. )
    9. if resp.type == "tool_call":
    10. result = dispatch(resp.name, resp.args) # return only compact fields
    11. history.append(compact(result))
    12. elif resp.type == "final":
    13. return validate(resp.json, task.schema)
    14. return fallback_to_human(task)

    5. Agent Scenarios: “Max” and “Flash” in a Name Do Not Indicate Success Rate

    Tool-calling capability, context length, and naming suffixes do not prove agent success rate. Four things actually determine success or failure:

    1. Instruction following and format stability: can it reliably produce valid JSON, fixed fields, and parseable call arguments;
    2. Multi-step consistency: over a long chain, does it lose the goal, repeat calls, or self-recover after an error;
    3. Error visibility: on failure, can it give a locatable reason instead of silently fabricating;
    4. Budget control: does it respect “max steps” and “max output” limits without looping indefinitely.

    Build a “minimum task set” for the agent, covering six scenario types: single tool call, chained multiple tool calls, retry after tool failure, long-context retrieval, structured output, and refusal plus boundary handling. Aim for 20–50 cases per type to form a regression-testable evaluation baseline.

    6. Re-Evaluation Method: Same Tasks, Same Scoring, Same Budget

    Recommended four-step approach:

    1. Fix the dataset: desensitized real business samples, including hard cases and boundary cases;
    2. Fix the budget: unified max steps, per-step output limit, and total duration limit;
    3. Dual metrics: quality metrics (accuracy / validity rate / human acceptability rate) and economic metrics (cost per task, P95 latency);
    4. Decision rule: if the rework reduction from a higher-quality model does not offset the unit-price difference, choose the low-cost baseline model and route only hard samples to the high-cost model.

    Suggested evaluation table fields: task_id, modality, input_tokens, output_tokens, steps, pass, cost, latency, failure_reason. This table answers “which one should we pick” better than any marketing claim.

    7. Common Pitfalls

    • Treating max output as answer length, which truncates long-form output;
    • Ignoring history and tool returns consuming context, so a long session suddenly reports a limit error;
    • Looking only at unit price and missing the hidden cost of retry rounds;
    • Replacing business re-evaluation with public leaderboards, ignoring data distribution differences;
    • No failure classification, making it impossible to tell whether the problem is the model, the prompt, or the tool contract.

    8. Conclusion: A Deployable Selection Order

    1. High-frequency image-text and structuring tasks: start with a low-cost general-purpose model to establish a cost baseline;
    2. Budget-sensitive tasks that need a large generation budget: bring in high-output-budget candidates for comparison;
    3. Native video input: keep only candidates that support the video modality for the first validation round;
    4. Complex agents: make the final call with a unified task set and unified budget, and keep a human fallback plus hard-sample routing.

    In related practice at Baidu AI Cloud, this process is typically implemented on a general architecture of “object storage for samples, a message queue for asynchronous batch processing, a container platform to host evaluation jobs, and log services plus monitoring and alerting to track cost and failure rate,” which turns model selection from a one-off discussion into a continuously regression-testable engineering capability.