Preparing your design workspace

Loading the problem and your latest saved attempt…

Optimize LLM Inference Across Model and Infrastructure

Improve the latency and unit cost of an existing streaming LLM service while protecting answer quality and safe rollout.

Problem statement

For this exercise, assume an existing multi-tenant service streams answers from one approved decoder-only language model. A request carries tenant identity, input-token and output-token bounds, sampling settings, a deadline, and a pinned model/runtime release.

Your task is to optimize the deployed inference path using both infrastructure and model-side changes. Compare candidates against the current release on the same offered workload, including queueing, prefill, decoding, accelerator memory, output delivery, failures, and answer quality.

A request must never switch model/runtime release midstream. Compare the same offered short/long mix under the same decoding and output-bound policy, including cost over the identical baseline-completed request IDs in a fixed paired replay cohort; report any newly completed replay cases separately.

A cost improvement is invalid if baseline-completed replay requests fail, either live tier completes a smaller share of offered work, answers merely grow longer, or the critical safety suite weakens.

Design the measurement loop, admission and routing, serving-worker scheduling and memory behavior, model-variant evaluation, canary promotion, and rollback. You may discuss batching, prefix or key-value reuse, precision changes, smaller models, or draft-assisted decoding where justified; no one technique is required.

The workload and targets below are practice assumptions. Training a new foundation model, prompt authoring, conversation storage, and application policy design are outside scope.

What to build

  1. An admitted client can receive ordered streamed output from one pinned model/runtime release with a definitive completion or failure outcome.
  2. The service can validate token and deadline bounds, admit or reject work predictably, and route short and long requests to compatible accelerator capacity without starving a tenant.
  3. Operators can compare a proposed infrastructure or model variant with the baseline on the identical baseline-completed request IDs in paired replay and matched short/long live offered traffic, per-tier admission and completion, comparable output policy and length, latency, GPU cost per completed request and per output token, quality, and critical safety slices; newly completed replay cases are reported separately.
  4. Operators can canary, promote, pause, or roll back an immutable model/runtime release while keeping each in-flight request on its pinned release.

At scalePractice assumption

  • Peak offered load is 100 requests per second; 75 percent have at most 2,000 input and 300 output tokens, while the rest may have 16,000 input and 1,000 output tokens.
  • For the short-request tier, p95 time to first token is below 2 seconds and p95 inter-token gap is below 100 milliseconds under normal peak load.
  • Lower GPU-seconds per completed request by at least 25 percent when both releases are compared over the identical baseline-completed request IDs in a fixed replay cohort with the same decoding/output-bound policy; the candidate must complete every such request, and newly completed replay cases are reported separately. Also report GPU-seconds per 1,000 delivered tokens and output lengths. On live matched short/long offered traffic, neither tier may reduce its admitted or completed share of offered requests.
  • A fixed task suite scores each case pass or fail; its overall pass rate may lose no more than one percentage point, critical safety cases may not regress, and a candidate starts at a 5 percent canary before promotion.