MODULE 2 · DAY 1
Serving Local Models
Open engines behind one universal endpoint
Gourav Shah · School of DevOps & AI · Hands-on
M2·01
What you'll learn
Five ideas that make model serving portable and boring — in the best way.
One app, many backends — the serving engine becomes a deployment choice, never a code change.
M2·02
The problem: every engine speaks differently?
If each serving engine had its own API, swapping one would mean rewriting the app. It doesn't have to.
Three custom integrations is three ways to break. The fix is one shared contract — the rest of this module.
M2·03
The quick demo: Docker Model Runner
Docker 4.40+ serves a model in one command — good to know, but tied to Docker's toolchain.
Slickest on-ramp inside Docker — but this course goes runtime-agnostic, so the patterns run anywhere.
M2·04
Open engines: different machines, same cup
Espresso machines differ inside — boiler vs thermoblock — but they all pour into one standard cup.
Swap the machine under the counter — no barista, and no app, needs retraining.
M2·05
Which engine, when
Three open engines, three jobs. You reach for the one that fits the moment.
For development, Ollama is the standard. M3 adds vLLM for high-throughput batched serving on a GPU.
M2·06
The universal contract: the /v1 endpoint
A wall socket — swap the power station behind it and your appliance never notices.
Two endpoints — chat/completions and models. The app talks to the contract, not the engine.
M2·07
Swap engines by changing one variable
The endpoint is an environment variable. Dev, staging, production differ by one line — not code.
Move a 1.5B dev model to a 13B production model — the application does not notice.
M2·08
GGUF: the JPEG of model weights
RAW is huge and perfect. JPEG at 80% is a fraction of the size and looks the same. GGUF is the JPEG for LLMs.
Ollama pulls GGUF, not float16 — so laptop CPU and Metal run it without CUDA.
M2·09
Picking a model for a 16 GB laptop
Discussed big, required small. Labs stay tiny; heavier models are there when you outgrow them.
Stay on qwen2.5:1.5b for every lab — fast iteration keeps the machine responsive. gpt-oss 20B is demo-only.
M2·10
Two wiring patterns, one app
The app code is identical. Only OPENAI_BASE_URL changes — native model vs model-in-container.
Build once on your laptop; the same image drops onto a Linux GPU VM with one config change.
M2·11
BIG IDEA
The engine is a deployment choice, not a code choice
Next: in the lab you'll containerize a client that speaks this contract.
Continue to the Serving lab. · Gourav Shah · School of DevOps & AI
M2·12