Running Models YourselfLesson 58 of 82

Module 7 · Serving it to other people

A gateway in front: keys, quotas and a bill

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 3 of 9 in this chapter

This chapter’s goalExpose a local model as a service other people can use safely (bound to loopback and reached over SSH or a WireGuard mesh, fronted by a gateway that holds keys and quotas, packaged and supervised so it restarts on its own, logging what is needed without retaining prompts you cannot defend) and state what an unauthenticated inference port costs you within hours of being reachable.

This chapter’s media

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

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
What a gateway holds that the engine deliberately does notRequests per minuteStops a loop in a script. Does not protect the cardTokens per minuteThe limit that maps to the hardwareConcurrency, per keyStops one batch job filling every slotA maximum output lengthA ceiling the caller cannot raiseAn allow-list of pathsInference forwarded; model pull and delete refusedEngines implement inference and almost nothing else, and that is not an oversight: identity, quotasand audit outlive whichever engine you are running this month. With a gateway in place the enginebinds to loopback, and a caller who reaches it directly would bypass every limit here.
Engines implement inference and almost nothing else, and that is not an oversight: identity, quotas and audit outlive whichever engine you are running this month. With a gateway in place the engine binds to loopback, and a caller who reaches it directly would bypass every limit here.

Figure

A little at a time

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

Step 1 of 7Free · no account needed
Lesson steps

What the engine deliberately does not do

vLLM, llama.cpp’s server and Ollama all implement inference and almost nothing else. vLLM has a single --api-key shared secret, which is better than nothing and worse than useless the moment more than one person holds it: you cannot tell who spent the GPU hour, and revoking it locks out everybody. Ollama has no authentication at all. This is not an oversight. Identity, quotas, billing and audit belong in a layer that outlives whichever engine you are running this month.

That layer is a gateway: a small service that sits between callers and the engine, holds the keys, counts the tokens and forwards the request. Because every engine speaks the same OpenAI-shaped API, the gateway is engine-agnostic.

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 Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘A gateway in front: keys, quotas and a bill’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/a-gateway-in-front (Accessed: 29 November 2026).