Multi-Model LLM Inference Costs: Fitting Real Usage Data and Tiered Scheduling in Practice
This article explains how to estimate the relative cost of different LLM models when a platform shows only a credit balance and usage records instead of per-token prices. It covers fitting a linear cost model with least squares, checking whether the fit is reliable, converting prices into usable token budgets, and routing tasks across model tiers to control spending.
1. Why Quantify Costs Instead of Relying on Intuition
Developers rarely rely on a single model today. A common setup connects to several model providers at once, or uses an aggregated subscription quota where credits or points are deducted from one shared pool, and each model consumes them at a different rate. Prices vary enormously between models. Without knowing the relative costs, it is easy to use the most expensive model for the simplest tasks, and the budget can drain without anyone noticing.
Many platforms do not publish the credit cost per million tokens directly. They show a quota and a usage history instead. A practical approach is to fit a linear model to actual usage records and infer each model’s relative consumption rate. This is the first core practice this article covers.
2. Inferring Consumption Rates from Usage Records: Method and Reliability
2.1 The Basic Approach
Billing is usually linear:
total cost = input tokens × input price + output tokens × output price
With enough call records, each containing the input token count, the output token count, and the credits actually deducted, you can set up a system of linear equations. Least squares then solves for each model’s input and output unit prices.
Sample code:
import numpy as np# Each record: [input_tokens, output_tokens]; the label is the actual credits deductedX = np.array([[in_1, out_1],[in_2, out_2],# ...])y = np.array([cost_1, cost_2, ...])coef, *_ = np.linalg.lstsq(X, y, rcond=None)price_in, price_out = coef
2.2 Judging Whether the Fit Is Reliable
Two indicators matter most:
- A coefficient of determination (R²) closer to 1 means a better fit. In one test, usage records for several models in the same quota pool were fitted separately. The result was R² = 1.0 with residuals near zero. This indicates that deductions are strictly linear, and the inferred unit prices matched the actual charges.
- Samples should cover different input-to-output ratios. If every record has nearly the same ratio, the two coefficients become collinear, and the fit becomes unstable. Deliberately make some calls with long inputs and short outputs, and others with short inputs and long outputs.
3. Measured Results: Cost Gaps Between Models Are Larger Than Expected
In one reverse-engineering test against an aggregated subscription quota, the results showed a price range spanning several orders of magnitude. All figures are relative values, not official prices:
- Flagship model: output on the order of 400,000 credits per million tokens, and input about 80,000.
- Mid-tier reasoning model: input about 30,000, and output about 110,000.
- Lightweight fast model: input only a few thousand, and output under 10,000.
- Small minimal model: input and output both about 2,000 credits per million tokens.
Three findings stand out.
First, the output cost of the most expensive and cheapest models differs by roughly two orders of magnitude (about 200x). Running batch generation on the flagship model therefore consumes the quota about 100 times faster.
Second, output is generally 3 to 5 times more expensive than input. Cost control should start with output length. Having the model give shorter, more focused answers saves more than trimming the prompt.
Third, cache hits are cheap enough to ignore. In one test, a model’s cached input price was about 2% of its normal input price. For workloads that repeatedly send long context, such as multi-turn conversations, agent loops, and codebase Q&A, enabling context caching is the most cost-effective optimization available.
4. Converting Prices into How Long a Quota Lasts
Relative prices answer one question. A more practical question is how many tokens each model can process under a fixed quota.
Assume the quota refills 60,000 credits every 5 hours, with a weekly cap of 600,000 credits. Also assume a typical call is 80% input and 20% output, and that caching is not counted. The weighted cost per million mixed tokens is:
cost = 0.8 × input price + 0.2 × output price
Substituting the inferred prices gives estimates for a single 5-hour window:
- Flagship model: roughly 400K tokens.
- Mid-tier reasoning model: about 1.25M tokens.
- Lightweight fast model: on the order of 10 million tokens.
- Small minimal model: on the order of tens of millions of tokens.
With the same quota, choosing the right model can provide close to 100 times more usable tokens. Running this conversion should be a required step before designing any call pipeline.
5. Tiered Scheduling: Expensive Models Think, Cheap Models Execute
Based on this quantified view, you can design a multi-model architecture with clear roles. The core principle is to assign high-density tasks to expensive models and high-volume tasks to cheap models.
A typical four-tier split looks like this:
- Planning and final review: flagship model. This covers task decomposition, solution design, and review of final code or documents. These calls are few and high in value, so the strongest model is worth using.
- Complex reasoning: mid-tier model. This covers tasks that need a deep chain of logic at moderate frequency, such as algorithm design and hard bug diagnosis.
- Main execution: lightweight fast model. This covers high-frequency work such as code completion, routine rewriting, and single-step tool calls. These tasks make up most token consumption, so they need a cost-effective model.
- Batch simple tasks: small minimal model. This covers classification, tagging, format cleanup, and initial summarization. These tasks can run in large parallel batches and tolerate errors well.
For implementation, a routing layer can dispatch requests by task type:
def route(task):if task.type in ("plan", "review"):return call_model("flagship", task)elif task.type == "reasoning":return call_model("mid", task)elif task.type == "batch_simple":return call_model("lite", task)return call_model("flash", task) # Default to the main execution model
6. Further Cost-Reduction Techniques
Besides model tiering, several general techniques are effective:
- Maximize cache hits. Place unchanging system prompts and repository context at the start of each request, and reuse them. In one test, this cut the cost of that input to about 2% of the original.
- Compress output. Explicitly ask the model to return only conclusions and necessary code, without long explanations. Output is priced higher, so reducing it saves the most.
- Start small, then escalate. Use a small model for initial screening, and send only low-confidence samples to the expensive model. This forms a funnel of calls.
- Monitor and alert. Set alerts on the rate of quota consumption, so a runaway agent loop cannot exhaust a whole week’s budget within hours. Common cloud monitoring and logging services can be configured for this.
7. Conclusion and Caveats
The price data in this article comes from personal measurements and inference. It is not official pricing from any platform, and specific rules may change at any time. The method matters more than the numbers. Fit a linear model to infer real consumption rates, convert the quota into usable tokens, and then design scheduling that uses expensive models for thinking and cheap models for execution. With these three steps, you can maximize output within a fixed budget, regardless of which model service you use.
