What this lesson covers
Previously we looked at inference engines, each of which runs one replica of a model. A serving framework runs many engines as one service, routing requests to them and changing how many run as demand changes. This lesson covers what a serving framework does and introduces Narwhal, which we install in the next lesson.
What is a serving framework?
A serving framework manages its engines with two parts, a router and a planner. The router is the load balancer from Inference at scale, and it selects an engine for each request. The planner, as in Serving architectures, measures the load and sets how many engines run and which role each one has. Starting engines when requests queue and stopping them when demand drops is called autoscaling, and with disaggregated serving the planner also moves engines between the prefill and decode pools.
A new engine loads the model before it serves its first request, so capacity added by autoscaling arrives seconds to minutes after demand rises.
NVIDIA Dynamo and Ray Serve LLM are two widely used open-source serving frameworks. In both, an engine keeps the role it was started with, so moving capacity between the pools means stopping an engine in one pool and starting a new one in the other, which loads the model again. This is the cold swap from Serving architectures.
What is Narwhal?

NarwhalNarwhal is a disaggregated inference framework that automatically hot-swaps prefill and decode roles as demand changes, without reloading model weights.
In my Price of Anarchy paper, I examined routing with fixed prefill/decode splits. As traffic shifted between chat, document questions and long generation, I found the limits of static allocation and went looking for dynamic alternatives. That’s when I came across Arrow, a system by Wu et al. that schedules disaggregated inference adaptively.
I built Narwhal on that idea, and have since extended it to run llama.cpp, vLLM, SGLang and TensorRT-LLM engines on a single consumer GPU or across a multi-node cluster. In Evaluating Narwhal, I compare it with NVIDIA Dynamo and Ray Serve LLM under shifting traffic.
How Narwhal works
NarwhalA request visitsa prefill engine→a decode engine
The router sends each request’s prefill to an engine in the prefill role and its decode to an engine in the decode role, and the KV cache moves from one to the other.
Narwhal’s planner, the role controller, works from two latency targets the operator sets, one for time to first token (TTFT) and one for time per output token (TPOT), and from a measured profile of each engine. Every few seconds it projects how the current split and each split one engine away would do against those targets, and it moves one engine when another split comes out clearly better.
Each move is a hot swap, as taught in Serving architectures. Requests already on the engine finish there while new requests follow the new split, and the model stays loaded throughout.
Narwhal’s router also decides which requests to admit within the latency targets, brings a failed engine back once it recovers, and hands over to a standby router if it fails. The next chapter covers these in depth.
Narwhal works with a fixed set of engines, each of which can run either role, so when the load grows past what they can serve, the router turns away requests that would miss their targets. I’m adding support for starting and stopping engines as demand changes.
Recap
A serving framework routes requests to engines, and its planner decides how many engines run and which role each one has. NVIDIA Dynamo and Ray Serve LLM move capacity between prefill and decode with cold swaps, stopping an engine in one pool and starting one in the other, while Narwhal hot-swaps an engine’s role and keeps its model loaded.
In the next and final lesson of this chapter, Your first inference server, you’ll install Narwhal and run it on your own computer.
Athrael.net