dsh-model-modes
by DTSFO
DeepSeek Harness网页作曲家:具备能力感知推理配置文件和提供方原生快速模式。
Capability-aware reasoning profiles and provider-native Fast mode for the DeepSeek Harness web composer.
安装
dsh plugin --profile web add github:DTSFO/dsh-model-modesGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
为 DeepSeek Harness Web Composer 增加通用的推理档位补全,以及与推理档位完全独立的 Provider 原生 Fast 模式。
功能
- 继续使用 DSH 官方模型选择器显示和提交思考程度,不创建第二套模型菜单。
reasoningProfiles.provider: '*'会应用到所有由llm-pi-ai管理、并且实际包含指定 model id 的 Provider,不硬编码myself。- 对
gpt-5.6默认公开独立的Max和Ultra。两者是两个选择、两个请求值。 - Composer 中提供明显区分开/关状态的 Fast 开关。
- Fast 只增加当前 Provider 的原生快速/优先处理参数,不降低思考程度、不切模型、不切 DSH Provider。
- Fast 能力跟随当前官方
ModelDirectory中的 provider/model 选择;不支持的路由显示不可用,Host 也会拒绝开启。 - Fast 状态按 Session 和精确 provider/model 绑定;addressed subagent 会话不显示开关。
因此以下组合都成立:
Max + Fast
Ultra + Fast
任意其他已支持思考档位 + Fast
Fast 的准确含义
Fast 与思考程度是同一请求中的两个正交参数。开启 Fast 后,插件不会:
- 把
Ultra改成Max、High或更低档位; - 把当前模型换成
flash、turbo等其他模型; - 把当前 DSH Provider 换成另一个 Provider;
- 用 OpenAI 参数猜测所有 OpenAI-compatible 网关都支持 Fast。
插件在 llm-pi-ai 最终调用 Models.streamSimple() 的边界,根据实际 Provider 和 API 注入参数。Provider 配置 snapshot 在流第一次消费时冻结;并发 Session 使用 AsyncLocalStorage 隔离。
内置 Provider 矩阵
| DSH Provider | pi-ai API | Fast 请求参数 | 默认策略 |
|---|---|---|---|
openai |
OpenAI Responses / Chat Completions | service_tier: "fast" |
官方精确模型白名单 |
openai-codex |
openai-codex-responses |
service_tier: "fast" |
Codex 精确白名单:GPT-5.6 Luna/Sol/Terra、GPT-5.5、GPT-5.4 |
xai |
OpenAI Responses / Chat Completions | service_tier: "priority" |
该精确 Provider 下的文本模型 |
google |
google-generative-ai |
config.serviceTier: "priority" |
Gemini Developer API 精确白名单 |
openrouter |
OpenAI-compatible 文本 API | service_tier: "fast" |
该精确 Provider 下的模型;上游可能回退 Standard |
minimax / minimax-cn |
anthropic-messages |
service_tier: "priority" |
MiniMax 精确模型白名单 |
vercel-ai-gateway |
anthropic-messages |
providerOptions.gateway.speed: "fast",并设置 allowFallbackFromFast: false |
当前 Fast 模型精确交集;fast-or-fail,不静默回退 Standard |
fireworks |
anthropic-messages / openai-completions |
service_tier: "priority" |
九个模型精确白名单;请求级 Priority,不切 Fireworks *-fast router/model |
azure-openai-responses |
azure-openai-responses |
service_tier: "priority" |
仅显式启用:matcher 无法看到 deployment、API version、SKU 和区域 |
google-vertex |
google-vertex |
Header X-Vertex-AI-LLM-Shared-Request-Type: priority |
仅显式启用:需支持的模型和 global endpoint |
amazon-bedrock |
bedrock-converse-stream |
serviceTier: { type: "priority" } |
仅显式启用:能力取决于 model card、inference profile 和区域 |
嵌套请求字段使用不可变递归合并。例如 Google 的 config.thinkingConfig、Bedrock 的其他 serviceTier 字段、OpenRouter 已有的路由配置,以及 Vercel Gateway 已有的 only、order、models 都会保留。
OpenAI 默认白名单跟随当前 Fast 表,包含 GPT-5.6 系列、表中支持的 GPT-5.x/GPT-4.x、o3、o4-mini 和 gpt-5.3-codex。独立的 openai-codex 路由使用自己的精确 Codex 白名单与 API 合同。Google 默认只包含 Gemini Developer API 与当前 pi-ai 文本目录的交集,明确不包含 gemini-3.7-flash;Vertex 单独支持 3.7,但仍需显式配置。MiniMax 默认仅包含官方列出的 M2/M3 Priority 模型。
Vercel AI Gateway 使用 fast-or-fail:allowFallbackFromFast: false 会阻止不可用的 Fast 路由静默变成 Standard。默认白名单是 pi-ai 模型目录与 Vercel 当前 Fast 元数据的精确交集;已经是快速型号的 *-fast model slug 会被排除,因为选择它本身就是换模型。
Fireworks 的请求级性能层使用 service_tier: "priority"。Fireworks 另有必须选择不同 router/model 的 Fast serving path,但本插件绝不改变当前模型或路由。因此 Composer 的 Fast 开关在 Fireworks 上表示文档所列九个模型的 Provider 原生 Priority,不会暗中切换到 *-fast 模型。
Host 会读取当前 llm-pi-ai 路由及所选模型真实的 pi-ai API id。名称相同但属于其他 adapter、API 不匹配、bridge 安装失败或缺少精确 profile 时,UI 都显示 N/A,Host 也拒绝开启。
内置矩阵只表示请求协议已知;账户资格、区域容量、部署支持、回退和计费仍由上游 Provider 决定。
本版明确 fail-closed 的 Provider
pi-ai 0.82.1 的内置 Provider 集合共有 38 个 id(37 个静态目录 Provider,加上动态 radius 网关),本版已经全部分类:9 个默认提供 profile,3 个依赖部署信息的 Provider 仅允许显式启用,其余 26 个由配置校验直接拒绝。被拒绝的内置 id 为:ant-ling、anthropic、cerebras、cloudflare-ai-gateway、cloudflare-workers-ai、deepseek、github-copilot、groq、huggingface、kimi-coding、mistral、moonshotai、moonshotai-cn、nvidia、opencode、opencode-go、qwen-token-plan、qwen-token-plan-cn、radius、together、xiaomi、xiaomi-token-plan-ams、xiaomi-token-plan-cn、xiaomi-token-plan-sgp、zai、zai-coding-cn。
anthropic:官方 Fast 需要speed: "fast"与 Fast beta header;当前 pi-ai0.82.1会在插件 Header 之后动态组装其他 Anthropic beta,无法安全合并全部 token,因此本版不默认启用。mistral:其延迟等级使用service_tier: "auto",并不是 OpenAIfast或通用priority;当前 serializer 边界尚未证明可以安全注入。groq:Performance Tier 使用service_tier: "performance",并有企业资格和模型限制,不能套用 OpenAI Fast。cerebras:仅符合资格的 dedicated endpoint 可使用service_tier: "priority",目前还是 private preview。deepseek:官方说明会忽略service_tier。- 未知或自建兼容网关:协议相似不等于支持付费 Fast,只有核验上游合同后才能配置精确 Provider/API profile。
这些被拒绝的内置 Provider 不能通过套用通用 OpenAI 风格策略或 custom 策略绕过。未知或自建 Provider 默认仍不启用,只有核验合同后才能添加精确 provider/model/API profile。
这些路由不会静默发送错误参数;UI 显示不可用,Host 开启请求也会失败关闭。
配置
内置 Provider 矩阵默认启用。fastProfiles 是附加/覆盖层,精确的 provider/model/api matcher 后写优先:
- id: dsh-model-modes
config:
includeDefaultFastProfiles: true
fastProfiles:
# 已核验的自建网关。Provider 与 API 必须精确;只有确认该路由
# 所有模型都使用同一 Fast 合同时,才应把 model 写成 '*'。
- provider: your-gateway
model: gpt-5.6
api: openai-responses
strategy: openai-fast
# Vertex 必须显式配置,因为 matcher 无法检查 endpoint location。
- provider: google-vertex
model: gemini-3.7-flash
api: google-vertex
strategy: vertex-priority
可用策略:
openai-fastopenai-codex-fastservice-tier-priorityfireworks-prioritygoogle-priorityvertex-prioritybedrock-priorityopenrouter-fastvercel-gateway-fastcustom
关闭全部内置规则,只使用自己的显式规则:
includeDefaultFastProfiles: false
只有 Provider 使用其他明确的 Fast 协议时才使用 custom:
fastProfiles:
- provider: your-gateway
model: your-model
api: openai-responses
strategy: custom
body:
acceleration:
tier: turbo
headers:
X-Gateway-Fast: "1"
为保证 Fast 正交,custom 会拒绝修改 model、provider、reasoning、reasoning_effort、thinking、thinkingConfig、effort 等字段。
通用思考程度
默认配置:
reasoningProfiles:
- provider: '*'
model: gpt-5.6
efforts:
minimal: minimal
low: low
medium: medium
high: high
xhigh: xhigh
max: max
ultra: ultra
provider: '*' 会扩展到所有由 llm-pi-ai 管理、且实际包含精确 gpt-5.6 model id 的 Provider,不区分官方、本机或用户自定义 Provider,也不对 myself 做特殊处理。精确 Provider 声明会覆盖同一路由的通配声明。未知模型、其他 adapter 管理的 Provider 和不包含该 model id 的 Provider 不会被修改。
DSH rc.6 的 pi-ai adapter 原生有七个 transport effort id。插件不会改写已有持久化原生档位,只会补充 profile 声明但尚未存在的原生 key,并在官方选择器中追加 Ultra。只有用户明确选择 Ultra 的那一次请求会获得 request-local model clone,并在该 clone 上临时使用内部载体发送配置的 Ultra wire 值。Max、Off、Provider Default 与其他普通请求始终使用原模型和原 settings。
对于默认 gpt-5.6 profile:
| 官方 UI 选择 | Provider 最终 wire 值 |
|---|---|
Max |
max |
Ultra |
ultra |
不存在持久化的 max -> ultra 映射:Max 与 Ultra 是两个独立选项,也是两个独立的最终 wire 值。v0.1.2 还会把旧版插件曾生成的 max: ultra 或 off: ultra 设置迁回原生映射,因此禁用或卸载插件后,普通请求也不会残留发送 Ultra。
如果精确路由已有手工 reasoningEfforts,插件会保留已有档位的 provider 专属 wire 值,只补充配置中声明但缺失的档位,因此可以在不改动 Max 的前提下增加独立的 Ultra。只有确认要完整替换已有映射时,才在精确 provider/model profile 中使用:
overrideExisting: true
Provider 通配 profile 禁止 overrideExisting,避免批量覆盖无关路由。adapter 原生已经提供的能力仍保持权威,除非精确模型 profile 明确需要补充配置。
安装
dsh plugin --profile web add \
https://github.com/DTSFO/dsh-model-modes/archive/refs/tags/v0.1.3.tar.gz
然后启动:
dsh web
卸载:
dsh plugin --profile web remove dsh-model-modes
开发
pnpm install
pnpm run check
dsh plugin --profile web add /absolute/path/to/dsh-model-modes
已知限制
- Fast 开关是进程内状态;Host 重启后默认关闭。Provider 最终 payload 不会写回 Session 历史。
- Fast 状态绑定开启时的精确 provider/model;切换模型后 UI 会重新查询能力,当前请求仍使用创建 iterable 时冻结的状态。
- Provider 的服务等级可能需要账户资格、区域容量或额外计费。
- 虚拟
Ultra与 Fast request bridge 针对 DSH rc.6 / pi-ai0.82.1当前接口;无法安全装饰时会明确警告或拒绝,不会降档或切路由。
Provider 文档
- OpenAI Fast mode
- OpenAI Codex Fast mode
- xAI Priority Processing
- Gemini Priority Inference
- Vertex AI Priority PayGo
- Amazon Bedrock Service Tiers
- OpenRouter Service Tiers
- MiniMax Anthropic-compatible API
- Vercel AI Gateway Fast mode
- Fireworks serving paths
- Fireworks serverless pricing
- Anthropic Fast mode
- Mistral Priority Tier
- Groq Performance Tier
- Cerebras Service Tiers
- DeepSeek Responses API
MIT
原始 README: https://github.com/DTSFO/dsh-model-modes/blob/main/README.zh.md ↗
同类插件
查看全部 →
agent-vision-toolkit
为纯文本模型"看图“设计更好的视觉工具箱和技能,支持多图理解,图片问答,前端UI还原、GUI 自动化等,并可选无缝接入多个主流agent,直接识别粘贴图片| A vision toolkit and skill designed for text-only llms — image Q&A, long-screenshot OCR, frontend UI restoration, and GUI automation, with optional seamless integration for Codex, Claude Code, Pi, Oh My Pi, and OpenCode

api-relay-audit
从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。

OpenStory
✨ OpenStory 现已支持 DeepSeek Harness 插件! 现在可以通过 dsh-openstory 将 OpenStory 多智能体推演接入 DeepSeek Harness,让 agent 直接启动模拟、查看角色、下达指令并逐回合推进故事。查看 DSH 插件配置与使用指南。

phi
pi的编码代理 ∞ 提供者、子代理、hashline编辑和权限门

anysearch-dsh
DeepSeek Harness(DSH)的 AnySearch 网络搜索提供方与高级搜索工具。

codex-switch
Codex Switch 是一个 macOS 工具,一键配置 Codex 的自定义 API,同时保留官方 OpenAI 登录。保存后 Codex 的模型选择器里只会出现你选的那个 provider 的模型。也支持 Claude Code 的官方 / 自定义 API 切换。Codex Switch is a lightweight helper for configuring multiple coding-agent API routes. For Codex, it keeps Official OpenAI and a custom API provider configured in parallel, registers the custom model in Codex's mod