System Design
19. AI System Design and LLM InfrastructureAnimated
Context Management
Choosing what goes into the model's limited window.
The idea
Select, trim, summarise and order the information the model sees.
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
The context window is finite and every token costs money and time.
- step:
- 1/4
- at:
- Context builder
1/8
The green dot is a request moving through the system.
Step by step
- 1Gather candidate information
- 2Rank by relevance
- 3Trim or summarise to fit
- 4Place the key items where the model attends
Where it is used
Long conversations and RAG.
Watch out for
Irrelevant context hurts answers and costs money.