Production LLM Inference Server with Continuous Batching
Week 6 milestone
An enterprise mandate: the platform team needs a launched inference product that holds a strict latency SLO while maximizing GPU throughput. Build (or extend a serving engine into) an inference service that implements a KV cache with paged memory management, iteration-level continuous batching, and a request scheduler that balances time-to-first-token against tokens-per-second. The deliverable is not a benchmark notebook — it is a directly deployable, hyperscalable product: a real public API and a clean playground UI, CI/CD, autoscaling across replicas, production observability for tokens-per-second and latency percentiles, security on the endpoint, and full marketing (landing page, pitch, demo) so it is presentable as a real product. Measure it honestly under load. The GPU is the most expensive thing in the building; idle cycles are a defect. We are not here to babysit it; ship it as a real product.
Why it matters: Inference serving is where AI cost is won or lost; a 2x throughput gain is a direct margin gain for any company running models. Shipping a measured, SLO-holding inference server makes a builder a credible AI Infrastructure or Inference Engineer, an in-demand frontier role because it converts directly into saved spend.
The deliverable
A publicly hosted inference service with a stable URL and a clean playground UI, plus a public repo: the batching scheduler and KV-cache manager, an autoscaling deployment, CI/CD on every commit, production observability dashboards, a load-test harness, a benchmark report comparing static versus continuous batching across concurrency levels, a marketing landing page, a 10-slide pitch, a recorded demo, and a README explaining the memory, scheduling, and scaling design.
What it ships
- An OpenAI-compatible HTTP API (chat/completions, streaming) so the service is a drop-in for existing clients.
- A paged KV-cache manager that eliminates memory fragmentation and supports prefix sharing across requests.
- Iteration-level continuous batching so new requests join the running batch without waiting for it to drain.
- A request scheduler with configurable priority and a tunable time-to-first-token versus throughput policy.
- Token-level response streaming over server-sent events or WebSocket.
- A clean playground UI to send prompts, watch streaming output, and see live latency and throughput.
- A live metrics dashboard: tokens-per-second, time-to-first-token, queue depth, GPU memory, and KV-cache utilization.
- Autoscaling across replicas driven by queue depth, with health and readiness probes.
- A built-in load-test harness that sweeps concurrency and emits a static-vs-continuous-batching benchmark report.
- API-key authentication and per-key rate limiting on the endpoint.
- Graceful degradation and request shedding when the GPU is saturated, instead of timeouts.
Stack you orchestrate
vLLM or a from-scratch serving loopPyTorchCUDAPythona load-testing tool (Locust or k6)PrometheusDocker
Market signal, who wants thisInference is now a FinOps problem: at production scale it accounts for over 80% of AI GPU spend, and software optimization alone has driven cost-per-million-tokens down 5x on new hardware within months. A funded infrastructure category has formed around exactly this product — vLLM, Runpod (FlashBoot sub-250ms cold starts), BentoML, and Yotta Labs — because self-hosting beats managed APIs on unit economics above ~100M tokens/month. Investors fund inference platforms because every company running open-weight models needs to cut serving cost without losing quality.
How it is graded
- The server implements paged KV-cache management and iteration-level continuous batching.
- A request scheduler is present and its time-to-first-token versus throughput tradeoff is documented.
- The service is deployed publicly with a clean playground UI, CI/CD on every commit, and autoscaling across replicas.
- Production observability tracks tokens-per-second and latency percentiles, and the endpoint is secured.
- A load-test report shows throughput and latency percentiles across concurrency levels, with continuous batching measurably compared against a static-batching baseline.
- GPU memory usage and KV-cache fragmentation are reported with the design that controls them.
- The project ships complete marketing — a landing page, a 10-slide pitch, and a recorded demo.
- The service is publicly reachable and reproducible, with a clear benchmark methodology.
Bridges to Operating Systems — scheduling, virtual memory, and throughput optimization