dshbase

插件目录 / AI Models / llm-adaptive

llm-adaptive

已验证 · 实测可装 dylan121322

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

2Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-14最近推送
跨平台平台

功能简介

AI Models 类别的 DeepSeek Harness 插件。

✅
我们的评价
可用 — 实测通过,早期项目

AI Models 类别的 DeepSeek Harness 插件。 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

llm-adaptive

Awesome DSH Plugin

Adaptive model routing plugin for DeepSeek Harness. Adds an adaptive provider to the model picker: every LLM request is classified by a flash classifier (low / medium / high / critical) and routed to the matching backend provider through config-driven chains.

Features

  • Per-request complexity classification — deepseek-v4-flash called directly (never through a proxy, no recursion).
  • Context-aware judging — injects a rolling session-goal summary plus the recent turns into the classifier prompt (continuation / wrap-up / error-loop rules).
  • Sticky level protection — a mid-task downgrade is held at the previous level unless the message carries explicit downgrade or wrap-up signals.
  • Config-driven routing chains — chains come from pool.json → routing.levels ($active expands to the active provider, missing entries fall back to defaults); transport failures walk down the chain.
  • Classifier config from the pool — URL / model / key reference read from the classifier section of pool.json (no hardcoded credentials).
  • Fail-open — any classification failure degrades to medium; never blocks a request.
  • Observable — every decision (level, cause: llm/sticky/cache) is written to the plugin log.
  • 120s decision cache — keyed by user-text head plus goal fingerprint.

Requirements

  • DeepSeek Harness (dsh)
  • A model pool file at ~/.dsh/tools/cc-switch-sync/pool.json with:
    • classifier section: url, model, key_ref (resolved against ~/.dsh/.credentials.yaml, pool api_key as fallback)
    • routing.levels: low / medium / high / critical chains
  • A DeepSeek API key for the classifier

The pool file is produced by the cc-switch-sync import tool (or can be authored by hand). The plugin reads it on every request, so pool edits take effect immediately.

Install

dsh plugin add llm-adaptive

or, from a local checkout:

cd ~/.dsh/profiles/web && npx pnpm@10 install   # with "llm-adaptive": "file:plugins/llm-adaptive"

Restart the dsh web service, then select adaptive(自动路由) in the /model picker.

Usage

  1. Open /model and choose adaptive(自动路由).
  2. Every subsequent LLM request is classified (low/medium/high/critical) and routed to the first available provider of that level's chain.
  3. Decisions are logged with level=… cause=… chain=… to ~/.dsh/hooks/plugin.log.

The explicit level models (low, medium, high, critical) are also listed in the picker for direct selection.

How it works

A custom LlmAdapter for the adaptive provider: stream() awaits classification (async generator), then forwards to the target backend via ctx.llm.prepareCall + stream (unified chunk protocol, passthrough). Request-level interception was chosen over proxy or request-layer hooks because dsh hot-swaps configuration and the prepared-call contract requires matching provider/model options.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 llm-adaptive」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:dylan121322/llm-adaptive

Headless(CLI)profile:

dsh plugin --profile headless add github:dylan121322/llm-adaptive

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

把一个新模型、provider 或路由策略接入循环,让 dsh 能为任务选对脑子。

适合谁

同时用多个模型或 provider、想让成本/质量/延迟自动平衡的人。

二次开发建议

provider 适配器和路由启发式是缝——加后端、调回退链,或加按任务的模型选择。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

AI Models 里更多

浏览全部 7797 个插件 →