Choosing a Multimodal LLM: Cost, Capability, and Validation for Agent Scenarios

    This guide explains how to compare multimodal LLMs for real workloads. It covers how token pricing, reasoning tokens, and retries affect the cost of each accepted result, how to read context window, output limit, and thinking budget specs, and how to build a repeatable benchmark on your own tasks before you choose a model.

    1. Where the Cost Differences Come From

    Two models may differ in cost per call by an order of magnitude on the same job, such as reading files, generating code, and calling external tools. Costs add up from several parts: input tokens, output tokens, generation tokens used for reasoning, cache hits, and the extra round trips caused by tool calls. In multi-turn agent tasks, each turn carries the full context again, so the input grows with every step.

    Comparing unit prices therefore answers only part of the question. A more useful comparison is the total cost of producing one acceptable result.

    2. Define the Task and Acceptance Criteria First

    Before selecting a model, answer three questions.

    1. What is the input? It may be plain text, images, or video. Video input usually takes one of two paths. The model can process the video natively, or key frames and an audio transcript can be extracted first and passed to a model that supports only text and images. The two paths differ noticeably in accuracy, latency, and cost.
    2. What is the output? It may be structured JSON, a long document, a code patch, or a tool-call instruction. The output format determines how large an output budget you need.
    3. How is a pass defined? Possible criteria include field-level accuracy, whether code compiles and passes tests, whether tool arguments match the schema, or the human review pass rate. Without clear acceptance criteria, no comparison has a reliable basis.

    Write acceptance criteria as conditions that a script can check automatically. For parts that cannot be checked automatically, provide a scoring guide so that different reviewers reach consistent conclusions.

    3. Reading the Three Numbers in a Model Spec

    Model documentation often lists a context window, a maximum output length, and a thinking budget. These values mean different things, and one cannot replace another.

    • Context window: The maximum number of tokens the model can process in one request. It usually includes both the input and the output generated in that turn. A large window does not mean you can supply a long input and still receive an output of the same length. In some implementations, input and output share this total.
    • Maximum output length: The maximum number of tokens the model can generate in a single response. It determines whether a long document or a large batch of structured output can be produced in one call.
    • Thinking budget: When reasoning mode is on, the number of internal reasoning tokens the model can generate before it gives an answer. In some implementations, thinking tokens count against the same output limit as the final answer. If thinking uses most of the budget, the final answer may be cut off.

    When you call the API, set the output limit explicitly. Then check the finish reason field to distinguish a normal stop from a truncation caused by length. Common values are stop for normal completion and length for truncation. Exact field names depend on each platform’s documentation.

    1. def get_content_or_raise(response: dict) -> str:
    2. """Raise an exception when the finish reason is length, so a truncated result is never treated as complete."""
    3. reason = response.get("finish_reason")
    4. if reason == "length":
    5. raise RuntimeError("Output was truncated. Raise the output limit or lower the thinking budget, then retry.")
    6. return response["content"]

    4. Replace Unit Price Comparison with Cost per Accepted Result

    You can estimate the cost of a single call with this formula:

    Cost per call = input tokens × input price + (output tokens + thinking tokens) × output price

    The pass rate also determines total cost. Suppose one model has a low cost per call but passes only 30% of tasks. Producing one usable result then takes about 3.3 attempts on average. Another model costs twice as much per call but passes 90% of tasks. Its final cost per usable result is lower.

    Cost per accepted result = (cost per call + human review cost per call) ÷ pass rate

    1. def cost_per_accepted(
    2. price_in_per_m: float,
    3. price_out_per_m: float,
    4. avg_input_tokens: int,
    5. avg_output_tokens: int,
    6. avg_thinking_tokens: int,
    7. pass_rate: float,
    8. review_minutes_per_call: float = 0.0,
    9. hourly_rate: float = 0.0,
    10. ) -> float:
    11. """Estimate the average cost of each accepted result. Prices are per million tokens. Use the official price list from the day of testing."""
    12. if pass_rate <= 0:
    13. return float("inf")
    14. api_cost = (
    15. avg_input_tokens * price_in_per_m
    16. + (avg_output_tokens + avg_thinking_tokens) * price_out_per_m
    17. ) / 1_000_000
    18. review_cost = review_minutes_per_call / 60 * hourly_rate
    19. return (api_cost + review_cost) / pass_rate

    Keep two points in mind when you run this calculation. First, use the official price list from the day of testing, and record when you took the snapshot. Second, reviewer time often gets overlooked. On complex tasks, it can cost more than the API fees.

    5. Build a Repeatable Benchmark on Your Own Tasks

    Specs and prices can narrow the list of candidates, but the final decision must rest on your own business data.

    1. Sampling. Draw tasks from real business workloads across simple, medium, and hard levels. Include at least 30 tasks per category so you do not test only handpicked examples.
    2. Fixed conditions. Use the same prompts, tool definitions, temperature setting, and input materials for every candidate. If any of these change, the results cannot be compared directly.
    3. Repeated runs. Run each task 3 to 5 times and record how consistent the results are. Generation is random, so one successful run does not show stable capability.
    4. Metrics. Track pass rate, valid tool-call rate, format compliance rate, average latency, token usage, and the time people spend editing the output.
    5. Blind review. Reviewers should not know which candidate produced each output. This reduces subjective bias.

    The following is a vendor-neutral test framework skeleton. Business code depends only on a shared adapter interface, so you can swap candidate models without changing the test logic.

    1. from dataclasses import dataclass
    2. from typing import Callable
    3. @dataclass
    4. class RunRecord:
    5. task_id: str
    6. passed: bool
    7. input_tokens: int
    8. output_tokens: int
    9. latency_s: float
    10. def run_suite(adapter, tasks, validators: dict[str, list[Callable]]) -> list[RunRecord]:
    11. records = []
    12. for task in tasks:
    13. output = adapter.call(task.prompt, task.inputs, task.tools)
    14. checks = validators.get(task.kind, [])
    15. passed = all(check(output, task) for check in checks)
    16. records.append(RunRecord(
    17. task_id=task.id,
    18. passed=passed,
    19. input_tokens=output.usage.input_tokens,
    20. output_tokens=output.usage.output_tokens,
    21. latency_s=output.latency_s,
    22. ))
    23. return records

    6. Model Identifiers and Configuration Management

    Model names and versions change over time, and identifiers in the documentation can also change. To keep production configurations working and test results current, follow these practices.

    • Store model identifiers in a configuration file. Business code should reference logical names only.
    • Record the documentation version, the price snapshot, and the exact candidate version on the day of testing.
    • Pin versions during comparison. After a candidate is upgraded, rerun the regression task set before you decide whether to switch.
    • Do not treat suffixes in model names as evidence of capability tier. Only task results can show capability.
    1. models:
    2. batch_vision:
    3. provider: vendor_a
    4. model_id: "<按官方文档填写>"
    5. max_output_tokens: 8192
    6. thinking: disabled
    7. agent_core:
    8. provider: vendor_b
    9. model_id: "<按官方文档填写>"
    10. max_output_tokens: 32768
    11. thinking_budget: 4096

    7. Additional Considerations for Agent Scenarios