Hugging Face Reworks Transformers Serving to Hit 58k Tokens/s on One Server
LysandreJik · x · 2026-12-01
Hugging Face's LysandreJik describes how the team changed the way Transformers serves models so that the GPU becomes the bottleneck.
- Using a fake model to isolate the cost of taking a prompt in and streaming tokens back out, they reached 58k tokens/s on a single API server and 124k tokens/s on two, with 256 concurrent clients.
- The first bottleneck was Python: the HTTP server and the generation loop shared a process, so under load Python could be busy with one client while the GPU waited. The model now runs in its own process.
- Per-token work was trimmed: a 10k-token prompt is tokenized on a dedicated thread so other clients keep streaming, and the model process sends each API server one message per generation step containing the new tokens for all its requests.
- The post is cut off before the API-server-side handling is fully described.
More from Infra
- Same model, 200x gap: provider breaks up to 60% of open-model tool calls — remilouf · 2026-12-01
- Blogger bets on specialized production models; SCALEDOWN offers all models free in December — cneuralnetwork · 2026-12-01
- DeepSeek's numbers 'insanely good' — call for Huawei to add FP4 compute to 960DT this year — teortaxesTex · 2026-12-01
- Cerebras surges on surprise Nvidia partnership; analyst warns AI self-regulation lacks rules — TiernanRayTech · 2026-12-01
- Video generation fails on Mac: MPS backend lacks Float8_e4m3fn dtype support — Middle_Basis2816 · 2026-12-01
- Bernstein: Google TPU racks cost 64% less but only 1% less per gigawatt than Nvidia Rubin — BenBajarin · 2026-12-01