Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 09 · AI · Serving LLMs · about 23 min to read

Play it as a journeyTutor comes with a plan

Routing and Cascades (not every request needs the big model)

Routing and Cascades
Routing and Cascades · Open board

The last board of the Serving LLMs run. Five earlier boards each made one fixed-size model faster: The Two Clocks (TTFT, TPOT, and why goodput is the number) measured its two clocks, Prefix Caching (the same start, computed once) and Chunked Prefill (one long prompt must not freeze the room) fixed the first and second, Prefill / Decode Split (two pools, one KV in flight) split the pool in two, Constrained Decoding (the grammar holds the pen) reached into its sampler. This board steps back to the front door and asks the question none of them asked: does this request even need that model? One queue, three price tags 75 times apart, and two different ways of deciding which one a question gets.

Before you start. A model charges you for every word it reads and every word it writes. A bigger model charges more for each of those words, and answers harder questions better. The five lessons before this one took one model of one fixed size and made its words cheaper. This lesson lets the size change too, by picking which model a question goes to.

Lesson 82 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • A queue with three kinds of question in it
  • Three doors, priced 75 times apart
  • 2024, Berkeley: a router guesses before anyone answers
  • 2023, Stanford: a cascade lets the cheap one try first
  • Being sure and being right are not the same thing
  • What each door costs
  • The front desk guesses first
  • The nurse tries first
  • Both desks, and the same patient twice
  • All of it in code

Terms it explains: tier, router, cascade, log-prob, calibration, $1.00 per million, $15 per million, preference pairs, $28, $40, $300, $900, $940, mean log-prob, A judge, Ask five times, A verifier, Cache-aware routing.

Lab

Every request goes to the small model first. How sure must it be before its answer goes out?

Drag How sure the 7B must be from 0.00 to 1.00 and watch Wrong answers that got out.

Open The cascade threshold

Related paper

Review AI