편집자 노트

自适应模型路由

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.

이것은 DeepSeek Harness(DSH) 플러그인입니다. 이 사이트는 GitHub README, 설치 정보, 유지보수 상태, 공개 보안 시그널을 모아 보여줍니다.

업스트림에서 중국어 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 classificationdeepseek-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.jsonrouting.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

REPOSITORY SIGNALS

보안 및 설치 증거

이 점수는 공개 저장소 메타데이터와 이 사이트에 등록된 설치 증거에만 기반하며, 코드 보안 감사와 다릅니다.

출처 추적 가능

공개 플러그인 카탈로그에서 왔으며, 공개 GitHub 저장소로 연결됩니다.

라이선스

저장소가 MIT 라이선스를 선언했습니다.

유지보수 활동

최근 180일 내 코드 업데이트가 있습니다.

설치 증거

재현 가능한 정확한 설치 메타데이터가 아직 등록되지 않았습니다. 저장소 설명에 따라 직접 확인하세요.

설치 라이프사이클 스크립트

검사한 패키지 메타데이터에 설치 라이프사이클 스크립트가 선언되지 않았습니다.