MLCrack

    ML SYSTEM DESIGN (DEEP DIVES) · INTERVIEW QUESTION

    Design a multi-tenant LLM inference platform serving 10B+ tokens/day across 50+ product teams.

    ⚫ expert · LLM Inference Platform

    Hint: vLLM/TensorRT-LLM, continuous batching, PagedAttention, prefix caching, multi-LoRA, smart routing, per-tenant SLOs.

    Answer

    1. Problem Formulation

    "Build the platform that serves LLMs to internal product teams." This is multi-tenant LLM inference at scale.

    Clarifying questions:

    • Who calls it? ~50 internal product teams, mix of latency-sensitive (chat, autocomplete) and throughput-sensitive (batch summarization).
    • Which models? Mix of OSS (Llama-3.1, Mistral, Qwen) at 8B/70B/405B, plus proprietary fine-tunes. Some teams need their own LoRA adapters.
    • Scale? ~10B tokens generated/day across tenants. Peak ~50k requests/sec, of which ~10% are interactive (need TTFT < 500 ms) and 90% are batch.
    • Constraints? Cost — GPUs are the dominant infra spend. Isolation — one tenant's traffic must not starve another. Compliance — per-tenant data residency, audit logging of every prompt/completion.

    Why ML platform, not just a wrapper around vLLM? Because doing this naively (one vLLM instance per model per tenant) wastes 80% of GPU capacity through fragmentation. The platform's job is to pool GPUs across tenants and models while preserving fairness and SLOs.

    2. Metrics

    SLOs per tenant per model:

    • TTFT (time-to-first-token) p50/p99.
    • TPOT (time-per-output-token) p50/p99 — controls streaming smoothness.
    • Throughput in tokens/sec at SLO compliance.
    • Availability of the model endpoint.

    Cost:

    • $ per million tokens by model.
    • GPU utilization (MFU, model FLOPs utilization, is the right measure; raw GPU% is misleading for LLMs).
    • KV-cache hit rate on prefix caching.

    Quality (for managed models the platform serves):

    • Periodic eval on held-out benchmarks to catch regressions from quantization or kernel changes.

    This is the opening of a longer walkthrough. Read the full answer in the topic explorer, free.

    Likely follow-up: How would you implement disaggregated prefill and decode for higher throughput?