Skip to content
StackDecode
System Design
19. AI System Design and LLM InfrastructureAnimated

Distributed Inference

Serving a model across several devices or nodes.

The idea

Large models are sharded over GPUs, requests are routed and batched.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

RequestsRouterReplica 1Replica 2Replica 3Shared cache
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Replicate the model across GPUs for throughput.

step:
1/4
at:
Requests
1/8

The green dot is a request moving through the system.

Step by step

  1. 1Shard the model
  2. 2Route requests
  3. 3Batch across requests
  4. 4Stream tokens back

Where it is used

Big LLMs.

Watch out for

Interconnect latency.

Related