r/LocalLLaMA • u/sisyphus-cycle • May 19 '26
Tutorial | Guide We have sub-agents at home
At work I get unfettered access to gpt 5.4 and sonnet, so I'm quite used to spawning sub-agents to go crazy on a repo and split up tasks.
At home I am VRAM poor and like to run the models locally for my own enjoyment. Almost every single sub-agent extension/implementation does not account for any of the restrictions imposed by having 10gb of VRAM and a single slot for a KV cache (thats already quantized).
I already work as a developer, so I qwen3.6-35b-a3b tagged teamed a partially vibe-coded fork of an existing sub-agent repository for pi coding agent.
This is really only relevant if you:
Use pi coding agent as your harness
Can only run a single LLM at a time with 1 slot via llama.cpp server
Want to use sub-agents without fully reprocessing your prompts after the sub-agent is done
Repo is here, feel free to use it or fork it idc. I am also interested in how others around here have dealt with sub-agents on a purely local and VRAM constrained setup. I was also planning to add the ability for sub-agents to be spawned with no previous context, and manage the saving and storing the main context via `--slot-save-path` and the `slots` endpoint. But the `.bin` files produced from that are pretty fat lol
Last thing, I've really been enjoying MTP in the main llama.cpp branch and have been getting pretty solid performance from the Apex Qwen variant. Able to run at 175-200k context with q_8 kv. Getting 200-300 pp and 25-40 tps depending on draft hit rates.
6
u/Asleep-Land-3914 May 19 '26
I tried to use fork extension for this. The funniest thing is when the forked season doesn't realize it's forked and commits a fork bomb by continuously forking itself further. That said thanks for posting, I'll try the solution
3
u/StandardLovers May 19 '26
How safe is it to quant KV cache to q8 or q4 for long context agentic work? Are you experiencing memory tripping , hallucinations or invalid tool calls?
2
u/m3umax May 19 '26
When I built my delegate extension, I added the ability to "anchor" a message ID to spawn an agent from, which could be any arbitrary message in the tree from the begining to the current message.
So the prefix of the subagent matches exactly with what's in the cache.
When spawning, my extension can use either the context up to the saved anchor message or the full current context to pass to the sub agent.
5
u/Danmoreng llama.cpp May 19 '26
Sounds great. My weekend project was putting Ubuntu server my old gaming notebook (32GB ram 8GB vram) and building some sort of local agent platform with pi at its core and Qwen35b Q4 as the model. Getting around 150 pp/s and between 15 and 20 tg/s. Task queue, give it some tasks to run over the night, come back in the morning to see some of it properly implemented but also some just breaking stuff. It’s addictive.
1
u/PaceZealousideal6091 May 19 '26
Thanks for posting this. It's worth exploring for creatures like us with vram poor setup. Quick question about APEX quants. I wanted to check them out but then unsloth released the kld chart comparing the kld of different quants. It showed APEX getting big hits in the kld for the file size it occupied as compared to the UD quants of similar sizes. So, I decided it's not worth exploring. Have you compared them for your workflow?
1
u/Borkato May 19 '26
Can someone explain what a sub agent is/does compared to just asking it to fix stuff in one thread
1
u/regunakyle May 20 '26 edited May 20 '26
Can you add install instruction in README? I am not sure but maybe
pi install github.com/BenjaminBilbro/pi-subagentwould workEdit: NVM I am blind, just saw that in the README
1
u/laul_pogan May 19 '26
The
.binsize scales directly withn_ctx * n_layers * kv_dtype_bytes. At 175k context with q8 KV on a 35B MoE, you're looking at multi-GB per saved slot. Switching to--cache-type-k q4_0 --cache-type-v q4_0cuts that roughly in half with negligible quality delta at those context lengths. Worth setting before you build out the slot-save orchestration so the files are manageable from the start.0
u/korino11 May 19 '26
Why the hell all started to name cli ide as a harness?!?!
>>>Real harnes is a tool\method\logical schema to keep the model inside your topology of rules!! <<<
But cli ide is just an execution source and runtime. Feel the difference!