Multimodal LLM Selection in Practice: From Output Budgets to Agent Success Rates

    This article explains how to select multimodal large language models based on real workload requirements instead of token prices alone. It covers text, image, and video capability boundaries, output token budgets, context-window limitations, model identifier configuration, cost-per-successful-task modeling, Agent evaluation, routing, caching, batch processing, and observability. The goal is to help developers choose models and architectures that optimize both cost and reliability for production applications.

    Introduction: Cheap Tokens Do Not Always Mean Lower Cost

    When building intelligent applications that read documents, generate code, and call tools, developers often start by looking at model pricing tables. Token prices matter, but they only answer one question: how much does each million tokens cost? They do not answer a more business-relevant question: how much does it cost to complete one real task?

    For workloads that involve reading files, writing code, and calling tools, the per-round cost can vary by one to two orders of magnitude across models. This is not simply because one provider prices more aggressively. It is driven by several structural factors:

    • Different task output shapes: Some requests only need a few hundred tokens of structured output, while others require an entire long document or complete code file.
    • Different reasoning mechanisms: When extended thinking is enabled, the model’s internal reasoning tokens are also counted as generated tokens.
    • Different input compositions: System prompts, tool definitions, retrieved snippets, and multi-turn history can accumulate quickly, and input tokens often exceed output tokens.
    • Success and failure effects: A generation that fails validation can trigger retries, human review, or even a full pipeline rollback.

    Therefore, the goal of model selection is not simply to find the cheapest or strongest model. It is to find the model, or group of models, with the lowest cost per successful task under a given task distribution.

    1. First, Clarify Capability Boundaries: Input Modality Determines the Candidate Set

    1.1 Multimodal Input Is Not a Single Switch, but Three Independent Capabilities

    Many teams treat “supports multimodal” as a Boolean value. In practice, it should be evaluated as at least three independent capabilities:

    • Text-only understanding: long-document summarization, retrieval-augmented question answering, and code understanding or generation.
    • Image and text understanding: receipt recognition, screenshot understanding, chart reading, and converting UI mockups into code.
    • Video understanding: long-video event localization, anomaly detection in surveillance footage, and structuring lecture recordings.

    These capabilities do not mature at the same pace. A model may perform well on image and text tasks but struggle with temporal video understanding, because video tasks require additional steps such as frame extraction, temporal alignment, and cross-frame reference resolution.

    1.2 The First Filter: Coarse Filtering by Input Modality

    A reusable filtering process is shown below:

    1. Text-only input + long context required
    2. → Candidate set = all models; focus on output budgets and context stability
    3. Image input + structured output required
    4. → Candidate set = models with mature vision capabilities and strict structured-output support
    5. Video input
    6. → Candidate set = models with native video input support
    7. Many models that only support image and text are excluded here

    This filtering layer costs almost nothing to apply, but it can remove more than half of the candidates and prevent evaluation on the wrong model set.

    2. Do Not Treat Context Length as a Guarantee of Effectiveness

    “Million-token context” has become a common marketing point for flagship models. However, context length is a capacity claim, not a quality claim. In practical use, three different things need to be distinguished:

    1. Usable window: The advertised window often includes the system prompt, tool definitions, and multi-turn history. The actual space available for business content is smaller than the advertised number.
    2. Effective recall: When the context window is long, the model’s ability to recall information in the middle is usually weaker than its ability to recall information at the beginning and end. This is commonly known as the “lost in the middle” problem.
    3. Per-request output constraints: Input and output share the total context window. If the input already occupies most of the window, the remaining space for generation may be too small. Tasks such as rewriting long documents or generating entire code files can fail directly.

    2.1 An Easily Overlooked Debugging Issue: Model Identifiers Are Not Capability Labels

    When teams discuss models internally, they often use shorthand names or informal aliases. Different providers use different naming rules, including capitalization, dot placement, and spacing. If a shorthand name is passed directly as a request parameter, the result may not be a slight quality difference. It may be a 400-class error, or worse, the request may be routed to a model with a completely different capability tier.

    A safer engineering approach is shown below:

    1. # Bad example: using a business-side nickname directly as a model identifier
    2. MODEL_ALIAS = "hy4flash" # Cannot guarantee that it matches the upstream model ID
    3. # Recommended approach: use semantic aliases in business logic,
    4. # centralize the mapping in configuration, and declare default values explicitly
    5. ROUTING_TABLE = {
    6. "chat_fast": "vendor_a::flash_tier", # Low latency, mainly structured output
    7. "chat_deep": "vendor_a::max_tier", # Complex reasoning, long-form generation
    8. "vision": "vendor_b::vision_tier", # Image and text
    9. "video": "vendor_c::video_tier", # Video
    10. }
    11. DEFAULT_ROUTE = "chat_fast"

    The key principle is that a model identifier is a configuration item, not a code constant. All call sites should access models through logical aliases, so that switching, canary deployment, and rollback only require configuration changes.

    3. Output Budgets: More Easily Underestimated Than Input Length

    Input costs are relatively easy to estimate. Output costs are often less controlled because generated tokens have a more complex composition than expected:

    1. Total generated tokens
    2. ├── Reasoning/thinking content (produced when extended thinking is enabled; usually billed as output)
    3. ├── Tool-call arguments (structured JSON; not negligible when schemas are long)
    4. ├── Final answer
    5. └── Partial output that is regenerated after truncation (pure waste)

    This leads to three practical recommendations:

    • Distinguish thinking mode from direct-answer mode. Simple classification, field extraction, and format conversion do not require deep reasoning. Forcing extended thinking only increases cost linearly.
    • Set hard output limits. Without an upper bound, models tend to produce overly long outputs in uncertain scenarios, creating large cost variance.
    • Check for truncation, not only errors. When output is truncated, the API may still return a normal status code. The business side may receive incomplete JSON. If the downstream parser is too permissive, corrupted data may be written silently.
    1. def generate(req, route, max_output=2048, thinking=None):
    2. resp = client.chat(
    3. model=ROUTING_TABLE[route],
    4. messages=build_messages(req),
    5. max_tokens=max_output,
    6. reasoning_effort=thinking, # None / "low" / "high", based on task tier
    7. )
    8. # Truncation must be checked explicitly
    9. if resp.finish_reason == "length":
    10. raise TruncatedOutputError(route=route, got=resp.usage.completion_tokens)
    11. return resp

    4. Real Cost: Convert “Price per Million Tokens” into “Cost per Successful Task”

    4.1 Six Dimensions to Normalize When Comparing Prices

    When comparing model prices, at least the following dimensions should be normalized into the same measurement basis:

    Dimension Common difference Impact
    Input/output price ratio Output tokens often cost 3 to 10 times more than input tokens Long-generation workloads can be severely underestimated
    Cached input pricing Cached input tokens are often significantly discounted Stable system prompts can save substantial cost
    Long-context surcharge Prices may increase above a certain threshold Large context windows are not free
    Batch-processing discounts Asynchronous offline batch jobs often receive discounts Offline tasks should use batch-processing channels
    Thinking-token billing Thinking tokens may be billed separately or counted as output Affects budgets for extended-thinking scenarios
    Free quotas and tiered pricing Tiered pricing or free quotas may apply Can skew conclusions from small-scale pilots

    4.2 Unit Cost per Successful Task Model

    Let:

    • c_in and c_out be the input and output prices per million tokens.
    • T_in and T_out be the actual input and output token counts per round.
    • p be the single-attempt pass rate, including format validation and business-rule validation.
    • c_review be the average cost of one human review or rework cycle.

    Then the actual cost per successful task is:

    1. cost_per_success = (T_in / 1e6 * c_in + T_out / 1e6 * c_out) / p + ((1 - p) / p) * c_review

    The second term is important. The higher the failure rate, the steeper the human-review cost becomes. When p drops from 0.9 to 0.6, the rework cost factor jumps from about 0.11 to about 0.67. This jump is often much larger than the difference in model unit prices.

    4.3 A Numerical Example (For Illustration Only; Not Actual Product Pricing)

    Assume two candidate tiers:

    Tier Input price Output price Pass rate p
    Economy tier 0.5 3.0 0.72
    Flagship tier 4.0 12.0 0.94

    Assume T_in=8000, T_out=900, and c_review=3.0 cost units per review.

    Economy tier:

    • Model cost = (8000 / 1e6 × 0.5) + (900 / 1e6 × 3.0) = 0.004 + 0.0027 = 0.0067 cost units
    • Rework cost = (0.28 / 0.72) × 3.0 = 1.167 cost units
    • Cost per successful task ≈ 1.174 cost units

    Flagship tier:

    • Model cost = (8000 / 1e6 × 4.0) + (900 / 1e6 × 12.0) = 0.032 + 0.0108 = 0.0428 cost units
    • Rework cost = (0.06 / 0.94) × 3.0 = 0.191 cost units
    • Cost per successful task ≈ 0.234 cost units

    The conclusion is counterintuitive: under this task profile, the flagship tier has a lower cost per successful task, by about five times.

    Conversely, if both tiers achieve a pass rate above 0.97 and the output is very short, the economy tier can quickly become more attractive. This shows that model selection must be tied to a specific task distribution. There is no universally correct answer.

    4.4 Cost Scale Warning for Video Inputs

    The cost of video understanding is often severely underestimated. Even with frame extraction and downsampling, a video that lasts several minutes can still expand into tens of thousands of visual tokens. The cost of a single request can easily be more than ten times that of a text-only request.

    For batch video review scenarios, it is necessary to calculate the following in advance:

    1. Daily cost ≈ number of videos × tokens per video / 1e6 × input price × (1 + retry rate)

    During the validation phase, it is better to sample and measure the actual token count per video instead of estimating it from officially claimed frame-rate parameters.

    5. Agent Scenarios: Why “Max” and “Flash” in Model Names Do Not Determine Success Rate

    Tier labels in model names, such as flagship or lightweight, reflect the vendor’s internal model grading. They usually imply tradeoffs between capability and latency, but they cannot directly determine Agent success rate.

    Agent performance is determined by multiple orthogonal factors:

    1. Tool-call structure compliance: Can the model reliably generate parameters that conform to the schema, especially nested objects and arrays?
    2. Multi-turn convergence: After more than a dozen consecutive tool calls, does the model still keep the goal from drifting? Does it repeatedly call the same tool?
    3. Error recovery: When a tool returns an error, can the model understand the error and adjust its parameters, instead of retrying the same mistake?
    4. Context compression friendliness: As history grows longer, can the model still capture key constraints?
    5. Parallel calls and dependency management: Can the model correctly determine which tools can run in parallel and which must run sequentially?
    6. Refusal and permission boundaries: When facing ambiguous instructions, will the model execute irreversible operations without authorization?

    5.1 A Reproducible Agent Evaluation Method

    Evaluation design is more important than model selection. A minimal viable approach is recommended:

    Step 1: Build an evaluation set by sampling real traffic

    Do not invent test cases from imagination. Extract 150 to 300 real requests from historical sessions and stratify them by task type:

    • Single-step question answering (highest proportion, used to measure basic quality)
    • Structured extraction (used to measure schema compliance)
    • Single-tool invocation (used to measure parameter correctness)
    • Multi-step tool chains (used to measure convergence and error recovery)
    • Long-context retrieval (used to measure recall)

    Step 2: Define automatically measurable metrics

    1. METRICS = {
    2. "format_pass": 0.30, # Whether output satisfies the schema or can be parsed
    3. "tool_call_acc": 0.25, # Whether tool selection and arguments are correct compared with labeled answers
    4. "task_success": 0.30, # Whether the final business result is achieved, judged by rules or assertions
    5. "cost_penalty": 0.10, # Penalty after normalizing token usage and latency
    6. "stability": 0.05, # Variance across repeated runs, even when temperature is fixed
    7. }

    stability is often ignored, but in production environments, a model that returns different tool chains for the same request can create many hard-to-debug issues.

    Step 3: Compare models under identical conditions

    Fix the temperature parameters, prompts, tool descriptions, and evaluation set version. Replace only the model. Any prompt difference can invalidate the conclusion.

    Step 4: Use a small canary instead of a full cutover

    Use 5% to 10% of traffic for canary deployment. Observe changes in pass rate, P95 latency, per-request cost, and human-intervention rate together, then decide whether to expand the rollout.

    6. Engineering Implementation: Control Costs in the Architecture, Not by Saving Tokens

    Once model selection is decided, the architecture determines the final bill. The following methods usually reduce costs more than switching between models.

    6.1 Tiered Routing

    Use rules or a small model to make front-end decisions and route requests to different tiers:

    1. def route(req) -> str:
    2. # 1) Hard rules: task type determines input modality
    3. if req.has_video:
    4. return "video" # Video route, highest cost, must be strictest
    5. if req.has_image and req.need_ocr:
    6. return "vision"
    7. # 2) Structured tasks: prefer lightweight tier, escalate on failure
    8. if req.task_type in ("extract", "classify", "normalize"):
    9. return "chat_fast"
    10. # 3) Long-form generation or complex reasoning: use flagship tier directly
    11. if req.need_long_output or req.complexity_estimate > 0.7:
    12. return "chat_deep"
    13. return DEFAULT_ROUTE

    A companion escalation-retry mechanism is recommended: if the first output from the lightweight tier fails validation, automatically rerun the request with the flagship tier once, rather than retrying repeatedly with the same lightweight tier. This strategy often significantly improves overall pass rate with little change to total cost.

    6.2 Prefix Stable Prompts and Tool Definitions to Use Caching Effectively

    Place stable system prompts, tool definitions, and domain explanations at the beginning of the message list. Place volatile user inputs at the end. Requests with identical prefixes are more likely to hit prompt caching, and cached input tokens are often billed at a discount.

    Conversely, if timestamps or random IDs are placed at the beginning of the prompt, the cache hit rate can drop to zero.

    1. def build_messages(req):
    2. return [
    3. {"role": "system", "content": SYSTEM_PROMPT_V3}, # Stable, cacheable
    4. {"role": "system", "content": tool_schema_json()}, # Stable, cacheable
    5. {"role": "user", "content": req.payload}, # Volatile, placed at the end
    6. ]

    6.3 Two-Stage Processing for Long Context

    For extremely long documents, stuffing the entire document into the context window has two problems: cost grows linearly, and recall for middle information declines.

    A more reliable approach is two-stage processing:

    1. Use retrieval or chunked summarization to perform a coarse filter and compress candidate snippets to within one quarter of the context window.
    2. Pass the filtered content to the model for fine-grained reasoning.

    In practice, this method often achieves higher accuracy on long-document question answering than simply stuffing the full document into a larger window, while also reducing cost.

    6.4 Offline Batch Processing and Asynchronous Queues

    Non-real-time tasks, such as batch labeling, offline report generation, and nightly data cleaning, should use asynchronous batch-processing channels. These channels often have clear discounts and are less affected by online concurrency limits.

    The online path should reserve only interactions that require low latency.

    6.5 Budget Guardrails and Observability

    • Set daily or monthly token budgets for each business line. When thresholds are exceeded, automatically downgrade to the lightweight tier and trigger alerts.
    • Record the route, prompt_tokens, completion_tokens, cache hit status, finish_reason, and validation result for every call.
    • Make cost per successful task a core dashboard metric, rather than only looking at total token consumption.

    7. Decision Checklist: Four Steps to Choose a Model

    1. Coarse-filter by input modality: Is the input text-only, image-containing, or video-containing? This step eliminates most candidates.
    2. Determine the tier by output requirements: If long outputs are required, such as complete code files or long reports, verify the maximum single-output limit and confirm whether output and context share the same window.
    3. Calculate cost per successful task based on your task distribution: Plug your own T_in, T_out, and p values into the formula from Section 4. Do not copy other people’s price comparisons.
    4. Validate with a small canary: Use 500 to 1000 real samples to compare pass rate, P95 latency, and cost per successful task before making a decision.

    8. Common Pitfalls

    • Longer context is always better → Effective recall and output headroom are often the real bottlenecks.
    • Flagship tiers are always more expensive → When pass rates are low, rework costs can make flagship tiers cheaper.
    • Enabling thinking mode always improves results → For simple tasks, thinking mode mainly increases cost and latency.
    • Model shorthand names can be used directly → Model identifiers must be centrally configured and validated.
    • No error means no problem → Truncation status and structured-output completeness must be checked.
    • Supporting multimodal means video support works too → Image/text and video are independent capability lines.
    • Cut over to a new model all at once → Use canary deployment first, then evaluate cost per successful task.

    Conclusion

    Multimodal large-model selection is not merely a technical comparison. It is essentially cost-structure modeling. What truly determines the final bill and user experience is the actual composition of input and output tokens, the rework amplification caused by pass rates, and architecture-level strategies such as caching, routing, and tiered deployment.

    The recommended approach is:

    1. Lock candidate models by input modality.
    2. Calculate cost per successful task using your own real task distribution.
    3. Validate the decision with a small canary.

    Treat models as replaceable configuration items rather than fixed dependencies. Only then can you maintain an optimal balance between cost and performance in an environment where models iterate quickly.

    When building such applications on Baidu AI Cloud, its model service platform can help unify model access and scheduling, allowing routing, budgeting, and observability strategies to be implemented within the same engineering system. This can reduce the operational complexity caused by running multiple models in parallel.