Running three different LLMs simultaneously on a single 8GB GPU fails because llama.cpp pre-allocates the full KV cache upfront, causing OOM errors for the second and third processes. The solution is a C++ daemon called lmxd that implements Connection Admission Control (borrowed from 5G/telecom) as a VRAM ledger: it tracks allocated bytes, enforces a 90% cap, and refuses new agent registrations before any GPU allocation is attempted. The daemon also handles KV-cache swapping to host RAM between agent switches, enabling multiple agents to share one GPU context slot. Additionally, a layer streaming technique using two CUDA streams overlaps compute and weight transfer, achieving ~22-32% wall-clock savings on a GTX 1080. The repo ships the admission control daemon and the streaming primitive as separate, composable components.

22m read timeFrom towardsdatascience.com
Post cover image
Table of contents
The problem you actually haveWhy the 3 LLMs can’t run in parallel (the one-minute version)The solution: a small C++ daemon that does the bookkeepingThe receipts (i.e., one ugly table and five screenshots)Honest ConfessionThe last trick — only load the layer you actually needHow to try it, what’s within scope, and what isn’tWrap
97 Impressions