Hugging Face, End to EndLesson 71 of 75

Module 8 · Depending on it, and publishing so others can

When transformers stops being the right server

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 6 of 10 in this chapter

This chapter’s goalState what a model’s licence permits for your intended use and where the question is unresolved rather than answered, choose between a provider, a dedicated endpoint and your own hardware on stated cost and privacy grounds, judge a model with thirty examples of your own, and publish work a stranger can audit and reproduce.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch2:03Not available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

The wall you hit

A Flask endpoint wrapping model.generate works, and it works for one user at a time. Requests queue, the GPU sits idle between them, and at ten concurrent users latency becomes unacceptable while utilisation stays under a third.

The cause is structural rather than a tuning problem. A naive server processes one batch to completion before starting the next, so a request that arrives one token into a 500-token generation waits for all 500. And the KV cache is allocated as a contiguous block sized for the worst case, so most of the memory reserved for it is never used.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Image Generation, in Practice exam.

Stuck on something?Ask Arjun, your AI tutor

How to cite: Addaly (2026) ‘When transformers stops being the right server’, in Hugging Face, End to End. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/hugging-face/serving-it-yourself (Accessed: 29 November 2026).