Customers will call the normal model API, HTTP/SSE
External:
POST /v1/messages
Body: { model, messages, max_tokens, stream, metadata }
Returns: response or SSE stream
Internal:
BatchScheduler.Enqueue(RequestEnvelope)
-> { request_id, queue_deadline, stream_channel }
BatchScheduler.LeaseBatch(GPUWorkerInfo)
-> Batch { batch_id, model, requests[], token_budget, deadline }
GPUWorker.ReportBatchResult(batch_id, results[])
-> ack
GPUWorker.Heartbeat(worker_id, gpu_type, capacity, queue_depth)
-> scheduler instructions
API GatewayAuth, quotas, request validation, request ID, streaming connection lifecycle.
Admission ControllerRejects or queues based on tenant quota, model availability, priority, and overload state.
Batch SchedulerGroups compatible requests by model, region, hardware type, token budget, and SLO deadline.
GPU WorkerRuns prefill/decode batches, reports health, and returns per-request outputs.
Model RegistryTracks aliases, versions, artifacts, signatures, runtime requirements, and rollout weights.
Control PlaneOwns deploys, canaries, warm pools, autoscaling policy, scale-to-zero, and rollback.
Response RouterMaps outputs from batch results back to the correct request stream/client.
State StoreTracks request status, idempotency, stream ownership, batch membership, and retry attempts.
Different GPUs have different memory, throughput, and supported batch/token budgets. The scheduler should maintain capacity profiles and route requests accordingly.
Follow-up answer: “I’d keep per-GPU-type capacity models: max tokens, expected latency, cost, and supported models. Large contexts and high-priority requests may go to H100s; smaller or lower-priority batches can go to A100s.”
Routing inputs:
CPU-style autoscaling on request count is not enough. GPU serving should scale based on queue wait, token throughput, memory pressure, model residency, and SLO burn.
Interview answer: “I would scale hot pools on queue wait and GPU saturation, keep warm capacity for critical models, and use scale-to-zero only for low-priority or rare models where cold-start is acceptable.”
Autoscaling design:
For LLMs, GPU memory is often the bottleneck. The scheduler must account for model weights, KV cache growth, context length, output length, and fragmentation.
Follow-up answer: “I would batch by token budget because KV cache grows with sequence length. If memory pressure rises, the scheduler reduces batch size, routes to larger GPUs, or evicts lower-priority sessions.”
Memory controls: