dsh-plugin-local-infer 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +8 -1
- package/cordis.patch.yml +6 -6
- package/docs/screenshot-20261014.png +0 -0
- package/docs/zh/README.md +100 -0
- package/dsh/client.js +644 -143
- package/dsh/host.js +1 -1
- package/package.json +14 -11
- package/packages/core/lib/adapter.d.ts +75 -4
- package/packages/core/lib/debug.d.ts +1 -1
- package/packages/core/lib/debug.js +1 -1
- package/packages/core/lib/index.d.ts +3 -2
- package/packages/core/lib/index.js +2 -1
- package/packages/core/lib/launch-command.d.ts +13 -0
- package/packages/core/lib/launch-command.js +64 -0
- package/packages/core/lib/models.d.ts +2 -1
- package/packages/core/lib/models.js +10 -1
- package/packages/core/lib/status.d.ts +9 -1
- package/packages/core/lib/status.js +6 -1
- package/packages/core/package.json +1 -1
- package/packages/providers/lib/acquire.d.ts +125 -0
- package/packages/providers/lib/acquire.js +325 -0
- package/packages/providers/lib/adapters.d.ts +43 -6
- package/packages/providers/lib/adapters.js +386 -58
- package/packages/providers/lib/debug.d.ts +1 -1
- package/packages/providers/lib/debug.js +1 -1
- package/packages/providers/lib/deps.d.ts +6 -4
- package/packages/providers/lib/deps.js +17 -3
- package/packages/providers/lib/engines.d.ts +6 -5
- package/packages/providers/lib/engines.js +12 -4
- package/packages/providers/lib/guidelines.d.ts +2 -2
- package/packages/providers/lib/guidelines.js +17 -1
- package/packages/providers/lib/hyperqwen.d.ts +2 -2
- package/packages/providers/lib/hyperqwen.js +1 -1
- package/packages/providers/lib/index.d.ts +10 -4
- package/packages/providers/lib/index.js +9 -5
- package/packages/providers/lib/infernix.d.ts +170 -0
- package/packages/providers/lib/infernix.js +671 -0
- package/packages/providers/lib/llamacpp.d.ts +2 -2
- package/packages/providers/lib/llamacpp.js +1 -1
- package/packages/providers/lib/model-defaults.d.ts +7 -5
- package/packages/providers/lib/model-defaults.js +28 -4
- package/packages/providers/lib/ninfer.d.ts +9 -2
- package/packages/providers/lib/ninfer.js +10 -3
- package/packages/providers/lib/platform.d.ts +31 -0
- package/packages/providers/lib/platform.js +58 -0
- package/packages/providers/lib/presets.d.ts +2 -2
- package/packages/providers/lib/presets.js +1 -1
- package/packages/providers/lib/strata.d.ts +2 -2
- package/packages/providers/lib/strata.js +1 -1
- package/packages/providers/lib/vram.d.ts +2 -2
- package/packages/providers/lib/vram.js +1 -1
- package/packages/providers/package.json +3 -3
- package/packages/service/lib/index.d.ts +63 -20
- package/packages/service/lib/index.js +279 -43
- package/packages/service/lib/types.d.ts +44 -2
- package/packages/service/package.json +2 -2
- package/packages/tool/lib/index.d.ts +1 -1
- package/packages/tool/lib/index.js +1 -1
- package/packages/tool/package.json +3 -3
- package/packages/ui/lib/deps.d.ts +2 -2
- package/packages/ui/lib/deps.js +1 -1
- package/packages/ui/lib/form.d.ts +2 -2
- package/packages/ui/lib/form.js +1 -1
- package/packages/ui/lib/index.d.ts +1 -1
- package/packages/ui/lib/index.js +1 -1
- package/packages/ui/lib/meter.d.ts +2 -2
- package/packages/ui/lib/meter.js +1 -1
- package/packages/ui/lib/route.d.ts +84 -13
- package/packages/ui/lib/route.js +496 -56
- package/packages/ui/lib/warnings.d.ts +2 -2
- package/packages/ui/lib/warnings.js +1 -1
- package/packages/ui/package.json +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright Derek "cybtachyon" Reese
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
> For those who want more performance out of their specific hardware than what Unsloth gives out of the box.
|
|
6
6
|
|
|
7
|
+
[](https://github.com/cybtachyon/dsh-plugin-local-infer/blob/main/LICENSE)
|
|
8
|
+
[](https://www.npmjs.com/package/@deepseek-ai/dsh)
|
|
9
|
+
[](https://github.com/topics/dsh-plugin)
|
|
10
|
+
|
|
7
11
|
A DeepSeek Harness plugin that manages local inference engines:
|
|
8
12
|
|
|
9
13
|
- llama.cpp
|
|
10
14
|
- NInfer
|
|
11
15
|
- Hyper-Qwen (vLLM)
|
|
16
|
+
- Infernix
|
|
12
17
|
- Strata
|
|
13
18
|
- ...with more coming soon.
|
|
14
19
|
|
|
@@ -34,7 +39,8 @@ The **Engine settings** card mounts on the Plugins page (older hosts: the Settin
|
|
|
34
39
|
- **Watch the VRAM Est. meter.** It prices weights, KV cache, overhead, and workspace against your card as you adjust values, and shows the verdict (`fits` / `tight` / `over`) and the largest context that fits.
|
|
35
40
|
- **Read the warnings.** Red banners and inline field warnings fire when a parameter value, or the presence of a parameter, is unsafe for your detected hardware.
|
|
36
41
|
- **Satisfy the system dependencies.** The panel lists each missing host dependency (docker, CUDA toolkit, ffmpeg, hf CLI, ...) with its purpose, a copy/paste install string for your OS, and an optional one-click **Run** (sudo). The **Get** button stays disabled until every dependency reports satisfied.
|
|
37
|
-
- **
|
|
42
|
+
- **Get.** With the dependencies satisfied, `Get` syncs the engine's source: it clones the engine's git repo (or the **Engine Fork** you provided) into the **Engine Directory** override, defaulting to the model directory under the engine name. An existing checkout with local changes aborts with an alert in **Logs**; a clean one fetches the listed fork (added as its own remote) and rebases onto the upstream branch. It then runs the system dependencies and the engine's build steps. Every line streams into the **Logs** section as it lands. `Launch` stays disabled while a Get runs and re-enables when the build finishes, errors, or falls silent for 2 minutes.
|
|
43
|
+
- **Launch / Stop.** `Launch` deploys the engine (builds the checkout, or pulls the image in docker mode), downloads the model, starts it, and polls its health endpoint. `Stop` shuts it down.
|
|
38
44
|
- **Register / Remove.** `Register` publishes the confirmed-working engine to DSH as a model (optionally as the agent default model) through the settings service, so the change is revision-tracked and undoable. `Remove` pulls the entry back.
|
|
39
45
|
|
|
40
46
|
All values persist to `~/.dsh/local-infer/config.json`; the browser never sees a value it did not store.
|
|
@@ -60,6 +66,7 @@ All values persist to `~/.dsh/local-infer/config.json`; the browser never sees a
|
|
|
60
66
|
| Hyper-Qwen (vLLM) | Yes (compose) | No | `.env`-driven docker-compose profiles. |
|
|
61
67
|
| vLLM | No | No | Work-in-progress. |
|
|
62
68
|
| llama.cpp | Yes | Yes | Specified, not verified until the binary is available. |
|
|
69
|
+
| Infernix | No | Yes (cmake + CUDA) | C++/CUDA fork of NInfer tuned for Qwen models on a single RTX 50-series GPU. Local build only. |
|
|
63
70
|
| Strata | Yes | No | Placeholder engine; its parameter surface is empty until the flag set lands. |
|
|
64
71
|
|
|
65
72
|
Runtime requirements: Node `^22.19.0 || >=24.0.0`, pnpm 12.11.2 (pinned by `mise.toml`), and the `@deepseek-ai/cordis >= 4.0.1` peer dependency.
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# The
|
|
1
|
+
# The dsh-plugin-local-infer bundle patch: mounts the whole local-inference
|
|
2
2
|
# capability as ONE layer over an existing dsh profile.
|
|
3
3
|
#
|
|
4
4
|
# Row order carries no load semantics — activation is service-availability
|
|
@@ -14,29 +14,29 @@
|
|
|
14
14
|
# this row is what makes the client half reachable. The host module is a
|
|
15
15
|
# no-op; the capability lives in the four subpath rows below.
|
|
16
16
|
- id: local-infer
|
|
17
|
-
name: '
|
|
17
|
+
name: 'dsh-plugin-local-infer'
|
|
18
18
|
|
|
19
19
|
# Service Definition: publishes ctx.localInfer, the engine/preset/guideline
|
|
20
20
|
# registries, and the orchestration entry points (estimate, guidelines,
|
|
21
21
|
# deps, installString, runInstall, launch, registerModel). Carries no store
|
|
22
22
|
# of its own.
|
|
23
23
|
- id: local-infer-service
|
|
24
|
-
name: '
|
|
24
|
+
name: 'dsh-plugin-local-infer/service'
|
|
25
25
|
|
|
26
26
|
# Service Providers: the concrete engine adapters (ninfer, hyperqwen,
|
|
27
27
|
# llamacpp, strata), the NInfer VramModel, the built-in presets, the
|
|
28
28
|
# built-in guidelines, and the per-OS SystemDep install command data. Each
|
|
29
29
|
# registers itself with ctx.localInfer.
|
|
30
30
|
- id: local-infer-providers
|
|
31
|
-
name: '
|
|
31
|
+
name: 'dsh-plugin-local-infer/providers'
|
|
32
32
|
|
|
33
33
|
# Consumer: the model-facing local_infer_* tools (estimate, launch, status,
|
|
34
34
|
# register), their system-prompt section, and their per-tool timeout budgets.
|
|
35
35
|
- id: local-infer-tool
|
|
36
|
-
name: '
|
|
36
|
+
name: 'dsh-plugin-local-infer/tool'
|
|
37
37
|
|
|
38
38
|
# Web UI: the parameter form (form-type aware), the VRAM meter, the
|
|
39
39
|
# red-warning banner, the engine lifecycle controls, and the register-as-
|
|
40
40
|
# model confirmation.
|
|
41
41
|
- id: local-infer-ui
|
|
42
|
-
name: '
|
|
42
|
+
name: 'dsh-plugin-local-infer/ui'
|
|
Binary file
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# dsh-plugin-local-infer
|
|
2
|
+
|
|
3
|
+
> 本中文翻译由 Qwen3.8-27B 生成。欢迎提交 Pull Request 改进翻译。
|
|
4
|
+
|
|
5
|
+
> 面向那些希望从特定硬件中获得比 Unsloth 开箱即用更高性能的用户。
|
|
6
|
+
|
|
7
|
+
[](https://github.com/cybtachyon/dsh-plugin-local-infer/blob/main/LICENSE)
|
|
8
|
+
[](https://www.npmjs.com/package/@deepseek-ai/dsh)
|
|
9
|
+
[](https://github.com/topics/dsh-plugin)
|
|
10
|
+
|
|
11
|
+
一个 DeepSeek Harness 插件,用于管理本地推理引擎:
|
|
12
|
+
|
|
13
|
+
- llama.cpp
|
|
14
|
+
- NInfer
|
|
15
|
+
- Hyper-Qwen (vLLM)
|
|
16
|
+
- Infernix
|
|
17
|
+
- Strata
|
|
18
|
+
- ...更多即将推出。
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
选择一个模型和引擎,调节参数,实时观察 **VRAM 估算** 仪表,当某个值(或参数本身)对检测到的硬件不安全时立即看到 **硬件警告**,随后该插件会管理每个引擎的 **构建、部署和健康检查**,并在确认其正常工作后 **自动将其注册为 DSH 模型**。无需手动编辑易出错的 yaml 或启动器。
|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
命令行:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
dsh plugin --profile web add https://github.com/cybtachyon/dsh-plugin-local-infer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Web UI:点击 **插件** → **添加插件** → 粘贴 `https://github.com/cybtachyon/dsh-plugin-local-infer`。
|
|
33
|
+
|
|
34
|
+
## 使用插件
|
|
35
|
+
|
|
36
|
+
**引擎设置** 卡片挂载在插件页面(旧版本主机:设置页面)。
|
|
37
|
+
|
|
38
|
+
- **选择引擎和模型**,然后调节参数。每个字段根据其类型渲染:复选框、下拉框、滑块、文本、目录选择器,以及一个聊天模板组合框(已知模板加上自由文本)。
|
|
39
|
+
- **观察 VRAM 估算仪表。** 当你调整值时,它根据你的显卡对权重、KV 缓存、开销和工作区进行估算,并显示判定结果(`fits` / `tight` / `over`)以及能容纳的最大上下文。
|
|
40
|
+
- **阅读警告。** 当某个参数值,或某个参数的存在,对你的检测到的硬件不安全时,红色横幅和内联字段警告会触发。
|
|
41
|
+
- **满足系统依赖项。** 面板列出每个缺失的主机依赖项(docker、CUDA toolkit、ffmpeg、hf CLI、...),并附有其用途、针对你操作系统的复制粘贴安装字符串,以及可选的一键 **运行**(sudo)。**获取** 按钮在所有依赖项报告满足之前保持禁用状态。
|
|
42
|
+
- **获取。** 依赖项满足后,`获取` 会同步引擎源码:将引擎的 git 仓库(或你提供的 **引擎 Fork**)克隆到 **引擎目录** 覆盖项中;未覆盖时默认落在模型目录下以引擎命名的子目录。存在本地改动的已有检出会在 **日志** 中发出警告并中止;干净的检出会拉取所列的 fork(作为独立远程添加)并向上游分支 rebase。随后它会运行系统依赖项和引擎的构建步骤,每一行输出都会实时流入 **日志** 区。Get 运行期间 `启动` 保持禁用,并在构建完成、出错或 2 分钟无输出时重新启用。
|
|
43
|
+
- **启动 / 停止。** `启动` 部署引擎(构建检出,或在 docker 模式下拉取镜像)、下载模型、启动它,并轮询其健康端点。`停止` 将其关闭。
|
|
44
|
+
- **注册 / 移除。** `注册` 通过设置服务将确认工作正常的引擎作为模型发布到 DSH(可选地作为代理默认模型),因此该变更可被修订跟踪并可撤销。`移除` 将该条目拉回。
|
|
45
|
+
|
|
46
|
+
所有值都持久化到 `~/.dsh/local-infer/config.json`;浏览器永远不会看到它未存储的值。
|
|
47
|
+
|
|
48
|
+
## 支持的平台
|
|
49
|
+
|
|
50
|
+
### 操作系统
|
|
51
|
+
|
|
52
|
+
| 操作系统 | 状态 | 说明 |
|
|
53
|
+
| ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| Linux (Debian/Ubuntu, `apt`) | 已支持 | 安装块镜像可用的 NInfer 启动器:CUDA keyring 序列加上编译工具链。 |
|
|
55
|
+
| Linux (Arch, `pacman`) | 已支持 | `pacman` 块加上 `/opt/cuda` 导出行。 |
|
|
56
|
+
| Linux (Fedora, `dnf`) | 未测试 | 命令集已存在,在实时主机上标记为未测试。 |
|
|
57
|
+
| macOS (`brew`) | 部分支持 | CPU/docker 路径(llama.cpp)。macOS 上没有 NVIDIA Container Toolkit,因此 CUDA 引擎的 docker 路径不可用。 |
|
|
58
|
+
| Windows (WSL2) | 未测试 | WSL2 被检测,dflash2 固定内存规则触发;命令集标记为未测试。 |
|
|
59
|
+
| Windows | 部分支持 | 代码路径仅部分编写;需要进一步开发。 |
|
|
60
|
+
|
|
61
|
+
### 引擎
|
|
62
|
+
|
|
63
|
+
| 引擎 | Docker | 本地构建 | 状态 |
|
|
64
|
+
| ----------------- | ------------ | ----------------- | -------------------------------------------------- |
|
|
65
|
+
| NInfer | 是 | 是 (cmake + CUDA) | 参考引擎。针对 Qwen 27B/35B 制品的实测 VRAM 模型。 |
|
|
66
|
+
| Hyper-Qwen (vLLM) | 是 (compose) | 否 | 由 `.env` 驱动的 docker-compose 配置。 |
|
|
67
|
+
| vLLM | 否 | 否 | 进行中。 |
|
|
68
|
+
| llama.cpp | 是 | 是 | 已指定,在二进制可用之前未验证。 |
|
|
69
|
+
| Infernix | 否 | 是 (cmake + CUDA) | NInfer 的 C++/CUDA 分支,针对单张 RTX 50 系 GPU 的 Qwen 模型调优;仅本地构建。 |
|
|
70
|
+
| Strata | 是 | 否 | 占位符引擎;在其标志集落地之前,其参数表面为空。 |
|
|
71
|
+
|
|
72
|
+
运行时要求:Node `^22.19.0 || >=24.0.0`、pnpm 12.11.2(由 `mise.toml` 固定),以及 `@deepseek-ai/cordis >= 4.0.1` 同级依赖。
|
|
73
|
+
|
|
74
|
+
## 硬件指南
|
|
75
|
+
|
|
76
|
+
每台常见机器在实际中能为你带来什么。能力印象来源于 [r/LocalLLaMA](https://www.reddit.com/r/LocalLLaMA/) 用户帖子。"共享" 指统一内存(模型和操作系统共享内存池)。
|
|
77
|
+
|
|
78
|
+
| 硬件 | 内存 | 你能得到的 |
|
|
79
|
+
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
80
|
+
| NVIDIA RTX 5090 | 32 GB VRAM | 可靠地容纳最多 23 GB 的模型权重,支持 240k+ 上下文和视觉。能处理复杂的编码和视觉任务,但需要特殊工具来处理非常长或复杂的任务。 |
|
|
81
|
+
| NVIDIA RTX 4090 | 24 GB VRAM | 社区主力。Q4 量化下可容纳 30B 级模型并驱动编码代理;70B 需要缓慢的 CPU 卸载。性价比最高的单卡。 |
|
|
82
|
+
| NVIDIA RTX 3090 | 24 GB VRAM | 二手卡的性价比之王。与 4090 相同的 24 GB,但属于较旧的世代:Q4 量化下 32B 及适度的上下文,不支持 FP8。单卡有限制;常见建议是配两张。 |
|
|
83
|
+
| NVIDIA RTX PRO 6000 | 96 GB VRAM | 接近前沿的稠密模型(70B–80B)可完全装入内存并支持长上下文,32B 模型甚至可以进行微调(LoRA、全量 FT)。消费级上限。 |
|
|
84
|
+
| NVIDIA RTX PRO 5500 | 84 GB VRAM | 面向机架的 84 GB 级别:70B 级模型有余量,价格更低且接近 PRO 6000。 |
|
|
85
|
+
| NVIDIA Tesla V100 | 32 GB VRAM | 便宜的二手 HBM2 服务器卡。Q4/Q8 量化下 30B 级模型,速度可观(带宽对推理而言才是关键);不支持 FP8,功耗高。预算型家庭实验室之选。 |
|
|
86
|
+
| NVIDIA Tesla V100 | 16 GB VRAM | 预算入门。Q8 量化下 13B–14B,或带卸载的 30B。NVLink 双卡翻倍容量。以现代标准来看较慢,但对推理而言出乎意料地扎实。 |
|
|
87
|
+
| NVIDIA RTX 5090 Laptop | 24 GB VRAM | 移动端 4090。Q4 量化下 32B 勉强容纳;扣除上下文后现实上约为 Q4 的 ~17B。 |
|
|
88
|
+
| NVIDIA RTX 4090 Laptop | 16 GB VRAM | GPU 对 LLM 而言过剩,而 VRAM 却不足:Q4/Q5 量化下 8B–14B,上下文较小。 |
|
|
89
|
+
| NVIDIA GB10 (DGX Spark) | 128 GB 共享 | 桌面 AI 开发机。35B MoE 以 ~100 tok/s 运行;120B+ MoE 可容纳但较慢。容量优先于速度。 |
|
|
90
|
+
| NVIDIA GB10 (DGX Spark) | 64 GB 共享 | 一半内存池:带上下文的 32B–35B MoE;70B 较为紧张。 |
|
|
91
|
+
| NVIDIA RTX N1X | 128 GB 共享 | 下一代 GB10 级笔记本:笔记本中的 DGX Spark 级容量。非常新,几乎没有真实世界数据。 |
|
|
92
|
+
| NVIDIA RTX N1X | 64 GB 共享 | 64 GB 级别:带上下文的 32B 级。 |
|
|
93
|
+
| Apple M4 Ultra | 256 GB 共享 | 容量之王。200B+ MoE 和 128K 上下文的 70B 均可容纳;70B 预期 ~5 tok/s。单 token 较慢,容量无出其右。 |
|
|
94
|
+
| Apple M4 Ultra | 128 GB 共享 | 70B–120B 级可容纳且有余量;~5 tok/s。容量出色,速度较慢。 |
|
|
95
|
+
| AMD Radeon AI PRO R9700 | 32 GB VRAM | AMD 的 32 GB Vulkan 卡。Q8 量化下 32B 约 $1,300,性价比较高;`radv` 驱动并非符合规范的 Vulkan 实现。 |
|
|
96
|
+
| AMD Ryzen AI Max+ PRO 495 | 160 GB 共享 | UMA 怪兽。120B+ MoE 可容纳,编码代理运行良好(Qwen3-Coder 级模型针对 UMA 调优);$7k+ 系统,速度慢于独立 GPU。 |
|
|
97
|
+
| 2x NVIDIA RTX 3090 | 48 GB VRAM | 社区的"可用作本地 LLM 的最低配置":Q4/Q5 量化下的 70B。 |
|
|
98
|
+
| 2x NVIDIA RTX 4090 | 48 GB VRAM | 带上下文的 Q4 量化 70B;exllama2 量化运行快速。 |
|
|
99
|
+
| 2x NVIDIA RTX 5090 | 64 GB VRAM | 带卸载的 ~10 tok/s,支持 128k 上下文的 120B MoE(GPT-OSS-120B)。 |
|
|
100
|
+
| 2x NVIDIA Tesla V100 (NVLink) | 64 GB VRAM | 预算型 64 GB:NVLink 带宽下低量化的 70B;较旧的架构,不支持 FP8。 |
|