Hit Latency SLOs for a Customer's Code Completion LLM
Last updated: November 29, 2026
Quick Overview
A customer wants to serve a fine-tuned 32B code model for IDE autocomplete with p95 time to first token under 200 ms and at least 60 output tokens per second per user, at the lowest GPU cost. Design the serving configuration and explain which optimizations you would try and how you would measure them.
Baseten
November 29, 20260
0
0 solved
A customer wants to serve a fine-tuned 32B code model for IDE autocomplete with p95 time to first token under 200 ms and at least 60 output tokens per second per user, at the lowest GPU cost. Design the serving configuration and explain which optimizations you would try and how you would measure them.
Baseten's model performance and forward deployed engineers spend much of their time tuning customer LLMs for a target latency and cost using quantization, speculative decoding, batching limits and hardware choice. The interviewer wants a measurement-driven plan, not a list of buzzwords.
What the Interviewer Expects
- Separates prefill-bound TTFT from decode-bound per-token latency and names what drives each
- Proposes a benchmark harness with realistic prompt and output length distributions before tuning
- Evaluates FP8 quantization with a quality check on the customer's own eval set
- Explains speculative decoding (draft model or n-gram/lookahead) and why code completion suits it
- Chooses batch size or concurrency limits from the latency versus throughput curve
- Considers prefix caching for repeated file context and tensor parallelism trade-offs
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- Speculative decoding helps at batch 1 but hurts at batch 32. Why?
- How would you detect a quality regression from FP8 that average benchmarks miss?
- Traffic is bursty around working hours in two time zones. How does that change the hardware choice?
- When would you split prefill and decode onto different GPUs?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
Workload: prompts around 2 to 6k tokens (file context), outputs 20 to 100 tokens, many cancelled requests as the user keeps typing. SLOs: p95 TTFT < 200 ms, >= 60 tok/s per stream. Goal: minimum GPUs ...
High-Level Design
Build a load generator replaying the customer's length distribution at increasing concurrency, recording TTFT, inter-token latency and throughput per GPU. Baseline the model in BF16 on one H100 with a...