High LLM Inference Credits Don't Mean Lower Costs
A practical cost-engineering guide to evaluating LLM inference pricing. Learn why a large credit grant is only a spending cap, how to break a bill into four billing items (input, output, cache read, cache write), and why cache hit rate is the hidden variable. Includes a per-request cost formula, a normalized four-step selection method, the real cost boundaries of self-hosted inference, and common evaluation mistakes.
High LLM Inference Credits Don’t Mean Lower Costs
1. The Problem: Credits Are a Cap, Unit Price Is the Slope
A large inference credit grant is often treated as a perk. From a cost-engineering perspective, though, a credit is only an upper bound. What actually determines usable volume is the unit price structure. If the credit is B and the expected cost of one request is c, the number of supported requests is roughly B/c. When c differs by three to four times, the same B buys a volume that differs by an order of magnitude. That is the root cause of “the credit looks huge, but usage never goes up.”
So evaluating whether an inference service is cost-effective cannot rely on the granted credit alone. Four numbers matter: input unit price, output unit price, cache read unit price, and how your requests are distributed across those billing items.
2. Breaking the Bill Into Four Billing Items
Mainstream text model billing typically has four categories: uncached input, cached input (cache read), output, and optional cache write. Their prices are often not on the same scale — cache read can be one to two orders of magnitude cheaper than standard input.
An illustrative relative price table (for showing order-of-magnitude relationships only, not the pricing of any specific product):
Item Relative unit price (standard input = 1)Standard input 1.0Output 3 ~ 5Cache read 0.01 ~ 0.2Cache write 1.0 ~ 1.25
Two conclusions follow. First, output is usually the most expensive part, and long-output workloads amplify the bill far more than long inputs. Second, cache read unit price can range from 0.01 to 0.2, a span of nearly twenty times; even at the same hit rate, a plan whose cache reads cost a dozen times more can end up significantly behind on total cost.
3. Cache Hit Rate Is the Hidden First Variable
The cost of a single request can be written as:
cost = Pin * Lin * (1 - h) + Pcache * Lin * h + Pout * Lout
where Lin and Lout are input and output length, h is the cache hit rate, and Pin, Pcache, Pout are the corresponding unit prices.
Plugging two plans into the same workload makes the source of the gap obvious. Assume Lin=20000, Lout=800, h=0.8:
Plan A (very cheap cache): 20000*0.3*0.2/1e6 + 20000*0.006*0.8/1e6 + 800*1.2/1e6 ≈ 0.00226Plan B (pricier cache) : 20000*1.4*0.2/1e6 + 20000*0.26*0.8/1e6 + 800*4.4/1e6 ≈ 0.01329
Even if Plan B’s cache read looks like it saves a lot, its standard input and output cost three to four times more and its cache read costs more than forty times more, so the per-request cost is still about six times higher. If the credits happen to be on the order of 500 versus 100, the actual number of usable requests may be even lower.
Corollary: any “credit comparison” must first be normalized to expected cost per request; otherwise the conclusion is invalid.
4. Why Cache Cost Is Hard to “Optimize” Down
Cache economics are determined by three layers, most of which are outside the caller’s control:
- Architecture layer. The size of reusable key-value state in the attention mechanism scales with the number of layers, head dimension, and context length. Once the architecture is fixed, cache storage and bandwidth overhead are essentially fixed too, and cannot be reduced from the calling side.
- Engine layer. Prefix reuse, paged cache management, cache eviction policy, and whether cross-request sharing is supported determine the engineering ceiling on hit rate. Implementations differ markedly.
- Session layer. Caches usually have a time-to-live window. Long builds, long test runs, and long reasoning can idle a session past its timeout; once the prefix expires, input has to be billed again. Frequently changing context (inserting timestamps, random ordering, dynamic assembly) also forks the prefix and drops the hit rate sharply.
Practical advice: putting stable content first and volatile content last is the cheapest way to raise the hit rate.
[System prompt + repo conventions + long file context] # stable prefix, keep it byte-identical[Current user instruction] # volatile part goes last[Timestamp/random ID] # move out of the prompt; pass via request headers
5. The Real Cost Boundary of Self-Hosted Deployment
When a platform switches from forwarding to an upstream API to self-hosted inference, the discount room comes mainly from targeted engine-side optimization: operator fusion, quantization, batch scheduling, and higher cache hit rates. That explains how discount rates can reach one or two tenths of list price.
But self-hosting is not free: it needs a GPU resource pool, elastic scaling, fault isolation, and a fallback path. If stability is insufficient, retry costs from interrupted long-running tasks will eat up the unit-price advantage. The more robust engineering practice is therefore to keep multi-backend routing: a low-cost, high-throughput option as primary, a low-latency option as backup, traffic split by task type, with timeouts and automatic fallback configured.
6. Selection Methodology: Four-Step Normalization
- Collect the real distribution. Measure P50/P95 input and output lengths, cache hit rate, and average daily requests.
- Normalize to expected cost per request. Substitute each plan’s prices into the formula above to get comparable
cvalues. - Convert to effective credit. Effective requests ≈ credit /
c, then convert to usable days against your business peak. - Run a sensitivity analysis. Let the hit rate vary between 0.5 and 0.95 and watch whether the ranking flips; if the ranking is unstable, invest in “reusable prefixes” first instead of chasing credits.
7. Common Mistakes
- Looking only at input unit price and ignoring the leverage of output and cache read.
- Using a theoretical hit rate instead of a measured one; long-session scenarios are usually overestimated.
- Overlooking multimodal needs. A plan without image input capability cannot replace others in some R&D scenarios, so no matter how low the price, it is not effective supply.
- Treating a limited-time promotional credit as a basis for long-term capacity planning.
8. Conclusion
A high credit is a marketing signal; the unit cost structure is the engineering fact. Building an evaluation framework of “four billing items + hit rate + effective credit,” combined with prefix stability governance and a multi-backend fallback strategy, is what makes cost decisions reproducible and auditable in an environment where multiple models coexist. If you use relevant general-purpose capabilities from Baidu AI Cloud (such as monitoring and alerting, log services, or container platforms), you can turn the metrics above into dashboards and alert rules, making cost optimization a continuous operation rather than a one-off campaign.
