dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:youshanlian/dsh-plugin-strata
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
dsh × 本地 strata 的一体化控制面。 装上之后,你在 dsh 里选中一个 strata 模型,路由器就替你把它预热好——冷启动那 20-30 秒发生在选中的一刻,而不是第一次提问的时候。 GUI 顶部多一枚状态芯片:当前加载的是哪个模型、正在切换还是空闲、加载进度,实时可见(悬停看详情)。 输入区旁多一个「调参」面板:直接编辑当前模型的 run-config(温度 / top_p / top_k / min_p / 思考预算 / 显存预留 / MTP / 别名表…16 键,保存后「重启生效」约 25 秒)和 strata 全应用共享的聊天设置(思考档位 / 采样默认值,保存即生效)。 模型切换路由本身也有三个工具:
strata_hop(status / models / warm / logs)、strata_status(实时状态)、strata_params(读改以上两类设置)——agent 也能自己动手调参。 对推理只读:插件从不发 prompt、不消耗 token;它只管理你自己的路由器。One plugin for dsh + a local strata stack. Warm-on-selection model preloading, a live load/switch status chip in the web GUI, a run-config + shared chat-settings tuning panel, and agent tools (
strata_hop/strata_status/strata_params) to control your own strata-hop :8080 router. Read-only toward inference: it never sends a prompt and spends no tokens.dsh plugin --profile web add github:youshanlian/dsh-plugin-strata # 一键安装(需 dsh CLI)没装过 dsh CLI?跑一行引导脚本(执行上面那条命令 + 装后校验):
bash <(curl -fsSL https://raw.githubusercontent.com/youshanlian/dsh-plugin-strata/main/install.sh)前置条件是系统侧已经跑着 strata + strata-hop(见下文前置条件);模型 id 需与你的 hop 配置一致(见常见坑)。
一个插件,四件事(合并自独立功能):
cordis.patch.yml,默认写入 provider strata
(baseURL: http://127.0.0.1:8080/v1,模型 id 与 hop 配置键一致)。strata_hop:管理 127.0.0.1:8080 的 strata-hop
(status / models / warm / logs)。路由器源码在 router/strata-hop.py
(含 /warm、/loaded 端点)与 router/strata-hop.service。GET /events)+ Web GUI 顶部状态芯片 +
工具 strata_status;GUI 里选中 strata 模型即自动 POST /warm 预热引擎
(冷启动发生在第一次请求之前,而不是请求期间)。strata_params + GUI 输入区旁的「调参」面板:
编辑当前加载模型的 strata run-config(sampling.temperature / top_p / top_k /
min_p、思考预算、显存预留、别名表等 16 键),保存进 hop 维护的模型 profile,
下次启动生效。GET/POST /settings 由 monitor 代理),保存立即生效且持久化,
无需重启。对推理只读:插件从不发 prompt、不消耗 token。写操作只有:warm(幂等预热)、
run-config 调参(只改下次启动用的配置)、聊天设置(共享默认值,立即生效)、以及显式的
「重启生效」(hop 卸载后带 force
重新预热同一模型,同样不发 prompt)。真正的模型切换仍由 dsh 的模型选择器触发。
strata-hop: ~/.local/share/strata-hop/strata-hop.py (本包 router/ 内有同款源码)
配置: ~/.config/strata/strata-hop.json (示例见 router/strata-hop.example.json)
密钥: ~/.config/strata/strata-hop.env (STRATA_API_KEY)
systemd: ~/.config/systemd/user/strata-hop.service(本包 router/ 内有同款 unit)
一条命令装进任意 profile(实测于 dsh 0.2.1-rc.2;bundle 会自动注册进 profile 的
dsh.profile.bundles,插件自带的 cordis.patch.yml 默认启用插件行和 provider strata):
dsh plugin --profile web add github:youshanlian/dsh-plugin-strata
# 之后重启该 profile 的 dsh 即可看到状态芯片与「调参」面板
没有 dsh CLI 或想连 dsh 本体一起装,用仓库根目录的引导脚本:
bash <(curl -fsSL https://raw.githubusercontent.com/youshanlian/dsh-plugin-strata/main/install.sh)
# 指定 profile: … install.sh --profile <name>;预览不执行:加 --dry-run
装好后若模型 id 与你的 hop 配置不同,在 profile 的补丁层覆盖 llm-pi-ai 的
providers.strata(整条替换,非内置目录的条目要写全 api / baseURL / models)。
开发模式(本机源码改动即时生效)才用 file: 链接:
// ~/.dsh/profiles/<profile>/package.json
"dependencies": { "dsh-plugin-strata": "file:/path/to/dsh-plugin-strata" },
"dsh": { "profile": { "bundles": [ …, "dsh-plugin-strata" ] } }
| 键 | 默认 | 说明 |
|---|---|---|
hopUrl |
http://127.0.0.1:8080 |
strata-hop 地址 |
hopConfig |
~/.config/strata/strata-hop.json |
hop 配置(读 catalog/默认模型) |
hopEnvFile |
~/.config/strata/strata-hop.env |
读密钥的兜底文件 |
apiKeyEnv |
STRATA_API_KEY |
hop 的鉴权环境变量名 |
unit |
strata-hop.service |
journalctl 跟踪的 systemd user unit |
host / port |
127.0.0.1 / 8756 |
状态服务器绑定(GUI 芯片用 LAN 需设 0.0.0.0) |
followJournal |
true |
跟随 hop 日志 |
pollSeconds |
2 |
被动探测间隔 |
warmOnSelection |
true |
选中模型即预热 |
warmProvider |
strata |
只预热该 provider 的选择,云端选择不动 |
调的是 strata serve 的 run-config(hop 维护在每个模型 profile JSON 里,hop 会留
.bak 备份),不是 dsh 侧的 provider 参数。可调键与 serve 端 runconfig.py 的
EDITABLE 表一致(本包 lib/params.js 的 PARAM_SPEC 是同一份规范的镜像):
sampling.temperature/top_p/top_k/min_p、reasoning_budget_tokens、fit_max_tokens、
anthropic_thinking、effort_position、aliases、idle_unload_s、mtp、lazy_load、
engine_silence_s、api_monitor、open_browser、vram_reserve_mib。
三个入口,同一套校验(全有或全无:一个键非法就整体不写):
strata_params —— action: get 读当前视图;action: set 传
set_json: '{"sampling.temperature": 0.6, "mtp": null}';action: restart 重启生效。GET /params、POST /params {"set": {...}}、
POST /restart {"model": ...}。语义要点:
action: restart)= hop POST /unload 后
POST /warm {force:true} 重新拉起同一模型:约 25 秒冷启动,不发 prompt、不耗 token。/config 由活着的引擎应答)。没加载时
GUI 显示 profile 的只读内容(source: "file"、writable: false),先在 dsh 里选中
strata 模型(会自动预热)再编辑。_own_page 防护会拒外来 Origin(403),所以 GUI
一律走 monitor 代理(monitor 用 ~/.config/strata/strata-hop.env 的密钥访问 hop)。
不要手改 profile JSON —— hop 是这些文件的属主。restart 之后 GUI 会轮询 /events,就绪后自动刷新面板。这就是 strata 8081 聊天界面里 Sampling 按钮打开的采样抽屉(思考档位 / 温度 /
top_p / top_k / max tokens / seed / 显示思考 / 速度预测 / MCP / "Use for other apps
too"),不在别的设置页。抽屉里勾上「Use for other apps too」保存时,把当前值 POST 到
/settings 成为所有应用共享的默认值(持久化在
<配置基名>.shared-settings.json)——dsh 的调参面板/工具管的就是这同一份共享默认值:
strata_params —— action: settings_get 读取;action: settings_set 传
set_json: '{"reasoning_effort": "medium", "temperature": 0.7}',set_json: "null" 清空全部。GET /settings、POST /settings {"defaults": {...}}
({"defaults": null} 清空)。可调 8 键(lib/params.js 的 SHARED_SPEC 与 serve 的 clean_shared_defaults 一致):
reasoning_effort(思考档位 none/low/medium/high)、temperature、top_p、top_k、
seed、max_tokens、reasoning_budget_tokens、experimental_speed_projection。
语义要点:
max_tokens;模型条目带
reasoningEfforts(见 cordis.patch.yml),dsh 聊天设置里选了 Effort 就把对应
reasoning_effort 随请求发出,此时聊天设置里的思考档位只在未选时兜底。settings_get 合并再提交。reasoningEfforts 出现在模型选择里。node tools/smoke.js [--port 8757] # 独立冒烟:监控 + hop 只读探测 + /params、/settings 路由与非法值拒绝,不动引擎
dsh --profile web --dump-config # 校验 bundle/补丁装配
本插件走的是社区索引流程:在 awesome-dsh-plugin
提一个 PR,新增 data/plugins/youshanlian__dsh-plugin-strata.yml:
url: https://github.com/youshanlian/dsh-plugin-strata
name: youshanlian/dsh-plugin-strata
category: model
tarball: https://github.com/youshanlian/dsh-plugin-strata/releases/latest/download/dsh-plugin-strata.tgz
description.en: >-
…(一句以句号结尾的英文简介)
要点:dsh.bundle.patch 必须声明(否则索引器不给 npm:/tarball: 字段);条目里不要手写
npm:;Release 资产名不带版本号,releases/latest/download 永远指向最新;需要
dsh-plugin topic 与 SPDX LICENSE,仓库创建需满 1 天。合并后即出现在 dsh Web 插件页,
可直接搜索并点「安装」。
自建私有市场(自定义插件市场 URL)才需要官方生成器:
pnpm --filter @deepseek-ai/dsh-plugin-market-generator start \
--input plugins.txt --output site/index.json --title "…"
把 index.json 放到静态可访问(2xx、无重定向)的位置(如 GitHub Pages),
在 dsh Web 插件页 → 实验性插件 → 自定义插件市场里添加该 URL 即可。
journalctl --user / systemctl --user)。非 systemd 环境把插件配置
followJournal: false,被动探测与 GUI 芯片仍可用。router/strata-hop.py 只用标准库,无需 pip 依赖。cordis.patch.yml 里的两个模型 id
只是示例,必须与你 hop 配置里 models 的键一致。不一致时在 profile 的
cordis.patch.yml 覆盖 providers.strata——注意 provider 条目是
整条替换,非内置目录的条目要写全 api / baseURL / models。http://<GUI 主机名>:8756/events 连接
(端口写死在客户端),不要改插件 port。要从局域网设备访问 GUI 时,
把插件 host 设为 0.0.0.0 并放行防火墙 8756(GUI 端口同理)。router/strata-hop.service 里的 /home/USER
与 strata 安装路径需按你的机器替换。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。