Reducing Multi-Model LLM Costs: Task-Based Model Tiering and Routing

    This article explains how to cut LLM costs in a multi-model setup. It covers the billing formula and the factors that affect real spending, how to measure savings on your own workload, and how to tier tasks by complexity. It also compares three routing strategies with a rule-based example, and describes prompt optimization, caching, automatic routing, a phased rollout, and data privacy review.

    1. First, Understand What You Are Saving

    Most mainstream models can handle structured data generation tasks. As model capabilities converge, the question shifts from “Which model performs best?” to “How much does each option cost for the same result?”

    The basic billing formula is:

    Cost per task = input tokens × input price + output tokens × output price + number of retries × cost per call

    This formula has three points to note. First, input and output prices are usually different, and output prices are often higher, so longer outputs make the bill grow faster. Second, retries are billed again. Each escalation retry adds another call charge. Third, a cache hit avoids calling the model, but the vector search itself has a cost, and that cost must also be counted.

    Comparing total token counts is not the same as comparing bills. Two models with similar token totals can still produce very different bills if their unit prices differ. Conversely, a model that uses fewer tokens but needs multiple retries can end up costing more.

    2. How to Interpret “85% Savings”

    The original test found that the spending gap between the most expensive and the least expensive setups can exceed 85%. Read this figure with its conditions in mind.

    A saving of 85% means the lowest-cost setup costs 15% of the highest-cost setup. In other words, the two differ by about 6.7 times. This conversion shows what the number means, but it does not prove the number can be reproduced. To judge whether it applies to your own business, you need to know four things: which model versions were used, how many task samples were included, how many calls each task required, and the billing unit price of each model.

    When measuring costs in your own business, record at least the following:

    • Model names, versions, and call parameters;
    • Input tokens, output tokens, and retry count for each call;
    • The number and source of task samples, ideally covering the real traffic distribution;
    • The input and output unit price for each model, checked against the billing cycle;
    • Quality judgment rules, such as whether all fields are complete, whether the data matches the source text one to one, and whether the format is valid.

    Only with these records can you judge whether the savings ratio is stable and which tasks it holds for.

    3. Step 1: Tier Tasks by Complexity

    Do not send all requests to a single model. Instead, build a three-tier model pool:

    Tier Typical Tasks Selection Principle
    L1 Deep reasoning, multi-step planning, long-document comprehension Choose the most capable model and accept higher cost
    L2 Structured output, code generation, information extraction Choose a model that balances capability and cost
    L3 Simple Q&A, intent recognition, format conversion Choose a lightweight, fast model

    The goal of tiering is to match task difficulty with model capability. Mismatches can go in two directions. Simple tasks should not occupy high-spec models, and complex tasks should not go to models that lack the capability. The second mismatch often causes greater losses, because wrong outputs must be reworked manually.

    Tier criteria should be based on real data rather than set by intuition alone. First, sample a batch of historical tasks and run them through each tier. Observe which tier delivers acceptable quality, then assign the matching task types to that tier.

    4. Step 2: Design the Routing Strategy

    The routing layer decides which model handles each request. There are three common strategies.

    Rule-based routing matches requests to preset rules based on keywords, task type, input length, and similar features. It is simple to implement and suits scenarios where task types are stable. Its drawback is that rules must be maintained manually, and they tend to fail when new task types appear.

    Quality-feedback routing records a quality score for each call. When a model keeps scoring low on a certain task type, the routing layer sends those requests to a higher-tier model. This strategy depends on reliable automatic scoring. If the scoring itself is biased, the routing results will be biased too.

    Cost-aware routing considers the remaining budget and task urgency. Under a minimum quality requirement, it prefers cheaper models. It suits settings with limited budgets where response latency is less critical.

    The following is an example of rule-based routing. The thresholds and feature weights are only starting points and must be calibrated with your own samples:

    1. def estimate_complexity(task: dict) -> float:
    2. """Returns a complexity score between 0 and 1. Feature weights should be calibrated with historical samples."""
    3. score = 0.0
    4. score += min(task["input_tokens"] / 4000, 1.0) * 0.4 # Longer input, higher weight
    5. score += 0.3 if task.get("requires_reasoning") else 0.0 # Whether multi-step reasoning is needed
    6. score += 0.3 if task.get("multi_constraint") else 0.0 # Whether there are many constraints
    7. return min(score, 1.0)
    8. def route_request(task: dict) -> str:
    9. score = estimate_complexity(task)
    10. if score > 0.8:
    11. return "L1_model"
    12. if score > 0.4:
    13. return "L2_model"
    14. return "L3_model"

    The routing layer also needs two more definitions. The first is the retry conditions for escalation. For example, escalate to a higher-tier model only when the output fails format validation or its quality score falls below the minimum. Set a maximum number of retries to prevent endless loops. The second is exception handling. When a model times out or returns an error, switch to a backup model and log the reason for the switch, so later troubleshooting is easier.

    5. Step 3: Optimize Prompts to Reduce Wasted Output

    Prompt design also affects token consumption. Different prompt styles can cause noticeable differences in token usage. Measure the actual effect on your own tasks rather than relying on figures from other sources.

    You can adjust prompts in three areas:

    • Specify the output format. Provide a JSON Schema or table field definitions directly. This reduces the format trial and error the model goes through.
    • Limit the output content. For tasks that do not need to show reasoning, explicitly ask for only the final result.
    • Trim the context. Remove chat history unrelated to the current task and keep only the necessary information.

    After every prompt change, rerun the evaluation set and track both token usage and quality metrics. Looking only at lower token counts while ignoring quality changes can easily lead to wrong conclusions.

    6. Step 4: Use Caching to Avoid Repeated Charges

    Tasks such as report generation, data formatting, and template filling often have highly similar inputs. You can add a semantic cache in front of the routing layer. Convert past requests into vectors and store them in a vector database. When a new request arrives, search the cache first. If similarity exceeds a set threshold, return the stored result directly without calling a model.

    The savings from caching depend on the hit rate, which depends on how repetitive the business is and how the threshold is set. A threshold that is too low returns irrelevant results. A threshold that is too high produces a very low hit rate. Use a batch of manually labeled samples to test hit rates and error rates at several thresholds, then choose one.

    Caches also need expiration times. When business data changes, old results must no longer be used.

    7. About Automatic Routing

    Automatic routing hands model selection to a scheduling layer. The scheduler analyzes task features in real time. It considers complexity, the historical success rate of similar tasks, the current load of each model, and the remaining budget, then decides which model to call. If a result does not meet the standard, the scheduler automatically escalates and retries.

    This approach reduces the work of maintaining rules manually, but it also creates new problems. The scheduler depends on data and rules, and its decision logic may be opaque to the team. When it makes a wrong decision, the problem can be hard to trace. For this reason, keep a complete decision log when using automatic routing. Record each request’s features, the selected model, the quality score, and the cost.

    In the test scenario described in this article, automatic routing performed well on cost. However, this conclusion applies only to scenarios where task types are relatively stable and quality can be evaluated automatically. For businesses where task types change quickly or quality is hard to assess automatically, rule-based routing or manual tiering may be safer.

    8. Implementation Steps

    Proceed in the following order to avoid switching all traffic at once.

    Step 1: Audit existing calls. Count the volume of each task type, the average token consumption, the models used, and the total cost. Identify the task types with the highest spending.

    Step 2: Pilot one task type. Choose tasks with clear rules and easily judged quality, and validate them on a small share of traffic.

    Step 3: Set up quality monitoring. Evaluate model outputs automatically and set a quality floor. When the pass rate of a lower-tier model drops, switch the corresponding traffic back to a higher-tier model.

    Step 4: Expand gradually. After each expansion, recheck cost and quality data to confirm the savings still hold.

    9. Data Privacy and Compliance

    In a multi-model architecture, business data may pass through several service providers. Complete the following reviews before integration:

    • Data classification. Distinguish public, internal, and sensitive data, and define which data levels can be sent to external models;
    • Provider review. Confirm each provider’s data retention period, whether data is used for model training, and where data is stored