Agents that don't close connections on retry waste ~148 tokens per task, vLLM tests show

No-Peanut-6988 · reddit · 2026-10-23

Sorami measured what happens on self-hosted vLLM 0.31.0 when an agent client gives up on a request:

For retries (1.5s deadline + one retry): unclosed old attempts wasted 148 tokens per task vs 0 when closed; on-time completions fell from 38% to 21%, and to 11% if the abandoned connection stayed open, since it keeps competing for the same GPU.

Fix: actually abort the stream (AbortController, closing the response, cancelling the task) instead of just stopping the await. Tested only on vLLM/SGLang with L4/A10G and two models; llama.cpp, Ollama, TGI and hosted APIs untested.

Original post →

More from coding & agent

coding & agent channel →