DSH Tool Router
Lazy tool discovery for DeepSeek Harness. The model never sees the whole tool shelf —
only find_tool and, on demand, the one schema it actually needs, chosen through a
decision model API.
A default DSH profile ships every mounted tool schema in the prefill before the model emits a single word — and charges that cost again on every turn. A fresh session pays 6,559 tokens and 26 tool schemas just to say hello.
DSH Tool Router replaces that shelf with a single small find_tool schema. Measured on
the same session: 283 tokens, 1 schema. On a 32k context window
that is roughly 20% of the model's world handed back for actual work.
Stage 0 — Lexical rank. The router shortlists the mounted tools locally with stopword-filtered keyword and prefix matching. No model call, no latency.
Stage 1 — Decision model API. One compact POST /v1/systemone carries
every mounted tool (up to 24) with a short criterion and returns the best tool plus a confidence
score. Any server that speaks the protocol will do; the endpoint is configurable.
Stage 2 — Reveal. If confidence is at least 0.70, exactly one tool schema is injected and the rest stay masked. Otherwise the router returns a probability-ordered shortlist whose reason names the closest match — and an empty request always returns the full tool catalog as a hint. Exact tool names skip the decision call entirely.
ROUTER_BASE in index.js to point anywhere.pnpm
on PATH, and a running decision model API that speaks POST /v1/systemone
(defaults to http://127.0.0.1:8081/v1/systemone).[dsh-tool-router] registered find_tool with the label count of your registry.# Install from GitHub
dsh plugin --profile <profile> add \
git+https://github.com/residenthiago2011/DSH-Tool-Router.git
# ...or from the prebuilt tarball
dsh plugin --profile <profile> add /path/to/dsh-tool-router.tgz
A turn that calls no tool costs 283 tokens instead of 6,559. A turn that calls one tool reveals that one schema once — the other 24 are never sent.