DSH | dsh-llm-gate | One request at a time for local llama.cpp, no more subagent timeouts #4995
d3vmeh
started this conversation in
Show Your Plugins!
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Project URL:
https://github.com/d3vmeh/dsh-llm-gate
npm: https://www.npmjs.com/package/dsh-llm-gate
Introduction:
If you run DSH against a local
llama-serverwith--parallel 1, the server can only work on one request at a time. When two requests overlap (the main agent and a subagent, or the agent and compaction), llama.cpp quietly puts the second one on hold and sends nothing back. DSH cannot tell "waiting" from "dead", so after 5 minutes it gives up withterminatedorpi-ai stream idle timeout, then retries the whole prompt up to five times.dsh-llm-gate fixes this by making DSH wait its turn. Extra requests are held inside DSH, in order, and only sent to llama.cpp when the server is free. The main agent and subagents then take turns instead of one of them failing.
How it integrates with DSH:
It is a small cordis plugin that hooks the point where DSH sends any model request (
llm/stream), so it covers everything: agents, subagents, compaction, and session titles. Each request takes a slot before it is sent and gives it back when its stream ends, whether that is normally, by error, or by cancellation. If the queue is full or a request waits too long, it fails with a clearQUEUE_FULLorQUEUE_TIMEOUTerror instead of being retried. Installation is one command:then in
~/.dsh/profiles/web/cordis.patch.yml:What it looks like in use:
Main agent and a background subagent sharing one llama.cpp slot. The lines only appear when a request had to wait:
Two related findings, independent of the plugin:
streamIdleTimeoutMson the provider route. llama.cpp's SSE pings keep the HTTP connection alive during prefill, so that setting fixes the single-request case. Consider removingTIMEOUTfromretryPolicy.retryableCodesso a genuine timeout costs 5 minutes, not 30.--parallel 2 --kv-unifiedandmaxConcurrent: 2.MIT License. Feedback welcome!
> Unofficial project, independently developed and maintained by community members.
All reactions