Hermes Agent 安装 - Windows 11

前置条件

确保windows系统已经安装了wsl框假,以及安装相应的Linux发行版。

1. 检查wsl框架

PS C:\WINDOWS\system32> wsl --version
WSL 版本: 2.7.3.0
内核版本: 6.6.114.1-1
WSLg 版本: 1.0.73
MSRDC 版本: 1.2.6676
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows: 10.0.26200.8524
PS C:\WINDOWS\system32>
wsl --install   									#若显示错误,需要安装wsl框架。

2. 安装Ubuntu发行版

建议选择 Ubuntu-22.04,成熟稳定的系统才是最佳选择。并且运行Hermes所需要的其他依赖,比如Node.js, Git, Python, Linux Shell, 对 Ubuntu-22.04 更兼容,这些基本都是基于 Ubuntu-20.04 / 22.04 开发调试的。

提供了两种方法,一是 PowerShell 运行安装命令(最便捷),另一种是导入rootfs(仅提供给无法科学上网,而且打不开Ubuntu官网,以及微软应用商店无法访问的朋友),两种方法都需要在wsl框架上运行。

2.1 PowerShell 运行安装命令
wsl.exe --list --online						#查看发行版信息,这一步可能需要用到科学上网,可选择国内镜像地址。
wsl.exe --install Ubuntu-22.04				#安装所需的环境系统,建议选择Ubuntu-22.04。

在这里插入图片描述

2.2 导入 rootfs

1- 下载rootfs(Ubuntu镜像),下载.tar.gz

https://cloud-images.ubuntu.com/wsl/

2- 导入到WSL

wsl --import Ubuntu D:\WSL\Ubuntu .\ubuntu.tar.gz
2.3 确认Ubuntu已安装

PowerShell运行后,会直接进入Ubuntu,并且第一次进入需要设置账号密码。
导入rootfs后,需要执行:

#查看版本以及运行状态
PS C:\WINDOWS\system32> wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-22.04    Running         2

#进入Ubuntu
PS C:\WINDOWS\system32> wsl -d Ubuntu-22.04
shuoshawn@DESKTOP-IM3L3RM:/mnt/c/WINDOWS/system32$

3. 安装开发环境(安装Hermes的必须条件)

sudo apt update
sudo apt install -y git curl build-essential

之前提到,安装Hermes还需要Node.js,Git等依赖,这条命令可以一键安装所有的依赖包。

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

参考:

在这里插入图片描述

验证:

shuoshawn@DESKTOP-IM3L3RM:/mnt/c/WINDOWS/system32$ node -v
v22.22.3
shuoshawn@DESKTOP-IM3L3RM:/mnt/c/WINDOWS/system32$ npm -v
10.9.8

记得关注一下有哪些安装包报错,有的报错会在Shell面板重新安装,有的则需要手动安装。

sudo apt install -y <安装失败的工具名>
#example
sudo apt install -y ripgrep

4. 配置Hermes

4.1 选择Quick setup

刚搭建,不需要调优,先运行成功再去更换新的模型或调用其他的API。后期可以在wsl中运行 hermes config,修改provider, model, endpoint 或自定义 API。

在这里插入图片描述

4.2 选择provider,服务提供商

按照提示信息,选择需要的模型,没有显示的话,点击 custom (direct API)。如果是自己搭建的内部训练模型,或者是自定义的API(不兼容OpenAI),自己写了后端,选择 Custom endpoint (enter URL manually)
在这里插入图片描述

4.3 选择 custom (direct API)

以DeepSeek为例。

API base URL [e.g. https://api.example.com/v1]: https://api.deepseek.com
API key [optional]: sk-xxxxxxxxxxxxxxxxx						#你的API Key,这是临时方案,旨在先成功调用API,当前配置填写在config.yaml中,从安全性角度讲,这个文件中的内容仅写非私密变量。
Select API compatibility mode:
  1. Auto-detect [current]
     Use Hermes URL heuristics; best for standard OpenAI-compatible endpoints.
  2. Chat Completions
     Use /chat/completions for standard OpenAI-compatible servers.
  3. Responses / Codex
     Use /responses for Codex-compatible tool-calling backends.
  4. Anthropic Messages
     Use /v1/messages for Anthropic-compatible endpoints.
Choice [1-4, Enter to keep current/detected]: 1					#选择1,自动调用API模式
  API mode: auto-detect
Model name (e.g. gpt-4, llama-3-70b): deepseek-v4-flash			#定义模型名称
Context length in tokens [leave blank for auto-detect]:			#让模型自动识别上下文长度
Display name [Api.deepseek.com]: deepseekv4flash				#定义配置文件名称
Default model set to: deepseek-chat (via https://api.deepseek.com)
  💾 Saved to custom providers as "deepseek-chat" (edit in config.yaml)

选择Local,Keep Current。

在这里插入图片描述

Skip,跳过聊天工具的确认,暂时没必要,后面会单独列出教程。

在这里插入图片描述
在这里插入图片描述

运行 source ~/.bashrc,否则调用hermes会出现 hermes: command not found

shuoshawn@DESKTOP-IM3L3RM:/mnt/c/WINDOWS/system32$ source ~/.bashrc
shuoshawn@DESKTOP-IM3L3RM:/mnt/c/WINDOWS/system32$ hermes

在这里插入图片描述

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