爱马仕(Hermes)本地部署,接入DeepSeek,超精简版
1.硬件与环境检查清单
Windows 版本:win 10 2004+ (Build ≥ 19041) Win 11 23H2+
检查方法:按 Win+R → 输入 winver → 回车
CPU 64 位,支持虚拟化
2.安装 WSL2
WSL2 是 Hermes 官方开发环境。 开发者自己也用 WSL2 写代码和测试。
2.1 启用 WSL 功能(方式一)
右击「开始」菜单 → 「Windows PowerShell (管理员)」 或 「终端 (管理员)」:
wsl --install
2.2 手动启用
- 控制面板 → 程序 → 启用或关闭 Windows 功能
- 勾选 ☑ 「适用于 Linux 的 Windows 子系统」和 ☑ 「虚拟机平台」
- 确定 → 重启
- 去
aka.ms/wsl2kernel下载安装 WSL2 内核更新包
完成后重启电脑(不能跳过!)。
3.安装 Ubuntu 22.04 子系统
3.1 安装 Ubuntu 22.04
选 Ubuntu-22.04 是目前**最稳妥、兼容性最好、教程最多**的选择。
wsl --install -d Ubuntu-22.04
3.2 更新系统
sudo apt update && sudo apt upgrade -y
3.3 安装基础工具包
sudo apt install -y curl wget git build-essential python3 python3-pip python3-venv
3.4 启用 systemd (关键!)
Hermes 的 Gateway 服务需要 systemd 才能在后台运行。
sudo nano /etc/wsl.conf
添加以下内容:
[boot]
systemd=true
📝 nano 是命令行文本编辑器。Ctrl+O 保存,Ctrl+X 退出。
然后关闭 Ubuntu,管理员 PowerShell 中:
wsl --shutdown
等 10 秒后重新打开 Ubuntu,验证:
systemctl list-units --type=service | head -10
能列出服务 → systemd 已启用。
3.7 启用用户驻留
sudo loginctl enable-linger $USER
验证:
loginctl show-user $USER | grep Linger
# 应输出:Linger=yes
至此,Linux 基础环境搭好了!
4.配置国内镜像源
以下操作需要在 Ubuntu 命令窗口(终端)中执行
4.1 配置 Ubuntu APT 镜像源
备份原文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
编辑:
sudo nano /etc/apt/sources.list
清空全部内容,粘贴:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
Ctrl+O 保存,Ctrl+X 退出。
验证:
sudo apt update
看到从 mirrors.tuna.tsinghua.edu.cn 下载 → 成功。
4.2 配置 PyPI 镜像源
Hermes 依赖大量 Python 包,必须加速。
配置 uv:
mkdir -p ~/.config/uv
cat > ~/.config/uv/uv.toml << 'EOF'
[pip]
index-url = "https://pypi.tuna.tsinghua.edu.cn/simple"
extra-index-url = ["https://pypi.mirrors.ustc.edu.cn/simple/"]
EOF
清华源为主 + 中科大源(或者阿里云源)为备用:python-olm 包仅中科大有。
5.安装 Node.js 与 npm
以下操作需要在 Ubuntu 命令窗口(终端)中执行
5.1 使用 nvm 安装(推荐)
# 官方源
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
CN GitHub 连不上,怎么办?用 Gitee 镜像:
curl -o- https://gitee.com/mirrors/nvm/raw/master/install.sh | bash
重新加载:
source ~/.bashrc
nvm --version # 验证 nvm
安装 Node.js 22 LTS:
nvm install 22
nvm use 22
nvm alias default 22
验证:
node --version # v22.x.x
npm --version # 10.x.x
5.2 CN配置 npm 国内镜像
npm config set registry https://registry.npmmirror.com
6.安装 Hermes Agent
6.1 官网上的安装命令:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
🇨🇳 安装脚本会自动检测网络。GitHub 不通时自动从国内镜像 cnb.cool 拉取。
Install ripgrep … ffmpeg … ? [Y/n] → 要不要安装这两个工具?(如果网络不好就不建议安装)
ripgrep更快的文件搜索(不装也能用,只是慢一点)
ffmpeg语音、音频功能(不装就不能发语音)
完成后,重新加载:
source ~/.bashrc
验证版本:
hermes --version
6.2 安装后的目录结构
~/.hermes/
├── config.yaml ← 主配置(模型、工具、网关)
├── .env ← 密钥(API Key 等敏感信息)
├── bin/ ← 可执行文件
├── hermes-agent/ ← 源代码
│ └── venv/ ← Python 虚拟环境
├── skills/ ← 技能文件
├── sessions/ ← 对话记录
├── logs/ ← 日志
│ └── gateway.log ← 网关日志
└── profiles/ ← 多 Profile 配置
7.配置 DeepSeek V4 模型
7.1 配置连接DS
方式一:交互式向导
hermes model
依次选:Provider → deepseek → Model → deepseek-v4-pro → 输入 API Key。
方式二:命令行
hermes config set model.default deepseek-v4-pro
hermes config set model.provider deepseek
# 然后在 .env 里设置 DEEPSEEK_API_KEY
7.2 验证连接
对话,询问:你是什么模型
收到正常的 AI 回复 → 配置完成!
8.如何在cmd窗口,输入Hermes打开爱马仕
在 C:\Users\Admin.local\bin\hermes.cmd 创建了一个批处理桥接文件,内容:
batch
@echo off
wsl hermes %*
检查这个目录 C:\Users\Admin.local\bin 是否在你的 Windows PATH 里,如果没有请添加。
你现在可以试试:
1. 打开一个新的 CMD 窗口(Win+R → cmd → 回车)
2. 输入 hermes → 回车
3. 爱马仕就启动了!
建议将上述步骤全部给Hermes来执行,最后验证!
至此,Hermes的CLI端已经全部配置完成!
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)