AL-spiritphoenix/dsh-auto-model

项目介绍Project Overview

dsh-auto-model 是 DeepSeek Harness 的插件,为模型选择器新增 Auto 选项。会话选用 auto 时,每轮先用 Flash 小调用分类任务复杂度,再路由到 deepseek-v4-flash 或 deepseek-v4-pro,同轮后续步骤复用该判定,分类失败默认回退 Pro。适合希望按任务难易自动切换模型的 web 会话。注意:含图片会话无法选择 auto,分类调用不计入 token 计量,重启后按日志中的具体模型恢复。

dsh-auto-model is a DeepSeek Harness plugin that adds an Auto model option. When a session selects auto, it classifies each turn with a small Flash call and routes simple tasks to deepseek-v4-flash and complex tasks to deepseek-v4-pro, reusing the decision for later steps in that turn; classifier errors default to Pro. Use it when web sessions should switch models by task complexity. Caveat: image sessions cannot select auto, the classifier call is not metered, and restarts resume from the logged concrete model.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:AL-spiritphoenix/dsh-auto-model

AL-spiritphoenix/dsh-auto-model 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-auto-model

English | 中文

A DeepSeek Harness bundle that adds an Auto model option. When a session selects auto, the plugin classifies each turn with a small Flash call and routes it to deepseek-v4-flash (SIMPLE) or deepseek-v4-pro (COMPLEX).

It is a plain-JavaScript bundle, so it installs straight from a git host with no build step. It uses only shipped core APIs and runs against an unmodified harness.

Install

Install into the web profile (the profile the dsh web command boots):

From a local checkout:

dsh plugin --profile web add ./dsh-auto-model

From GitHub:

dsh plugin --profile web add github:AL-spiritphoenix/dsh-auto-model

Then boot it:

dsh web

dsh web is the web profile's alias, so no --profile flag is needed. The model selector now lists Auto alongside Flash and Pro. The concrete model the router chooses is what the session log records in each request header.

How it works

  • The plugin registers its own deepseek-auto provider route, whose listModels() returns the auto entry at runtime. The directory entry is therefore independent of llm-deepseek's models config, so a settings.yaml override cannot hide it.
  • The plugin listens on the root agent/request waterfall (outside installModelSelection) and rewrites auto — whichever provider carried it — to a concrete provider/model before dispatch.
  • Each turn's first step sends one auxiliary classifier call to classifierModel (defaults to the fast model); later steps of the same turn reuse the decision. A failed call falls back to onClassifierError (default slow).

Configuration

All fields are optional and default to the DeepSeek V4 pair:

Key Default Meaning
provider deepseek-official Provider route the concrete requests are routed to.
model auto Virtual model id shown and submitted; never dispatched.
providerName DeepSeek(Auto) Selector group label.
name Auto Selector model label.
description (built-in) Selector detail.
fastModel deepseek-v4-flash Model for SIMPLE tasks.
slowModel deepseek-v4-pro Model for COMPLEX tasks.
classifierModel fastModel Model serving the classifier call.
classifierPrompt (built-in) Classifier system prompt.
classifierMaxTokens 16 Classifier output-token cap.
classifierTimeoutMs 10000 Classifier call deadline.
contextBudgetChars 4000 Maximum task characters fed to the classifier.
onClassifierError slow Target when classification fails or returns an unknown token.

Override them in the web profile's cordis.patch.yml:

- id: auto-model
  config:
    fastModel: deepseek-v4-flash
    slowModel: deepseek-v4-pro
    onClassifierError: slow

Limitations

  • auto is advertised as a text model, so an image-containing session cannot select it.
  • The classifier call is an auxiliary dispatch and is not counted by the token meter.
  • auto is session-local: after a restart, a non-blank session resumes from the logged concrete model rather than re-classifying.
上一个 Prev dsh-cost-guard 下一个 Next dsh-doctor