Behind Tighter Free Tiers: Quota Design for LLM Inference

    Why do LLM providers cut free quotas first? This article explains the GPU memory and compute economics behind free-tier limits, how KV cache grows with long conversations, why architectural optimizations can't replace quotas, and how to design token-based rate limiting with a token bucket, context trimming, and layered deployment for your own LLM service.

    Why Free Services Cut Quotas First

    The main cost of LLM inference comes from GPU compute and memory. When a service has many free users with long individual sessions, the provider cannot monetize traffic the way a content platform can—it can only control resource consumption through quotas.

    There is a structural contradiction here. User demand can multiply within days, but data center construction, chip procurement, and deployment are typically measured in months or even years. Demand is elastic; supply is rigid. The time gap between them can only be bridged by throttling. This is why providers usually tighten the free tier first and expand capacity gradually.

    For developers, understanding this is valuable. A quota message does not always indicate a service failure; often it is a deliberate, protective scheduling policy. Judging whether a service is reliable requires looking at its throttling rules, capacity expansion pace, and business model together.

    Why Long Conversations Consume So Much Memory

    Large language models generate tokens autoregressively, one at a time. To produce each new token, the model needs the attention key-value vectors of all previous tokens. To avoid recomputation, these vectors are stored—this is the KV cache.

    The size of the KV cache can be estimated with the following formula:

    1. def kv_cache_bytes(layers, kv_heads, head_dim, seq_len, batch, bytes_per_elem=2):
    2. # K and V are each stored once, hence the factor of 2
    3. return 2 * layers * kv_heads * head_dim * seq_len * batch * bytes_per_elem
    4. # Example config: 32 layers, 32 KV heads, head dim 128, FP16, 4096 tokens, single session
    5. size = kv_cache_bytes(32, 32, 128, 4096, 1)
    6. print(f"{size / 1024**3:.2f} GiB") # outputs roughly 2.00 GiB

    The number above is based on a hypothetical model architecture, not the parameters of any specific product. It illustrates a general rule: the cache footprint of a single session scales linearly with context length.

    The problem is that long conversations keep accumulating this footprint. The more turns, the longer the context, the larger the cache. Moreover, a session often keeps occupying memory for a while after the user leaves. When many long sessions run concurrently, memory pressure does not grow linearly—it is amplified by both concurrency and context length. Once memory is exhausted, every new request must queue, and overall throughput drops.

    This also explains why heavy users, long-document reading, and code analysis scenarios hit limits most easily. The context of such requests is often tens of times larger than that of ordinary Q&A.

    Why Architectural Optimizations Cannot Replace Quotas

    The industry commonly uses several techniques to reduce KV cache costs:

    • Reducing per-token storage overhead: for example, low-precision quantization, or grouped-query attention and attention-structure compression to reduce the number of cached heads and dimensions.
    • Tiered cache storage: keeping hot data in GPU memory, warm data in host memory, and cold data on disk, swapping in on demand.
    • Reusing shared prefixes: when multiple requests share the same system prompt or document prefix, computing and caching it only once.

    These techniques lower per-unit consumption but cannot fundamentally eliminate resource contention, for two reasons.

    First, when unit costs drop, users tend to use more. This is a classic demand-elasticity effect: the resources saved are quickly swallowed by new usage.

    Second, providers typically run multiple workload types simultaneously—free interactive traffic, paid or API calls, model training and evaluation. These workloads share the same resource pool. Even if each is optimized, the scheduling layer still has to make trade-offs among them, and quotas are the most direct scheduling tool available.

    Common Quota Design Approaches

    Each quota dimension involves trade-offs. The table below summarizes common approaches:

    Quota dimension Approach Advantages Main risks
    By request count A fixed number of requests per day Simple rules, easy for users to understand A very long request costs the same quota as a short one; long-context users are penalized
    By token count Quota accumulated over input and output tokens Closely tracks real compute cost Requires pre-estimation or real-time counting; harder to explain
    By concurrency Limits simultaneous sessions or requests Protects service stability Does not cap total volume; high-frequency users can still exhaust resources
    By time window Daily or hourly quotas Easy to control peaks Quota tends to run out during peak hours, causing uneven experience
    Tiered by user level Paid/API traffic prioritized over free users Clear resource allocation Free users face unstable queue times; transparent messaging needed

    From a cost-control perspective, token-based quotas are the most reasonable. From a user-experience perspective, request-count quotas are the most intuitive. In practice, most services combine approaches—for example, metering by tokens while also enforcing concurrency caps and time-based protective thresholds.

    User Experience and Rule Transparency

    The most common user frustration comes from vague messages. When the system only shows “service busy” or “quota exceeded,” users cannot tell whether they are hitting temporary congestion or have genuinely used up their quota.

    A better practice is to distinguish the two states and return standard responses at the API layer:

    • Quota exhausted: return HTTP 429 (Too Many Requests) with the quota reset time.
    • Service congestion: return HTTP 503 (Service Unavailable) and suggest retrying later.

    Additionally, the client can display remaining quota, estimated reset time, and actionable suggestions such as shortening the context. The more transparent the rules, the higher user acceptance of limits.

    Practical Approaches for Self-Built Services

    The following section uses a self-hosted LLM service as an example and presents three implementable directions.

    1. Token-Metered Quota Control

    The token bucket is a common rate-limiting algorithm. It allows short bursts while constraining the long-term average rate. By replacing the “tokens” in the bucket with model token quota, you can rate-limit by compute consumption:

    1. import time
    2. class TokenBucket:
    3. def __init__(self, capacity, refill_rate):
    4. self.capacity = capacity # maximum bucket capacity (in tokens)
    5. self.tokens = capacity
    6. self.refill_rate = refill_rate # tokens refilled per second
    7. self.last = time.monotonic()
    8. def allow(self, cost):
    9. now = time.monotonic()
    10. elapsed = now - self.last
    11. self.tokens = min(self.capacity, self.tokens + elapsed * self.refill_rate)
    12. self.last = now
    13. if self.tokens >= cost:
    14. self.tokens -= cost
    15. return True
    16. return False
    17. def estimate_cost(prompt_tokens, max_output_tokens):
    18. # Pre-charge input plus maximum output length before the request;
    19. # settle against actual usage after completion
    20. return prompt_tokens + max_output_tokens

    The pre-charge mechanism prevents users from bypassing quotas through concurrent requests. After the request completes, the difference is refunded based on actual output, making billing closer to real consumption.

    2. Controlling Context Growth

    The cost of long conversations mainly comes from the accumulation of history messages, so the server should actively manage context length. Common practices include sliding-window truncation, rolling summaries, and semantic compression of history.

    Below is a simple truncation function that keeps the most recent messages. In a real implementation, the system prompt should always be preserved:

    1. def trim_history(messages, max_tokens, count_tokens):
    2. kept, total = [], 0
    3. for msg in reversed(messages):
    4. cost = count_tokens(msg["content"])
    5. if total + cost > max_tokens:
    6. break
    7. kept.append(msg)
    8. total += cost
    9. return list(reversed(kept))

    Truncation loses earlier information, so it must be combined with business judgment. For example, in document Q&A scenarios, key passages can be stored in an external retrieval system instead of keeping the entire content in the conversation history.

    3. Monitoring and Layered Deployment

    Effective throttling requires metric support. It is recommended to track at least the following:

    • Time to first token (TTFT) and per-token generation latency
    • GPU memory utilization and KV cache hit rate
    • Request queue time and the ratio of 429 and 503 responses
    • Average session length and its long-tail distribution

    Layered deployment can further isolate workloads. For example, set up separate queues and resource pools for free traffic versus paid or API traffic. When capacity is exceeded, the system can degrade first: shorten the maximum output length, switch to a smaller model, or temporarily defer non-critical tasks. Degradation keeps the service available more easily than outright rejection.

    Takeaways for Enterprise Users

    When selecting and using LLM services, enterprises should pay attention to the following:

    1. Do not treat free tiers as production dependencies. Free quotas can change at any time; production systems need explicit quotas and service-level agreements.
    2. Estimate costs by tokens. Evaluation should account for input length, output length, and call frequency together, not just per-call pricing.
    3. Prepare fallback and switching plans. Build an abstraction layer for model calls in the application so that switching between services costs as little as possible.
    4. Review data processing terms. Long conversations leave behind large amounts of context data; confirm retention periods and permitted uses.