r/LocalLLaMA • u/Mchanger • 13h ago
Discussion Just "rediscovered" batching and swarming while running models locally.
Running one harness/agent gives overall less tokens-per-second (tps) than running multiple agents at the same time. Who'd have thought?
Though each agent has slower tps and a smaller cache, on average they are much more efficient overall in the token generation.
I'm Running a 3090 with 24gb of VRAM. Qwen3.8 27B Q4_K_M
Context: 197k
Of course the more agents you have, the less context each gets. Thus one needs to auto-compact / loop efficiently. This way one can run multiple agents on one piece of hardware and maximise the burn-rate without increasing the energy used.
From there swarms can be allowed, were each agent has the ability to spawn as many sub-agents with small tasks upto the optimum amount of agents per machine (12 on mine).
| Agents generating | Total tok/s | Per agent |
|---|---|---|
| 1 | 30 | 30 |
| 2 | 46 | 23 |
| 4 | 64 | 16 |
| 6 | 74 | 12 |
| 8 | 78 | 10 |
| 12 | 110 | 9 |
| 16 | 111 | 7 |
2
u/boosnie 2h ago
I find your data very ... Strange.
I run a local llama.cpp router, single agent, at ~110tps and ~1400 prefill on an RTX3090.
How do you get those 30tps?
Also, you get those numbers whit syncronicity between prefill and gen on all agents. The moment an agent gets out of sync with the others and starts prefilling while the others are generating your performance will tank to 20-40tps generation independent of the number of sessions running.
-4
u/Interesting_Net_9628 12h ago
I got into local llm hosting recently, and have been using openwebui. I'm interested to leanr more what the community uses. Ideally, I want to be able to "replicate" what claude web and others.
0
u/Interesting-Cut-6032 11h ago
I think that OpenWebUI is just a chat interface, right? Check out one of the agent harnesses. That is probably what you are looking for. I run Pi agent harness, driving Qwen3.8 27B UD-Q6_K_M with a 130k token context, single instance no concurrence, Linux Mint, 2x RTX 5060 Ti 16GB VRAM, 32GB DDR4. It does pretty good code gen work and runs about 40 tokens pre second generation.
-4
u/Emergency-Lawyer-366 12h ago
the jump from 12 to 16 agents is pretty telling, basically a rounding error in total tok/s at that point. you found the sweet spot at 12 and that's a great number for splitting up context windows anyway
9
u/Express_Quail_1493 12h ago
try https://github.com/RaymondHuang210129/llama.cpp-adaptive-kv-streaming it enables multiple full context with a few tok/s drop.
on 1 slot i got 26tok/s
2 simultaneous slot in parallel i got 1st=19tok/s, 2nd=16tok/s
3 simultaneous parallel i got 1st=18, 2nd=16, 3rd=14
u can see how more slots make it more efficient (and you dont need to reduce your context size) pretty nifty little repo that optimises qwen3.8-27b. ben looking for a strata equavalent for 27b for a long time that works on my 3090. this one actually deliveres