DeepSeek于2026年8月13日开源了生产级Agent运行时框架DeepSeek Harness,本文简要概述什么是DeepSeek Harness,并在CentOS虚拟机环境部署体验。
1、DeepSeek Harness介绍
1.1 什么是DeepSeek Harness
DeepSeek Harness(命令行简称 dsh)是DeepSeek于2026年8月13日正式发布并开源的首款Agent产品。它不是新的大模型,也不是API客户端,而是智能体运行时框架(Agent Harness):负责把模型接入文件系统、终端、网页、代码工具和其他Agent,并组织上下文、工具调用与任务执行的整套基础设施。官方给出的设计理念为:
Model + Harness = Agent
简单来说:模型负责思考推理,Harness负责实际执行。它负责把大模型“接”进真实世界的那一层,如读写文件、调用工具、执行命令、控制权限、决定重试还是中止,可以把它理解成AI的“操作系统外壳”。
1.2 核心设计理念:一切皆插件
DeepSeek Harness最核心的设计理念是 “一切皆插件”(everything is a plugin)。整个框架由220+个独立npm包组成,包括模型、工具、技能、会话、沙箱、存储、循环、调度、UI 等所有Agent能力均由插件组合而成,可自由替换、灵活重组,并且支持运行时热插拔。其理论基础是 DeepSeek 联合北京大学发表的论文《A Programming Paradigm for Spatiotemporal Composability》,解决了传统插件系统"时空不可组合"(无法热卸载、依赖紊乱)的行业痛点。
整套框架是基于Cordis插件元框架打造。Cordis元框架仅承担插件加载、卸载和依赖管理的底层工作。全部业务组件为独立的Cordis插件,开发者无需改动Harness源码本身,就能以插件方式独立选择、替换或扩展其中的任一能力。这种“没有特权组件”的架构意味着产品的每一部分都是插件,包括模型适配器、工具注册表、会话日志,以及agent loop(智能体循环)本身,因此每一部分都可以从配置替换。该架构带来三个优势:
- 完全可定制:企业无需修改核心源码,即可通过插件替换任意模块(如替换沙箱、对接内部权限系统)
- 副作用可撤销:插件卸载后,其注册的服务、事件、资源会完整清理,无残留
- 渐进式扩展:可从最小内核开始,按需加载插件,适配从个人开发到企业级部署的全场景
1.3 DeepSeek Harness架构图
DSH采用四层插件化架构,自上而下分为接入层、业务插件层、基础能力插件层和核心内核层,底层对接外部依赖。

1.4 四种内置运行模式
DSH内置四种预设模式,对应不同插件组合:
- 标准模式:全量工具集,逐轮工具调用,适合通用开发与复杂任务
- PTC模式:模型生成TypeScript代码批量编排工具调用,低延迟、省Token,适合批量处理
- 极简模式:仅保留Bash +文件编辑,用于大模型编程能力基准测试
- 创造模式:支持热加载插件、自定义Agent预设,用于插件开发与调试

2、与其它主流Agent框架对比
DeepSeek Harness与其他框架最本质的区别在于没有“核心”。主流Agent架构是核心(Agent 循环、上下文管理、执行器)不可动+外挂扩展(MCP工具、Skills、Hooks等只能加不能改);DeepSeek Harness架构的Cordis则是运行时之上,模型适配器、工具注册表、会话/存储、沙箱/权限、Agent循环、调度、UI全部是插件,将Agent框架当作操作系统内核来做。
Cordis与传统DI容器和轻量钩子方案的关键差异在于可逆副作用。Cordis的插件是带依赖声明、生命周期、可逆副作用的“组件”,插件间可以声明依赖,卸载时能完整逆转副作用。在 DeepSeek Harness中,可以把后端的LLM插件从Model-A无缝替换为Model-B,而依赖它的组件(如Agent Loop)会自动重新连接到新的服务提供者,会话中的对话记录毫发无损。

3、CentOS虚拟机部署指南
3.1 环境要求
| 项目 | 要求 |
|---|---|
| 操作系统 | Linux;推荐 CentOS 8 Stream / CentOS 9 |
| Node.js | ≥ 22.19.0(官方硬性要求,推荐 22 LTS) |
| 内存/磁盘 | 建议 2C4G 以上;npm 缓存与插件约需 1~2GB |
| 网络 | 可访问 npm registry、GitHub、api.deepseek.com |
| API Key | DeepSeek API Key(platform.deepseek.com 申请,sk- 开头) |
| 端口 | 默认 3080(Web UI) |
3.2 安装步骤
1)步骤一:安装 Node.js
# 安装 NodeSource 的 Node.js 22 源
curl -fsSL https://rpm.nodesource.com/setup\_22.x | sudo bash -
# 安装 Node.js
sudo yum install -y nodejs
# 验证安装
node --version
npm --version
2)步骤二:安装 pnpm(源码部署需要)
npm install -g pnpm
pnpm --version
3)步骤三:安装 DeepSeek Harness
方式 A:npm 一键启动(最快体验)
npx @deepseek-ai/dsh web
方式 B:全局安装(推荐长期使用)
npm install -g @deepseek-ai/dsh
dsh --version # 验证安装
方式 C:源码安装(插件开发/二次开发)
npm install -g pnpm
git clone https://github.com/deepseek-ai/deepseek-harness.git
cd deepseek-harness
pnpm install
pnpm run build
方式 D:Python SDK(需 Python ≥ 3.10)
python3 -m pip install deepseek-harness-sdk
使用全局安装npm install -g @deepseek-ai/dsh

