Evaluating LLM Inference Services: Best Practices for Compute Governance

    In production environments, the subjective experience of large language model (LLM) inference services must be translated into measurable engineering metrics. This article explores how to evaluate LLM inference services by breaking down subjective experiences into technical indicators. It covers capacity planning for mixed workloads, root cause analysis and engineering solutions for compute shortages and rate limiting, version iteration strategies, and the critical role of observability in maintaining stable operations.

    In real-world business scenarios, the “usability” of large language model (LLM) inference services often starts as a subjective feel: Are the answers coherent? Is the reasoning rigorous? Is retrieval accurate? Are responses timely? However, once these services enter production, a single Q&A experience must evolve into an operable, measurable, and governable engineering system. Otherwise, during traffic spikes, version switches, or compute supply fluctuations, user experience can quickly degrade from “smart” to “unavailable.” Starting from real-world user experience, this article discusses how to decompose subjective feelings into technical metrics and build a comprehensive practice framework around compute capacity, rate limiting, version iteration, and client resilience.

    1. From “Feel” to Metrics: Experience Evaluation Beyond Single Answers

    The experience of LLM inference services usually encompasses multiple dimensions: logical reasoning, factual consistency, long-context retention, retrieval-augmented generation (RAG) accuracy, response latency, concurrency stability, and quota limit trigger frequency. For work-oriented tasks, users focus more on multi-step reasoning, constraint satisfaction, and structured output. For daily life and search tasks, users care more about recall quality, timeliness, and naturalness of expression in open-domain Q&A. Relying solely on subjective evaluation for these capabilities often leads to bias, such as “great one time, terrible the next.”

    A more reliable approach is establishing a tiered evaluation set. The first tier is a general capability set, covering multi-step reasoning, fact verification, instruction following, and format constraints. The second tier is a business scenario set, covering RAG, summary extraction, code comprehension, and tabular Q&A. The third tier is a stability set, focusing on result consistency, timeout rates, and rate-limiting frequencies of the same query across multiple invocations. Evaluation metrics should include both quality and engineering metrics, such as task pass rate, human preference win rate, factual error rate, P95/P99 latency, call success rate, rate limit trigger rate, and cost per successful request. Only by breaking down the “sense of intelligence” into reproducible evaluation items can version iteration and capacity governance be grounded.

    2. Real-World Loads Are Typically a Mix of Three Request Types

    Inference requests in production environments are rarely of a single type but rather a mix of at least three workloads: interactive short requests, long-context analysis requests, and RAG requests. Interactive short requests prioritize time-to-first-token (TTFT) and streaming output experience. Long-context requests consume more GPU memory and compute resources, easily extending queue times. RAG requests depend on external retrieval, reranking, and context concatenation, resulting in longer pipelines and more failure points. If a platform allocates quotas solely based on request counts without considering input length, output length, and computational complexity, it is prone to situations where “the request count isn’t exceeded, but compute is exhausted by long requests.”

    Therefore, capacity planning should shift from “request count” to “approximate compute volume.” A cost estimation model can be built using input tokens, output tokens, context length, concurrency, and model size, with different quotas set for different business tiers. For high-priority businesses, reserve dedicated concurrency pools or exclusive capacity; for low-priority batch tasks, allow queuing during off-peak hours or degradation to smaller models. This ensures core experience while improving overall resource utilization.

    3. Engineering Root Causes of Compute Shortages and Rate Limiting

    When users feel “rate limited after a single use,” the surface cause is quota triggering, but the underlying issues usually involve capacity supply, traffic spikes, request cost estimation errors, and improper client retry strategies. If multiple clients retry immediately upon hitting a rate limit, it amplifies instantaneous pressure, creating a retry storm. If the server lacks queuing and prioritization mechanisms, short requests may be blocked by long ones. If monitoring only tracks total call volume without breakdowns by model size, input length, tenant, and error code, bottlenecks become hard to locate.

    Governing rate limiting requires collaboration between the server and the client. The server should provide clear quota dimensions, error code semantics, and retry recommendations, controlling ingress traffic via token buckets, sliding windows, or concurrency semaphores. For long requests, set maximum context, timeout, and cancellation mechanisms; for cacheable requests, use result caching or semantic caching; for batch tasks, use queues for peak shaving. The client should implement exponential backoff with jitter, idempotent request identifiers, timeout circuit breakers, and fallback degradation to avoid invalid retries.

    1. function call_with_resilience(request):
    2. for attempt in 0..max_retries:
    3. if not token_bucket.try_acquire(cost=estimate_cost(request)):
    4. sleep(backoff(attempt) + jitter())
    5. continue
    6. response = invoke(request, timeout=dynamic_timeout(request))
    7. if response.status in {OK, BUSINESS_ERROR}:
    8. return response
    9. if response.status == RATE_LIMITED:
    10. sleep(backoff(attempt) + jitter())
    11. continue
    12. if response.status == SERVER_ERROR:
    13. circuit_breaker.record_failure()
    14. sleep(backoff(attempt) + jitter())
    15. continue
    16. return degraded_response_or_error()

    The pseudocode above emphasizes three principles: rate limit errors should trigger backoff rather than immediate retries; retries must have a cap and include jitter; when consecutive failures reach a threshold, trigger a circuit breaker and return a degraded result instead of continuing to pile up requests.

    4. Version Iteration Requires Canary Releases and Regression Testing

    Between the preview and official versions of an inference model, there is usually a period of capability adjustments and bug fixes. For business stakeholders, a version upgrade cannot be treated as a simple “API swap.” A new version might be stronger in logical reasoning but could change format compliance, refusal strategies, latency, or quota consumption. Therefore, version switching should undergo regression testing, canary release, and rollback phases. Regression testing should cover core business sets and historical failure samples; canary releases should gradually increase traffic by tenant, traffic proportion, or request type; rollback plans should retain old version routing capabilities and ensure quick configuration switching.

    For multi-model routing scenarios, different sizes can be selected based on task type: high-complexity tasks go to high-quality models, low-complexity tasks to lightweight models, and RAG focuses on evaluating context compression and citation consistency. Routing strategies should be configurable and observable, avoiding hardcoding business logic in the client.

    5. Observability is the Foundation of Stable Operations

    Without observability, rate limiting and version issues can only be discovered through user feedback. It is recommended to collect at least call volume, success rate, error code distribution, rate limit trigger rate, P95/P99 latency, input/output length distribution, retry count, circuit breaker count, and cost per successful request. Logs should retain request IDs, tenant IDs, model sizes, version numbers, and latency breakdowns, but must not log sensitive content. Alerts should distinguish between capacity alerts, error rate alerts, and experience alerts, such as increased TTFT, sudden spikes in rate limiting, or abnormal failure rates for a specific version.

    Regarding platform capabilities, you can leverage general capabilities provided by Baidu AI Cloud—such as container platforms, log services, monitoring and alerting, message queues, and object storage—to build elastic scaling, log collection, alert linkage, and asynchronous queue peak shaving solutions. The key is to treat the inference service as a complete online system operation, rather than just focusing on the single-time output quality of the model.

    6. Conclusion

    The experience evaluation of LLM inference services cannot stop at “feel.” It requires an indicator system that balances quality, latency, stability, and cost. Compute governance needs to shift from request count quotas to compute volume estimation, controlling traffic collaboratively through server-side rate limiting, queuing, caching, and client-side backoff retries. Version iteration should adhere to regression testing, canary releases, and rollbacks. Only by transforming subjective experience into measurable, governable engineering practices can business stability be maintained amid compute fluctuations and version changes.