Multimodal LLM Selection: Pricing, Capabilities, and AI Agent Workloads
Choosing a multimodal LLM requires more than comparing token prices and context windows. This article outlines a practical evaluation process covering input support, acceptance criteria, token budgets, reasoning costs, and agent reliability. It explains how to measure cost per successful task and build a multi-model architecture with regression testing, monitoring, and fallback mechanisms.
1. The Core Selection Problem: Specifications Cannot Predict First-Pass Success
In production projects, tasks such as reading files, writing code, and calling tools may look similar yet differ in cost by two orders of magnitude. One interaction might cost only a few cents, while another accumulates substantial expense through repeated rework.
The difference is not primarily the listed token price. Three less visible variables matter: first-pass success rate, average number of attempts, and context growth after failures.
The first principle of model selection is therefore to treat specifications as screening criteria and workload-specific evaluation as the basis for decisions. Context length, model-tier suffixes, and parameter counts indicate capability limits; they do not establish effectiveness on your task distribution. Treating specifications as a performance ranking can become expensive after deployment.
2. Step One: Define Input Types and Acceptance Criteria
Multimodal capability is a matrix, not a yes-or-no attribute. At a minimum, distinguish four input categories:
- Plain text
- Static images
- Video or time-sequenced frames
- Structured documents and artifacts, including spreadsheets, scanned documents, and code repositories
Support varies considerably for the latter two categories. For video in particular, some models analyze extracted frames as static images, while others support native temporal modeling.
Include two explicit columns in your comparison:
- Input support: Does the model support video natively? What resolution, frame-rate, or duration constraints apply? Are images processed through a separate encoding pathway?
- Acceptance criteria: How is success determined? Must every field match exactly, is semantic equivalence sufficient, or must the model achieve at least a 95% pass rate in manual spot checks?
Without clear acceptance criteria, price comparisons lack a meaningful foundation. A practical task definition might look like this:
task: invoice_field_extractioninput_modalities: [text, image]video_required: falseacceptance:type: field_exact_matchfields: [vendor, amount, date, tax_id]threshold: 0.98retry_policy: max_attempts=2budget:p95_latency_ms: 8000cost_per_1k_calls_max: 0.6
3. Step Two: Separate Context Budgets from Output Budgets
Million-token context windows are increasingly common among flagship models, but context capacity alone is often less important to cost than the output budget. Input processing can benefit from caching and batching, whereas output tokens are generated sequentially, affecting both latency and the typically higher output-token charges.
Confirm three separate limits:
- Maximum input length: The advertised context window may differ from the maximum input allowed in one request. Reserved output capacity can reduce the space available for input.
- Maximum output per request: Limits can range from tens of thousands to hundreds of thousands of tokens. This determines whether the model can generate a complete code module in one response or must continue across multiple requests.
- Remaining context capacity: Output may also be constrained dynamically by the total context limit minus the input already consumed. This is particularly easy to overlook in long conversations.
The engineering response is an explicit budget allocator, rather than using the maximum as the default:
def plan_budget(total_ctx, prompt_tokens, desired_output, safety=0.05):usable = int(total_ctx * (1 - safety))remaining = usable - prompt_tokensif remaining <= 0:raise ValueError("prompt exceeds usable context; need chunking or summarization")return min(desired_output, remaining)
4. Step Three: Account for the Cost and Latency of Reasoning
Models with thinking or reasoning modes may consume intermediate reasoning tokens before producing an answer. Depending on the model’s accounting rules, those tokens are billed and count toward the output budget.
Reasoning can improve accuracy on difficult tasks, but it can also multiply latency and cost. Rather than enabling it globally, route tasks by complexity and risk:
- Extraction, classification, formatting, and short question answering: Disable thinking to prioritize throughput.
- Multi-step code repair, complex data reconciliation, and long-document reasoning: Enable thinking and cap the reasoning budget.
- High-risk tasks: Combine thinking with enforced structured output and rule-based validation.
A simple routing sketch:
def route(task):if task.risk == "high" or task.steps > 5:return {"thinking": True, "max_output": 32000, "schema": task.schema}return {"thinking": False, "max_output": 4096, "schema": task.schema}
5. Step Four: Compare Prices on a Consistent Basis
The most common pricing mistake is comparing only the rate per million tokens. Break costs into at least six dimensions:
- Input-token price
- Output-token price
- Cached-input price
- Reasoning-token billing
- Batch or asynchronous processing discounts
- Hidden costs from failures and retries
An approximate cost model is:
cost = (in_tokens * p_in * (1 - cache_hit) + cached_tokens * p_cache+ out_tokens * p_out + think_tokens * p_think) * attempts
Use consistent token and price units, and ensure that cached input and reasoning tokens are not counted twice.
The most frequently underestimated factor is attempts. Consider a model whose token rates are three times those of another model, but whose first-pass success rate rises from 60% to 95%. If average attempts fall from approximately 1.67 to 1.05, the effective cost gap narrows substantially, even before accounting for context growth during retries.
The useful questions are therefore not just “Which model is cheaper?” but “Can the cheaper model finish on the first attempt?” and “Does the more expensive model avoid enough rework to justify its price?”
6. Step Five: Evaluate What Matters in AI Agent Workflows
Agent workflows combine multiple turns, tools, and long contexts. This shifts the evaluation focus from isolated answers to operational reliability:
- Tool-call correctness: Does the model select the right tool and provide valid arguments? Does it ask for missing information rather than inventing it?
- Structured-output stability: Measure JSON Schema compliance, missing-field rates, and invalid enum values.
- Long-horizon consistency: Does the model retain constraints across turns, avoid redundant tool calls, and stay out of loops?
- Context-management compatibility: Can it preserve the task objective after context is compressed into a summary?
- Failure recovery: Can it correct its behavior after receiving an error message?
None of these properties can be inferred reliably from a specification sheet. They require testing on representative business data.
7. A Reusable Evaluation Method
Build a three-layer evaluation suite:
- 200 gold-standard cases: Manually labeled examples for regression testing
- 2,000 sampled production cases: Representative examples for identifying performance trends
- 50 adversarial cases: Extremely long inputs, ambiguous instructions, missing tool arguments, and conflicting constraints
The following sketch tracks successful cases, attempts, and token consumption:
def evaluate(candidate, dataset):stats = {"pass": 0, "attempts": 0, "tokens_in": 0, "tokens_out": 0}for case in dataset:for attempt in range(1, case.max_attempts + 1):r = candidate.run(case)stats["attempts"] += 1stats["tokens_in"] += r.in_tokensstats["tokens_out"] += r.out_tokensif case.accept(r):stats["pass"] += 1breakn = len(dataset)return {"first_pass_rate": stats["pass"] / n,"avg_attempts": stats["attempts"] / n,"cost_per_success": estimate_cost(stats) / max(stats["pass"], 1),}
Note that the value labeled first_pass_rate in this sketch actually measures the overall pass rate within the retry limit. A true first-pass rate must count only cases accepted on their first attempt.
Use cost_per_success as the primary normalized metric for cross-model comparison. It puts pricing, success rates, and retries on the same basis: the cost of completing an accepted task.
8. Common Selection Mistakes
- Replacing retrieval with a long context window: Longer inputs can dilute attention and increase cost. Retrieval-augmented generation is often more economical.
- Enabling thinking globally: For many routine tasks, the benefit does not justify the additional expense.
- Ignoring output budgets: Truncated generations can trigger retries and sharply increase cost.
- Measuring only averages: Tail failures shape the agent experience. Track P95 latency and the distribution of failures.
- Treating vendor documentation as a performance guarantee: Documentation describes capability boundaries, not effectiveness on your data distribution.
9. Recommended Production Architecture
A practical production design combines multiple models behind a unified gateway:
- Gateway: Handles authentication, budget controls, caching, retries, and fallbacks.
- Routing layer: Selects models according to task type and risk.
- Observability layer: Uses logging, monitoring, and alerts to track acceptance rates, token consumption, and latency percentiles.
- Regression pipeline: Includes evaluation datasets and prompt versions in the container platform’s CI workflow, so prompt or model changes trigger regression tests.
- Object storage: Stores evaluation datasets.
- Message queue: Smooths demand spikes for asynchronous batch workloads.
If your existing deployment uses relevant Baidu AI Cloud services, the gateway and evaluation workflow can be deployed on its container platform and logging and monitoring infrastructure. Accessing models through a unified model-service interface helps avoid coupling business code to a specific implementation.
10. Conclusion
Model selection is a continuous calibration process, not a one-time decision. Follow this sequence:
- Define inputs and acceptance criteria.
- Allocate context and output budgets.
- Enable reasoning according to task complexity and risk.
- Compare costs across the six pricing dimensions.
- Evaluate agent workflows using
cost_per_successas the primary metric. - Establish regression testing and fallback mechanisms.
Use specification sheets to eliminate unsuitable candidates. Use workload-specific testing to identify the model that actually fits.
