Design a multi-tenant platform that serves large language models at scale

    An LLM inference platform serves several models to many internal or external tenants on a shared GPU fleet. Unlike classic model serving, cost and latency depend on tokens, not requests: one request can carry a 100K-token prompt and stream for a minute. The design centers on how many concurrent sequences a GPU can hold (KV cache memory), how requests are batched and routed, and how tenants are kept from starving each other.

    AI & Machine Learning, 9 components, about 50 min

    The full guide covers requirements, estimates, the API, the data model, deep dives, trade-offs, failure modes and the follow-up questions interviewers ask.

    Read the full guide on Substack

    Key points

    • Two latency numbers matter: time to first token (prefill) and time per output token (decode).
    • Continuous batching plus a paged KV cache decide how many users one GPU serves at once.
    • Route by prompt prefix so requests sharing a system prompt land where its KV cache already lives.
    • Rate-limit and bill in tokens, not requests: a 100K-token prompt costs 1,000x a short one.
    • Many fine-tunes share one base model as LoRA adapters swapped per request.

    Sign in to track this guide in your curriculum progress.