# Managing LLM Service Stability Under GPU Capacity Constraints

    How do large model providers keep services stable when GPU capacity can't keep up with demand? This article walks through engineering practices for token-based capacity planning, tiered rate limiting, graceful degradation, and layered architecture design for domain-specific LLM applications.

    1. The Gap Between Capital Hype and Engineering Reality

    Recent industry news presents a striking contrast: a leading large model company completed multiple rounds of massive funding within months, pushing its post-money valuation into the hundreds of billions of dollars, with industrial investors dominating its cap table. Meanwhile, over the same period, the platform tightened free-tier usage limits and experienced dozens of service outages or performance degradations in a single year.

    These facts aren’t contradictory — they are two sides of the same constraint. Funding solves the long-term capacity expansion problem: purchasing accelerator cards, building data centers, and scaling training clusters, all measured in quarters or years. But user requests arrive at second-level granularity. Until new capacity comes online, any inference service must answer an engineering question: with limited compute, how do you extract the maximum effective throughput from a finite request budget — without falling over?

    Reading the valuation as tech news is a misreading. Reading it as an input to capacity planning is the correct interpretation.

    2. Turning “Compute Constraints” into Measurable Metrics

    Constraints can’t be managed until they’re measured. A mature inference service should track at least four categories of metrics:

    • Saturation: GPU memory usage, SM utilization, and batch queue wait time;
    • Effective throughput: output tokens per second (not requests per second), because long-text requests can cost one to two orders of magnitude more compute than short ones;
    • Latency distribution of queueing: P50/P95/P99 — averages are nearly meaningless in inference scenarios;
    • Failure and degradation ratios: timeout rate, rate-limit rejection rate, and the proportion of requests falling back to smaller models.

    A common misconception is using QPS as the sole unit of capacity. With autoregressive generation, cost is roughly proportional to a weighted combination of input length + output length², so capacity planning must be converted into a token budget:

    1. # Example: converting request counts into a compute budget
    2. def cost_units(req):
    3. # Simplified model: prefill is linear, decode scales with output length
    4. return req.input_tokens + 0.5 * req.output_tokens ** 1.2
    5. def admit(requests, budget):
    6. admitted, deferred = [], []
    7. used = 0.0
    8. for r in sorted(requests, key=lambda x: x.priority): # high priority first
    9. c = cost_units(r)
    10. if used + c <= budget:
    11. admitted.append(r); used += c
    12. else:
    13. deferred.append(r)
    14. return admitted, deferred, used

    3. Tiered Quotas and Rate Limiting: Giving Scarce Resources to the Requests That Need Them Most

    Tightening free-tier usage is, at its core, Tiered QoS. Four design principles:

    1. Multi-dimensional quotas: limit requests per minute, tokens per minute, and concurrent sessions simultaneously, so no single dimension can be bypassed;
    2. Token buckets over fixed windows: fixed windows produce double bursts at boundaries; token buckets are naturally smooth;
    3. Priority queues: paid and business-critical requests go first; interactive requests take precedence over batch offline jobs;
    4. Explainable rejections: return a clear retry time and remaining quota, turning rate limiting from a “failure” into “expected behavior.”
    1. import time
    2. from collections import deque
    3. class TokenBucket:
    4. def __init__(self, rate, capacity):
    5. self.rate, self.capacity = rate, capacity
    6. self.tokens, self.ts = capacity, time.monotonic()
    7. def allow(self, need=1.0):
    8. now = time.monotonic()
    9. self.tokens = min(self.capacity, self.tokens + (now - self.ts) * self.rate)
    10. self.ts = now
    11. if self.tokens >= need:
    12. self.tokens -= need
    13. return True, 0
    14. return False, (need - self.tokens) / self.rate # suggested wait in seconds

    4. Stability Engineering: From Passive Firefighting to Active Degradation

    Dozens of outages signal a lack of graceful degradation. Four actionable defense layers:

    • Circuit breaking: set error-rate thresholds on downstream dependencies (vector retrieval, content moderation, external tool calls). Once triggered, fail fast to prevent threads and GPU memory from being exhausted;
    • Degradation chain: large model → smaller model → retrieval-based QA → static fallback responses, stepping down load level by level;
    • Overload protection: when queue length exceeds a threshold, reject new requests outright (Load Shedding) to protect the completion rate of in-flight requests;
    • Canary releases and rollback: version everything — model weights, prompt templates, inference parameters — so you can roll back within minutes when something breaks.
    1. class CircuitBreaker:
    2. def __init__(self, fail_threshold=5, cooldown=30):
    3. self.fail, self.threshold, self.cooldown = 0, fail_threshold, cooldown
    4. self.opened_at = 0
    5. def call(self, fn, *a, **kw):
    6. if self.opened_at and time.monotonic() - self.opened_at < self.cooldown:
    7. raise RuntimeError("circuit open, fallback engaged")
    8. try:
    9. r = fn(*a, **kw); self.fail = 0; return r
    10. except Exception:
    11. self.fail += 1
    12. if self.fail >= self.threshold:
    13. self.opened_at = time.monotonic()
    14. raise

    5. Domain-Specific Models: A Layered Approach, Using Healthcare as an Example

    Another recent development was a platform releasing a model family targeted at healthcare. Stripping away the branding, the reusable lesson here is layered construction of domain models:

    Layer Goal Key Constraints
    Foundation layer General language and reasoning capability Corpus scale, training compute
    Domain increment layer Terminology, guidelines, literature knowledge Data licensing and traceability
    Task adaptation layer Structured extraction, summarization, coding mapping Annotation consistency, evaluation sets
    Application safety layer Output moderation, citation tracing, human review Compliance and accountability boundaries

    In healthcare, the hard requirements aren’t about model capability but about controllability: conclusions must be traceable to authoritative literature; the system must not output diagnoses or medication recommendations; human review must remain in the loop; and training and inference data must be de-identified and comply with data classification requirements. In practice, this is typically achieved by using retrieval-augmented generation (RAG) to constrain generation to licensed corpora, combined with a rules engine for pre- and post-validation.

    6. Reference Architecture and General Cloud Capability Mapping

    An architecture that supports these requirements typically combines the following general capability categories:

    • Access layer: API gateway handling authentication, quotas, routing, and traffic splitting;
    • Compute layer: container platform hosting inference services, with autoscaling to handle peak-valley fluctuations;
    • Data layer: object storage for corpora and model artifacts, and message queues to smooth traffic peaks and support offline batch processing;
    • Observability layer: logging services plus monitoring and alerting, with threshold-based alerts on token budgets, P99 latency, and circuit breaker trips;
    • Security layer: key management, data masking, and audit trails.

    7. Implementation Checklist

    1. Have you switched your capacity unit from QPS to a token budget?
    2. Is your rate limiting multi-dimensional, smooth, and explainable?
    3. Do you have a complete degradation chain, with regular failure drills?
    4. Are models and prompt templates versioned and rollback-ready within minutes?
    5. Do domain scenarios support citation tracing and human review?
    6. Is sensitive data de-identified and governed by classification policies?
    7. Do you calculate unit economics on token cost rather than request count?

    Conclusion

    Valuation numbers belong to capital markets; token budgets, P99 latency, and degradation chains belong to engineering teams. When compute supply is structurally slower to expand than demand, service quality stops being about who has the biggest model — and becomes about who can schedule scarce resources more precisely, rate-limit more honestly, and degrade more gracefully. This is the reality of serving large models today, and an engineering challenge the industry cannot avoid for years to come.