Running Models YourselfLesson 64 of 82

Module 7 · Serving it to other people

Local first, API behind it

In this lesson

  • 8 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 9 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
A cascade only pays at a high deflection rateStraight to the API, nolocal pass50Cascade, 20 per centserved locally43Cascade, 50 per centserved locally30Cascade, 80 per centserved locally16Cascade, 95 per centserved locally9blended cost per million tokens, in centsLocal share times local cost, plus the rest at the hosted price, plus the escalation overhead you paidon every request that escalated anyway. At fifty cents a million hosted, five locally and two ofoverhead, a cascade deflecting a fifth of the traffic has bought almost nothing for a great deal ofmachinery.
Local share times local cost, plus the rest at the hosted price, plus the escalation overhead you paid on every request that escalated anyway. At fifty cents a million hosted, five locally and two of overhead, a cascade deflecting a fifth of the traffic has bought almost nothing for a great deal of machinery.

Figure

A little at a time

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

Step 1 of 8Free · no account needed
Lesson steps

The argument that stops being a choice

Most of this course has compared local against hosted as if you had to pick. In deployments that survive, people usually do not. They run a small local model for the work it handles well and route the rest to an API, and the interesting engineering is in the routing rule rather than in either endpoint.

This is worth taking seriously because it fixes the two things that most often kill a purely local deployment: the capability ceiling the weights impose, and the fact that one machine is one machine and it will be down at some point.

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) ‘Local first, API behind it’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/hybrid-local-and-api (Accessed: 29 November 2026).