As asked
You need to serve a 7B parameter instruction-tuned LLM for a production application with a p99 latency target of under 2 seconds for 200-token responses. Design the inference infrastructure, including model serving, batching strategy, scaling, and observability.
Sample answer outline
A strong design uses vLLM or TGI with continuous batching on A10G or A100 GPUs, quantized to INT8 or FP8 to increase throughput per GPU. At 100k req/day (~1.15 req/s average) a single well-optimized GPU likely suffices with autoscaling headroom. Load balancing across 2 to 3 replicas handles burst traffic. Observability: per-request TTFT, TPS, queue depth, GPU utilization, and KV cache hit rate. A CDN or Redis cache for repeated identical prompts reduces load. Streaming responses via SSE minimizes perceived latency even before generation completes.
Expect these follow-ups
- How does your design change if the p99 latency target drops to 500ms?
- How would you handle model versioning and safe rollouts when deploying a new fine-tuned version?