Skip to content

Agent traffic

An agent asks about a state that grows: each step sends the trajectory so far, which repeats the previous step and adds a little. This page measures flide serve under that traffic, with one-shot requests arriving among the agents, from one agent to 64, against vLLM and SGLang, and shows what the session cache does as it fills.

Setup

One H200 and Qwen3.5-4B. Flide 0.1.15, vLLM 0.32 (prefix caching on) and SGLang 0.5.21 (radix cache on), all answering through /v1/systemone.

  • Each agent walks trajectories of 8 steps. A trajectory is cut from a Decision Index request with a long state: step k holds the first k/8 of its lines, and every step asks the request's questions. Requests whose questions every engine takes are used.
  • An agent pauses between steps for a random time, 200 ms on average (exponential).
  • One-shot requests arrive at random times among them, 0.5 per second per agent (a Poisson process).
  • Every agent's states start with a tag of its own, so two agents never share a prompt start, and a cache hit comes only from an agent's own earlier step.
  • A level runs 32 trajectories, or two per agent when there are more than 16 agents.

The tables give the latency of an agent's later steps (steps 2 to 8), where a cache can help, as the median and the 99th percentile, and the requests answered per second.

Latency and throughput

Each engine with its defaults: vLLM and SGLang take about 90% of the GPU for their KV cache, and Flide sizes its session cache with --session-cache-gb auto.

Agents Flide SGLang vLLM
1 38 / 80 ms 110 / 598 ms 211 / 697 ms
4 46 / 128 ms 247 / 1,372 ms 470 / 1,647 ms
16 317 / 733 ms 1,341 / 3,285 ms 3,000 / 5,936 ms
32 1.2 / 2.1 s 5.8 / 7.9 s 8.8 / 15.3 s
64 4.0 / 6.1 s 13.5 / 30.9 s 15.4 / 36.8 s

At 32 agents and more, the requests arrive faster than any of the three answers them, so every engine queues. Flide then answers about twice as many requests per second: 41.2 at 64 agents, against 21.4 for SGLang and 20.8 for vLLM. One-shot requests among one agent's steps take 17 ms in Flide, 52 ms in SGLang and 78 ms in vLLM (medians).

The same memory

The three engines held to about the same GPU memory, 22 to 31 GB in all: Flide with a 4 GB session cache, vLLM with --gpu-memory-utilization 0.15 and SGLang with --mem-fraction-static 0.15. Median latency of later steps, and requests per second at 64 agents:

Agents Flide SGLang vLLM
1 39 ms 117 ms 238 ms
4 46 ms 247 ms 671 ms
16 382 ms 2,677 ms 4,334 ms
32 1,263 ms 8,439 ms 14,106 ms
64 (requests per second) 41.1 19.4 15.2

What the session cache holds

Flide's session cache at 64 agents, by size. A hit is a request that resumed from a saved state; an eviction drops the state used least recently to make room; a replacement is an agent's next step taking the place of its previous one, so one agent holds one state.

Session cache Hits Evictions Replacements Later steps, median / p99 Requests per second
off 4.8 / 13.9 s 35.9
1 GB 6 203 1 4.6 / 8.9 s 37.7
2 GB 64 146 38 4.3 / 8.7 s 38.6
4 GB 158 46 95 4.0 / 6.4 s 41.1
8 GB 160 34 95 4.0 / 6.7 s 41.3
auto (109 GB) 160 0 95 4.0 / 6.1 s 41.2

A cache too small for the agents in flight keeps evicting the states it is about to need, as 1 GB does here. From 4 GB on, nearly every step that can resume does, and the tail latency falls by more than half. With one or four agents, 2 GB already holds every agent's state.

GET /stats reports these counters for a running server, so the cache can be sized from its own traffic.