A Three-Step Practical Guide to Reducing Token Costs with Multi-Model Routing

    This article presents a practical three-step method for reducing LLM token costs through multi-model routing. It covers how to compute the expected cost per successful task (accounting for input/output tokens and retries), how to build a reliable evaluation set to define quality thresholds, how to design a routing decision table, which metrics to monitor in production, common mistakes, and the applicability boundaries and compliance requirements of this approach.

    The Conclusion First

    Multi-model routing works best for tasks with clear rules, deterministic requirements, and automatically verifiable outputs. Implementation has three steps. Step one: use real business samples to define the quality threshold each model must meet. Step two: calculate the expected cost per task based on input tokens, output tokens, and retry counts. Step three: use a routing decision table to assign simple tasks to cheaper models, while continuously monitoring the fallback rate and cost trends. Open-ended tasks and high-risk tasks should not be directly routed with this method; they require human review.

    1. Why Cost Matters When Quality Is Comparable

    Many developers run into the same situation: the same set of prompts sent to several models produces outputs that all pass validation, yet the bills differ significantly. Take structured data generation as an example. Whether generating a standard Excel table or JSON, both a general-purpose large model and a lightweight model may meet the acceptance criteria. When quality is comparable, model selection becomes a cost problem.

    Quality refers to whether the output satisfies business rules; cost refers to the actual fee paid to complete one task. The two do not necessarily move in the same direction. The numbers below come from a hypothetical example test of 200 structured data generation samples. They are not from a public benchmark and are used only to illustrate the calculation method.

    Model Pass rate Cost per call (CNY) Expected cost per successful task (CNY)
    Lightweight model 70% 0.010 ~0.0143
    General model 98% 0.014 ~0.0143

    The two models have the same expected cost, but the lightweight model has a much lower pass rate. If you only look at the price per call, you will pick the wrong model. If you only look at the pass rate, you will ignore the extra consumption caused by retries.

    2. How to Calculate Expected Cost

    First, confirm the billing model. Most platforms bill input tokens and output tokens separately, with different unit prices—output tokens are usually more expensive. Input tokens include the system prompt, conversation history, few-shot examples, and retrieved context. Output tokens cover the final answer. Some models also produce reasoning content; some platforms count this as output, while others list it separately and charge it at a dedicated reasoning price. Therefore, do not treat any single platform’s billing approach as a universal rule—rely on the usage field returned by the API and the billing details.

    Cost per call can be calculated as follows:

    Cost per call = input tokens × input unit price + output tokens × output unit price + reasoning tokens × reasoning unit price (only if billed separately by the platform)

    If you retry after each failure until the task succeeds, the expected cost per successful task is:

    Expected cost per successful task = cost per call ÷ pass rate

    With this formula, both models in the example cost roughly 0.0143 CNY per successful task.

    If you set a retry limit and hand failures over to a fallback model, the calculation changes. Let the retry limit be n, the pass rate be p, and the fallback price be f:

    Expected number of calls = (1 − (1 − p)^n) ÷ p

    Expected cost per task = cost per call × expected number of calls + (1 − p)^n × fallback price

    Using the lightweight model as an example, with p = 0.7, n = 2, and the general model as fallback (0.014 CNY per call): the expected number of calls is 1.3, and the expected cost per task is approximately 0.010 × 1.3 + 0.09 × 0.014 ≈ 0.0143 CNY.

    Note that the pass rate should be measured separately for each task type, not as a single overall average. An overall average can hide significant failures on specific task types.

    3. How to Build the Evaluation Set

    The evaluation set determines whether your quality threshold is reliable. When building it, consider the following practices.

    1. Sample from production logs, covering every task type, different input lengths, and common edge cases. At least 100 samples per task type is recommended.
    2. Prepare a ground-truth answer for each sample, or write automated validation rules. Prefer rule-based validation wherever possible; use manual annotation only for what cannot be rule-checked.
    3. Reserve part of the samples as a test set that is not used when tuning prompts or routing rules, to avoid overfitting.
    4. Re-sample and update the evaluation set when production traffic distribution changes, model versions are updated, or business rules are adjusted.

    The quality threshold is determined by the business cost of an error. If one wrong output causes manual rework, the threshold should be set higher. For example, a field extraction task might require a pass rate of at least 97%, while a copy-rewriting task might require at least 95%. Once the threshold is set, all candidate models must be measured against it on the same evaluation set with the same standard.

    4. How to Design the Routing Decision Table

    The routing decision table maps task types, validation rules, and model choices. Below is a template; the example rows are for reference only, and the actual values must be validated against your evaluation set.

    Task type Validation rule Quality threshold Primary model Fallback model Retry limit Human review condition
    Order field extraction JSON structure and field type checks Pass rate ≥ 97% Lightweight model General model 2 Consecutive validation failures
    Product description rewrite Word count and sensitive-word rules Pass rate ≥ 95% Lightweight model General model 1 Sensitive word detected
    Contract clause interpretation Cannot be automatically validated N/A Excluded from routing N/A N/A Fully human-reviewed

    With the decision table, a task goes to the primary model first. If validation fails, the call is retried up to the retry limit. Tasks that still fail are handed to the fallback model or sent to human review. Fallbacks must stay within the quality threshold—you cannot lower quality requirements just to save money. Tasks that cannot be automatically validated should be excluded from routing entirely.

    5. Which Metrics to Monitor

    After routing goes live, continuously track the following metrics.

    • Pass rate: measured per task type and compared against the threshold.
    • Fallback rate: the share of traffic shifted from the primary model to the fallback model. A sudden rise usually means the primary model’s performance has degraded or the input distribution has changed.
    • Retry rate: the share of calls that require retries. A rising retry rate directly increases cost.
    • Cost per successful task: computed from the actual bill and the number of successful tasks; it reflects real spending better than the per-call price.
    • P95 latency: retries and fallbacks slow down responses, so confirm latency remains within an acceptable range.
    • Human review rate and downstream failure rate: these show whether automatic routing is shifting problems to later stages of the pipeline.

    It is advisable to set alerts for pass rate and fallback rate. If a task type’s pass rate stays below the threshold for a full day, temporarily switch that task type back to the general model and then investigate the cause.

    6. Common Mistakes

    1. Comparing only the per-call price while ignoring the pass rate and retry costs.
    2. Using an overall average pass rate instead of per-task-type pass rates.
    3. Leaving retry, fallback, and human review costs out of the cost calculation.
    4. Treating one platform’s reasoning-token billing rules as the universal standard for all platforms.
    5. Having an evaluation set whose distribution does not match production traffic, causing quality to drop after launch.
    6. Failing to monitor routing after launch, letting the fallback rate creep up and costs rise instead of fall.

    7. Applicability Boundaries and Compliance Requirements

    Cost optimization must not lower quality requirements or bypass compliance obligations. If samples contain personal information or trade secrets, they should be de-identified first, with limits on data retention time and access scope. For high-impact decisions, keep a human spot-check mechanism in place and provide a one-click rollback switch to revert to the original model. Multi-model routing is only worth the investment when the task rules are clear, the results can be automatically validated, and the cost of errors is manageable.