ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

DeepSeek Harness虚拟机部署体验

DeepSeek Harness虚拟机部署体验 DeepSeek于2026年8月13日开源了生产级Agent运行时框架DeepSeek Harness本文简要概述什么是DeepSeek Harness并在CentOS虚拟机环境部署体验。1、DeepSeek Harness介绍1.1 什么是DeepSeek HarnessDeepSeek 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 9Node.js≥ 22.19.0官方硬性要求推荐 22 LTS内存/磁盘建议 2C4G 以上npm 缓存与插件约需 1~2GB网络可访问 npm registry、GitHub、api.deepseek.comAPI KeyDeepSeek API Keyplatform.deepseek.com 申请sk- 开头端口默认 3080Web UI3.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 --version2步骤二安装 pnpm源码部署需要npm install -g pnpm pnpm --version3步骤三安装 DeepSeek Harness方式 Anpm 一键启动最快体验 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 方式 DPython SDK需 Python ≥ 3.10 python3 -m pip install deepseek-harness-sdk使用全局安装npm install -g deepseek-ai/dsh4步骤四配置环境变量echo export PATH/usr/local/node/bin:$PATH ~/.bashrc source ~/.bashrc dsh --version [rootcentos8-tango-01 ~\]# dsh --version 0.1.0-rc.6查看dsh支持命令[rootcentos8-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 profiles 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 apps own flags follow plugin [options] [args...] manage a profiles 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 apps own flags and help dsh plugin --profile tui add package install a plugin into the tui profile5步骤五配置API key# 环境变量方式 echo export DEEPSEEK_API_KEYsk-你的密钥 ~/.bashrc source ~/.bashrc6启动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-access0.1.0 1 package方法2本地电脑执行命令配置ssh通道可以直接访问到虚拟机服务端的127.0.0.1ssh -L 3080:127.0.0.1:3080 rootxx.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 张A1、J11、Q12、K13 - 内置 24 点求解器穷举所有括号结构 有理数求值默认**保证每局有解**可关掉开关体验无解牌局 - 发牌带逐张翻牌动画牌面可点击快速输入数值 ** 表达式验证** - 自研分词器 递归下降解析器不用 eval支持 − × ÷、括号、隐式乘法如 2(34)、一元正负号、全角括号 - 三重校验语法正确 → **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元。最后出来的结果如下参考资料官方 GitHubhttps://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 北京大学
返回列表