Multimodal Inference Costs Are Falling: How to Choose an Agent Platform

    This article explains where inference costs come from in multimodal large language models, how to estimate the cost of multi-step AI Agent tasks, and which methods help control spending. It also includes a checklist for pre-launch review and compares in-house models with third-party models.

    Over the past two years, competition among large language models has shifted from parameter count to context length, and now to multimodal capability and inference cost. Reports say that a mainstream vendor’s newly released multimodal Flash series model uses noticeably less GPU memory and storage than its previous generation, and its API output prices have been lowered. The exact reductions, test setups, and measurement methods should be confirmed in the vendor’s official documentation. This article does not cite unverified figures.

    The change in cost directly affects Agent development. An Agent completes a task by calling the model many times, so the cost of each call determines whether the full task can stay within budget. For this reason, understanding where costs come from, how to measure them, and how to control them matters more than looking only at unit prices.

    1. Where Multimodal Inference Costs Come From

    When a multimodal model processes an image, its vision encoder outputs a large number of visual tokens. These tokens enter the language model together with the text, take part in attention computation, and are written to the KV cache. The GPU memory used by the KV cache grows with context length and the number of concurrent requests. As a result, GPU memory capacity directly limits how many requests a single card can serve at once and how much context it can handle. Loading model weights and swapping context in and out involve storage reads and writes, which affect time to first response.

    If a model generation has lower GPU memory and storage requirements, the reduction may come from the following types of engineering methods. Each one has preconditions. Below, “may” marks a guess, not a confirmed implementation.

    1. KV cache quantization or sparsification: Uses low-bit formats such as INT8 or INT4, or keeps only cache entries for some important positions. This works only if the accuracy loss is acceptable for the business. Long-text reasoning and fine-grained visual recognition tasks are more sensitive to accuracy and need separate evaluation.
    2. Visual token pruning or merging: For high-resolution images, merges or drops redundant regions based on attention weights, which shortens the sequence that reaches the language layers. This works only if the discarded regions do not contain information the task needs. For example, when reading small-print tables or dense text, pruning may cause missed content.
    3. Offloading and scheduling of weights and intermediate states: Reduces frequent reads from external storage during inference, and lowers wait time through operator fusion or by overlapping computation with data transfer. These optimizations often depend on specific hardware and runtime environments, so results may differ when moved to another environment.

    A drop in a storage metric does not directly mean fewer reads during inference. The metric could refer to model file size, the storage needed for loading, or the bandwidth needed for cache swapping. Each definition has different performance implications. Before choosing a platform, confirm the metric’s definition with the vendor and run load tests on your own workload.

    2. How to Calculate Agent Costs

    Agents usually work in a loop of perception, planning, and action. Take the ReAct (Reasoning and Acting) framework as an example. The model first produces reasoning, then calls a tool, then continues reasoning after receiving the tool’s result, and repeats until it outputs a final answer. A task that analyzes a web interface and generates test cases may include several page fetches, screenshot interpretations, and result checks. Each step corresponds to one model call.

    Cost depends heavily on the input for each call. Many implementations send the full history to the model again, so each round’s input includes the content of all earlier rounds. If the number of new tokens added per round stays roughly constant, call it Δ, and the task runs for n rounds, then the cumulative input tokens are about Δ × n × (n+1) / 2. As the number of rounds grows, total input grows roughly with the square of the round count.

    Consider a hypothetical example. Each round adds about 2,000 tokens, and the task runs for 10 rounds. The cumulative input is about 110,000 tokens. If the history is compressed to under 4,000 tokens, the cumulative input is about 40,000 tokens, a reduction of about two-thirds. These are illustrative numbers only. The actual values depend on the length of tool outputs and the quality of summaries.

    You can use the following formula for a first estimate:

    Total cost ≈ Σ (input tokens × input price + output tokens × output price)

    Input tokens include the system prompt, conversation history, and tool results. Output tokens include reasoning content and the final answer. Input and output prices are usually different. Some platforms also bill cached input tokens separately, so calculate them separately.

    1. # Example: keep only the most recent messages and compress earlier content into a summary
    2. MAX_RECENT = 6
    3. def trim_history(history, summarize):
    4. if len(history) <= MAX_RECENT:
    5. return history
    6. old, recent = history[:-MAX_RECENT], history[-MAX_RECENT:]
    7. summary = summarize(old) # Generating the summary also incurs cost, which must be included in the total cost
    8. return [{"role": "system", "content": f"Summary of earlier progress: {summary}"}] + recent

    Common cost control methods include the following:

    • Truncation: Keep only the most recent rounds and key results. This suits tasks where steps depend weakly on each other.
    • Summarization: Compress earlier steps into a short summary. Summary quality affects later decisions, so sample summaries regularly to check whether key constraints are missing.
    • Caching: Use the platform’s prefix caching for fixed system prompts and tool definitions. Availability and discounts depend on the platform’s billing rules.
    • Tool result compression: Extract structured data from long text such as web pages or logs first, and pass only the required fields to the model.
    • Model routing: Send simple classification and extraction tasks to lower-cost models, and send complex planning to more capable models.
    • Step limits: Set maximum tool call counts and timeouts to stop an Agent from getting stuck in a repeating loop.

    Before launch, review the following checklist:

    1. Do you record input and output token counts for each task, and track them separately by model?
    2. Does the history have a truncation or summarization strategy? Are summaries sampled and reviewed regularly?
    3. Can the system prompt and tool definitions use caching?
    4. Are there limits on the maximum number of calls and the maximum spend per task?
    5. On your business’s evaluation set, are accuracy and failure rates acceptable for lower-cost models?
    6. Is the number of retries capped? Do retries get billed again?

    Lower costs give developers room to have the model perform more verification steps. Whether extra steps are worth it still depends on the value of the task and the cost of errors.

    3. Building In-House Models vs. Using Third-Party Models

    Connecting a developer platform to third-party models does not necessarily mean that the platform’s own models perform worse. The platform needs to weigh cost, performance, and data isolation at the same time