System Design
19. AI System Design and LLM InfrastructureAnimated
Model Routing
Send each request to the best model.
The idea
A router picks a small, cheap model for easy requests and a large one for hard requests.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Not every question needs the biggest model.
- step:
- 1/4
- at:
- Request
1/9
The green dot is a request moving through the system.
Step by step
- 1Classify the request
- 2Pick a model
- 3Send it
- 4Escalate if confidence is low
Where it is used
Cost and latency control.
Watch out for
A bad router sends hard tasks to weak models.