4)步骤四:配置环境变量
echo 'export PATH=/usr/local/node/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
dsh --version
[root@centos8-tango-01 ~\]# dsh --version
0.1.0-rc.6
查看dsh支持命令
[root@centos8-tango-01 ~]# dsh --help
Usage: dsh [options] [command] [args...]
dsh: boot a DeepSeek Harness profile — an ordered stack of plugin-bundle patch layers under your own overrides.
Arguments:
args arguments for the booted profile's app (see: dsh --profile <name> --help)
Options:
-V, --version output the version number
--profile <name> the profile under $DSH_HOME/profiles to boot
--patch <path> extra patch-list overlay applied after the profile layer (repeatable)
--dump-config print the composed profile tree and exit
--dump-default-config print the profile tree without its user layer or --patch overlays and exit
Commands:
web [options] [args...] boot the web profile (alias of --profile web); the web app's own flags follow
plugin [options] [args...] manage a profile's plugins by forwarding the remaining arguments to pnpm in the profile directory
Examples:
dsh --profile web boot the web profile (same as: dsh web)
dsh --profile headless "run the tests" answer one task, print the result, and exit
dsh --profile tui --patch ./extra.yml boot a custom profile with one extra overlay
dsh --profile tui --resume <session> arguments after the launcher flags reach the app
dsh --profile web --help the web app's own flags and help
dsh plugin --profile tui add <package> install a plugin into the tui profile
5)步骤五:配置API key
# 环境变量方式
echo 'export DEEPSEEK_API_KEY=sk-你的密钥' >> ~/.bashrc
source ~/.bashrc
6)启动Web服务进行验证
dsh --profile web --host 0.0.0.0 --port 3080

通过本地电脑访问服务IP和端口

直接访问远端服务会提示“crypto.randomUUID is not a function”。有两种方法可以解决
- 方法1:安装dsh-lan-access插件
# dsh plugin --profile web add dsh-lan-access
[WARN] Request took 27553ms: https://registry.npmjs.org/dsh-lan-access
dependencies:
+ dsh-lan-access ^0.1.0
Packages: +1
+
[WARN] Request took 28613ms: https://registry.npmjs.org/pnpm
Packages are cloned from the content-addressable store to the virtual store.
Content-addressable store is at: /root/.local/share/pnpm/store/v11
Virtual store is at: node_modules/.pnpm
Progress: resolved 1, reused 0, downloaded 1, added 1, done
Done in 30.6s using pnpm v11.22.0
# dsh plugin --profile web list
Legend: production dependency, optional only, dev only
dsh-profile-web /root/.dsh/profiles/web (PRIVATE)
│
│ dependencies:
└── dsh-lan-access@0.1.0
1 package
- 方法2:本地电脑执行命令配置ssh通道,可以直接访问到虚拟机服务端的127.0.0.1
ssh -L 3080:127.0.0.1:3080 root@xx.xx.xx.xx
这是SSH 本地端口转发(Local Port Forwarding) 命令,它会建立一个加密的 SSH 隧道,通过自己的电脑访问远程虚拟机上的服务。配置好后访问http://127.0.0.1:3080,出来一个内测声明。

然后选择不同的模式,支持四种模式。

也可以在配置中配置模型,默认是DeepSeek自己的模型

3.3 场景验证
选择一个生成24点游戏的HTML页面进行验证,下方会显示Token的消耗情况。

完成 ✅ 已生成完整、可直接运行的 24 点游戏页面:**`24点游戏.html`**(单文件、无外部依赖,双击用浏览器打开即可玩)。
## 功能清单
**🎴 随机发牌**
- 从完整 52 张扑克牌(4 花色 × A~K)随机抽 4 张,A=1、J=11、Q=12、K=13
- 内置 24 点求解器(穷举所有括号结构 + 有理数求值),默认**保证每局有解**(可关掉开关体验无解牌局)
- 发牌带逐张翻牌动画,牌面可点击快速输入数值
**🔢 表达式验证**
- 自研分词器 + 递归下降解析器(不用 `eval`),支持 `+ − × ÷`、括号、隐式乘法(如 `2(3+4)`)、一元正负号、全角括号
- 三重校验:语法正确 → **4 张牌必须且只能各用一次**(多重集比对)→ 结果等于 24(浮点误差容差)
- 输入时**实时预览**:显示当前算式结果、是否等于 24、用牌是否相符
- 完整错误提示:非法字符、括号不匹配、除以 0、结果不是 24、用牌不符等
**⏱ 计时 & 计分**
- 本局用时(0.1s 精度)+ 总用时计时器
- 计分:基础分 = 12 − 用时/15 秒(最少 1 分);10 秒内答对 +3 神速奖励;连续答对连击加分(最多 +5)
- 换牌 −2 分、看答案 −1 分(均中断连击);无解牌局换牌不扣分
- 最佳得分存入 localStorage 持久化;答对/答错有 Web Audio 音效(可静音)
**其他**:手机屏幕键盘式输入面板(高亮当前手牌数值)、桌面实体键盘回车验证、重新开始、玩法说明折叠面板。
## 质量验证
- 对求解器、解析器、用牌校验跑了 30 项单元测试,全部通过(含 `8/(3−8/3)=24`、`5×(5−1/5)=24` 这类经典难题解,以及各种非法输入的正确报错)
- 页面整体脚本通过 `node --check` 语法检查
输出Agent执行的记录信息

单个任务消耗Token情况,花了38w Tokens、0.21元。

最后出来的结果如下:

参考资料:
- 官方 GitHub:https://github.com/deepseek-ai/deepseek-harness
- 官方架构文档:https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/architecture.zh.md
- 官方产品页:http://www.deepseek.com/harness/
- 论文:《A Programming Paradigm for Spatiotemporal Composability》(DeepSeek & 北京大学)
236



被折叠的 条评论
为什么被折叠?



