dsh-adaptive-reasoning
其他 活跃维护

dsh-adaptive-reasoning

ManoloRemiddi/dsh-adaptive-reasoning

自动评估每次请求的复杂度,动态调整推理深度,无需额外模型调用或GPU常驻,兼顾响应速度与准确性,显著降低推理成本。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
1
Open Issues
JavaScript
主要语言
MIT
开源协议
74 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:ManoloRemiddi/dsh-adaptive-reasoning
git clone https://github.com/ManoloRemiddi/dsh-adaptive-reasoning.git
git clone git@github.com:ManoloRemiddi/dsh-adaptive-reasoning.git
README.md main

DSH Adaptive Reasoning 0.2.3

Our standalone DeepSeek Harness plugin chooses reasoning automatically for each
request. It uses the existing model. No per-prompt switches, classifier model,
background inference, GPU warm-up, power-setting changes or recurring jobs.

This is a conservative first usable preview, tested with DSH 0.1.5-rc.1, Cordis
4.0.2, and the existing Qwen3.8 27B GSQ model. It recognises task families with
local rules; it is not a trained or infallible difficulty estimator.

What happens automatically

Task Reasoning Tools
Standalone conversational greeting Off Available, including structured voice delivery
Clear rewrite, translation or proofreading with supplied text Off Hidden and blocked for that step
Short summary of supplied text Low Hidden and blocked for that step
Longer supplied-text summary Medium Hidden and blocked for that step
Ordinary explanation or comparison Medium Available
Prompt improvement High Text-only when the source prompt is supplied
Complex, consequential, ambiguous or unrecognised work High Available
Continuation after tools At least medium Restored
Tool failure in the current turn High Available

Prompt improvement deliberately retains high reasoning: faster modes invented
requirements in evaluation. We did not promote that task family on latency alone.
Clear text work gets a short instruction to preserve facts, uncertainty and scope.
The plugin does not guarantee semantic correctness or validate every final answer.

The current bundle starts with empty routes for the Augmentor desktop and browser
presets. It never assumes the developer's model or hardware. Configure a verified
provider/model/effort mapping once; other routes pass through unchanged.

Installation

The 0.2.3 preview includes the 0.2.2 cold-history correction and neutral defaults.
Package this source checkout, or use the matching complete Augmentor bundle:

npm pack
dsh plugin --profile web add /absolute/path/dsh-adaptive-reasoning-0.2.3.tgz --ignore-scripts --config.auto-install-peers=false

See setup for your own model. Model-specific configuration is
required before automatic effort changes are enabled; installing the plugin
alone does not alter your selected model or its reasoning settings.

The tarball needs no runtime dependency downloads: it consumes services from the
installed DSH host. CLI installation adds its bundle once. New bundle manifests
are picked up on the next DSH start; installing the package does not restart DSH.
Finish running tasks before restarting. No per-prompt adjustment is needed after
activation. The local deployment record is under ignored outputs/install-state.json.

To remove:

dsh plugin --profile web remove dsh-adaptive-reasoning --config.ignore-scripts=true --config.auto-install-peers=false

Or set enabled: false for the plugin row and reload. Removing/disabling the
plugin restores normal reasoning selection and tools. It never rewrites the saved
provider default. The native picker still displays the saved selection, not an
Auto badge; request/header records the actual effort used.

Evidence without background work

Every participating model request records a reason in
adaptive-reasoning/decision, then timing and character counts in
adaptive-reasoning/measurement. These sidecar records copy no prompt or answer text.
They measure time from request preparation, not from clicking Send, and do not
measure electricity. Cancelled requests may lack a completed measurement.

To read a summary from existing logs:

npm run report

By default the report reads the current and previous sidecar files. An explicit
session-folder argument reads up to 100 historical session files. It performs no
inference and runs only when requested. Task mix and server load affect the results.

Configuration

  • enabled: boolean, default true.
  • textOnly: boolean, default true.
  • presets: exact preset allowlist; empty means inactive.
  • routes: exact provider/model pairs with an efforts mapping for off, low,
    medium, high. The existing Qwen maps high to xhigh.

Automatic mode owns per-request effort on allowlisted routes. Explicit requests
to think deeply remain high. Unsupported effort strings fail DSH's adapter
validation before inference. Unrecognised languages retain high reasoning.

Engineering and validation

Uses supported DSH lifecycle/request hooks, an assembly transform and a tool
guard. Tools are restored on the next step; invented actions in a text-only step
are blocked, then the normal loop can recover with more reasoning. Known PTC and
structured-output contributions opt out of tool filtering. No automatic replay
of completed actions or permission relaxation is introduced.

npm test
npm run test:integration
npm pack
node test/install-proof.mjs

The integration test uses the installed DSH loop and pi-ai adapter against a
local deterministic HTTP endpoint. It tests sequential and concurrent sessions,
wire-level effort, tool blocking/recovery, telemetry, and clean removal. It creates
no persistent user chats. Set DSH_INSTALL_ROOT if DSH is installed elsewhere.
The install proof uses and removes a disposable DSH home.

An explicitly opted-in, finite live suite is available with
ADAPTIVE_LIVE_TEST=1 npm run test:live. It sends five synthetic writing tasks and
one matched baseline to the already-running loopback model through the real DSH
loop, with no actual tools registered. Private historical experiments and live
outputs are excluded from the distributable package.

See 0.2 validation,
initial research, and changes.

Support and related plugins

Report issues
with your DSH version, model and a synthetic example. Do not include credentials
or private session logs. Browse the
DeepSeek Harness Plugins collection.

Restart reliability — 0.2.2

Version 0.2.1 wrote custom diagnostic events into DSH conversation logs. DSH
0.1.5-rc.1 accepted them in memory but refused to reopen them after restart.
Its public Session.append() also drops an ignorable option, so adding that
option at the call site would not fix persistence.

0.2.2 writes these diagnostics separately under
$XDG_STATE_HOME/dsh-adaptive-reasoning/telemetry.jsonl (default
~/.local/state/). The private log rotates at 5 MiB and retains one prior file.
It records identifiers, routing choices, timings and counts, never prompts or
answers. Diagnostic write failures cannot fail a conversation. Routing, model
selection, context size and GPU placement are unchanged.

npm run report now reads the separate diagnostic files. An explicit sessions
folder argument remains available for historical measurements. Existing affected
histories need the narrowly scoped backed-up repair described in
restart validation; updating the plugin alone does not
repair previously written events.