Hermes Agent Windows安装本地模型配置实战教程
Hermes Agent Windows 完整安装与本地模型配置教程(实战版)
作者:吴佳浩
撰稿时间:2026-4-15
测试模型:Qwen3.5-35B-32K(Ollama 量化版,图省事,大家可以根据自己情况选)
测试环境:RTX 5090 + 96GB 内存 + Windows 11
先说几句
圈子里最近突然热起来的一个项目,号称开源版 Claude Code,能和 openclaw 掰手腕,Nous Research 出品。做这行的不折腾一下总觉得少了点什么。但说真的,它对 Windows 用户实在不怎么友好——官方文档写得很清楚:原生 Windows 不支持,必须走 WSL2。这篇东西就是一边装一边踩坑一边记下来的,全程实战,能帮读者少走一个算一个。Mac 用户的话,一条命令就能搞定,这边就不展开了。(说到底,各个平台吹了好几天了,这次来拔拔草。)
目录
- 系统要求
- 整体流程概览
- Step 1:安装 WSL2 并迁移到非 C 盘
- Step 2:在 WSL2 中安装 Hermes Agent
- Step 3:安装 Ollama(Windows 端)
- Step 4:打通 WSL2 到 Windows Ollama 的网络
- Step 5:配置 Hermes 连接本地模型
- Step 6:修复上下文窗口限制(必做)
- Step 7:启动并使用
- 常用命令速查
- 常见问题 FAQ(实战踩坑)
- 模型推荐选型
1. 系统要求
| 项目 | 最低要求 | 推荐配置 |
|---|---|---|
| 操作系统 | Windows 10 64位(2004+) | Windows 11 |
| WSL2 | 必须 | — |
| 内存 | 8 GB RAM | 16 GB RAM+ |
| 显卡显存(GPU推理) | 8 GB VRAM(7B模型) | 16 GB+ VRAM |
| 磁盘空间 | 20 GB 可用 | 50 GB+ |
| 网络 | 安装时需联网 | — |
2. 整体流程概览
flowchart TD
A["Windows 环境"] --> B["安装 WSL2\n迁移到非 C 盘"]
B --> C["WSL2 内安装 Hermes Agent\ncurl 一键脚本"]
C --> D["Windows 端安装 Ollama\n下载目标模型"]
D --> E["打通 WSL2 到 Windows 网络\nOLLAMA_HOST + 防火墙"]
E --> F["配置 Hermes\n指向本地 Ollama"]
F --> G["修复上下文窗口\n32K 覆盖为 65K"]
G --> H["hermes chat\n开始使用"]
style A fill:#1a1a2e,color:#fff
style E fill:#c62828,color:#fff
style G fill:#c62828,color:#fff
style H fill:#00aa55,color:#fff
3. Step 1:安装 WSL2 并迁移到非 C 盘
3.1 安装 WSL2
管理员 PowerShell 执行:
wsl --install
默认安装 Ubuntu,重启后按提示设置用户名和密码。
3.2 迁移到非 C 盘(可选但建议)
WSL2 默认把虚拟磁盘放在 C 盘的 AppData 下,模型一拉一大堆,C 盘会爆。迁移到其他盘:
# 确认当前状态
wsl --list --verbose
# 创建目标目录(这里用 G 盘举例)
New-Item -ItemType Directory -Path "G:\WSL\Ubuntu" -Force
# 导出备份
wsl --export Ubuntu G:\WSL\ubuntu-backup.tar
# 注销原来的
wsl --unregister Ubuntu
# 重新导入到 G 盘
wsl --import Ubuntu G:\WSL\Ubuntu G:\WSL\ubuntu-backup.tar --version 2
wsl --unregister Ubuntu
# 下载 Ubuntu rootfs
Invoke-WebRequest -Uri "https://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz" -OutFile "G:\WSL\ubuntu.tar.gz"
# 导入
wsl --import Ubuntu G:\WSL\Ubuntu G:\WSL\ubuntu.tar.gz --version 2
3.3 修复默认用户
导入后默认是 root,需要创建普通用户:
# 进入 WSL
wsl -d Ubuntu
# 创建用户(替换 alben 为你的用户名)
useradd -m -s /bin/bash alben
passwd alben
usermod -aG sudo alben
# 设置默认用户
echo -e '[user]\ndefault=alben' > /etc/wsl.conf
exit
回到 PowerShell 重启 WSL:
wsl --terminate Ubuntu
wsl -d Ubuntu
# 这次应该以普通用户登录了
4. Step 2:在 WSL2 中安装 Hermes Agent
4.1 更新系统依赖
sudo apt update && sudo apt install -y ripgrep ffmpeg
4.2 配置 Git(防止克隆失败)
git config --global http.postBuffer 524288000
4.3 运行安装脚本
cd ~
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
如果脚本克隆 GitHub 失败,手动来:
rm -rf ~/.hermes/hermes-agent
git clone --depth=1 https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent
4.4 安装 Python 依赖
cd ~/.hermes/hermes-agent
export PATH="$HOME/.local/bin:$PATH"
uv venv venv --python 3.11
export VIRTUAL_ENV="$(pwd)/venv"
UV_HTTP_TIMEOUT=300 uv pip install -e ".[messaging,cron,cli,mcp,pty]"
4.5 创建全局命令链接
ln -sf ~/.hermes/hermes-agent/hermes ~/.local/bin/hermes
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
hermes version
# 输出 v0.8.0 就对了
5. Step 3:安装 Ollama(Windows 端)
- 访问 ollama.com
- 下载 Windows 版安装
- 安装后系统托盘有 Ollama 图标
下载模型
# 按显存选择
ollama pull qwen3.5:35b # 24GB+ 显存
ollama pull qwen3:32b # 20GB+ 显存
ollama pull deepseek-r1:32b # 20GB+ 显存
ollama pull qwen2.5:7b # 6GB+ 显存(入门)
# 查看已下载
ollama list
创建扩展上下文版本
# Ollama 默认上下文太小,需要扩展
"FROM qwen3.5:35b\nPARAMETER num_ctx 32768" | Out-File -FilePath "Modelfile" -Encoding utf8
ollama create qwen3.5-35b-32k -f "Modelfile"
6. Step 4:打通 WSL2 到 Windows Ollama 的网络
这是整个教程最恶心的一步。WSL2 跑在虚拟网络里,localhost 指的是 WSL 自己,不是 Windows。
graph LR
A["WSL2 Ubuntu\n172.27.x.x"] -- "localhost 不通" --> B["Windows Ollama\n127.0.0.1:11434"]
A -- "宿主 IP 通" --> C["Windows Ollama\n0.0.0.0:11434"]
style A fill:#2d6a4f,color:#fff
style B fill:#c62828,color:#fff
style C fill:#00aa55,color:#fff
6.1 让 Ollama 监听所有网卡
PowerShell 执行:
[System.Environment]::SetEnvironmentVariable("OLLAMA_HOST", "0.0.0.0", "User")
然后彻底重启 Ollama(托盘右键 Quit 再重新打开)。
验证:
netstat -an | findstr 11434
# 应该看到:
# TCP 0.0.0.0:11434 0.0.0.0:0 LISTENING
6.2 添加防火墙规则
管理员 PowerShell:
New-NetFirewallRule -DisplayName "Ollama WSL" -Direction Inbound -Protocol TCP -LocalPort 11434 -Action Allow
6.3 检查并删除 Block 规则(关键!)
Get-NetFirewallRule -DisplayName "*Ollama*" | Format-Table DisplayName, Enabled, Direction, Action
Get-NetFirewallRule -DisplayName "ollama.exe" | Where-Object {$_.Action -eq "Block"} | Remove-NetFirewallRule
6.4 从 WSL 测试连接
# 获取 Windows 宿主 IP
HOST_IP=$(ip route | grep default | awk '{print $3}')
echo $HOST_IP
# 测试
curl http://$HOST_IP:11434/api/tags
# 能看到模型列表就通了
7. Step 5:配置 Hermes 连接本地模型
hermes model
选择 More providers... 然后选 Custom endpoint (enter URL manually)
| 提示 | 填什么 |
|---|---|
| API base URL | http://172.27.112.1:11434/v1(用你实际的宿主 IP) |
| API key | 留空(Ollama 不需要) |
| Model name | qwen3.5-35b-32k:latest |
| Context length | 32768 |
或者直接改配置文件:
HOST_IP=$(ip route | grep default | awk '{print $3}')
sed -i "s|http://[^/]*:11434|http://$HOST_IP:11434|g" ~/.hermes/config.yaml
8. Step 6:修复上下文窗口限制(必做)
解决方案——直接覆盖配置:
sed -i 's/context_length: 32768/context_length: 65536/' ~/.hermes/config.yaml
验证:
grep context_length ~/.hermes/config.yaml
# 输出 context_length: 65536
9. Step 7:启动并使用
hermes chat
看到这个界面就成功了:
██╗██╗███████╗██████╗ ███╗ ███╗███████╗███████╗ █████╗ ██████╗ ███████╗███╗ ██╗████████╗
██║██║██╔════╝██╔══██╗████╗ ████║██╔════╝██╔════╝ ██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝
███████║█████╗ ██████╔╝██╔████╔██║█████╗ ███████╗ ███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║
██╔══██║██╔══╝ ██╔══██╗██║╚██╔╝██║██╔══╝ ╚════██║ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║
██║ ██║███████╗██║ ██║██║ ╚═╝ ██║███████╗███████║ ██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝
╭─────────────────────────────────────────────────────────────────────────────── Hermes Agent v0.8.0 (2026.4.8) · upstream b909a9ef ───────────────────────────────────────────────────────────────────────────────╮
│A vailable Tools │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⡀⠀⣀⣀⠀⢀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀browser: browser_back, browser_click, ... │
│⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣇⠸⣿⣿⠇⣸⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀clarify: clarify │
│⠀⢀⣠⣴⣶⠿⠋⣩⡿⣿⡿⠻⣿⡇⢠⡄⢸⣿⠟⢿⣿⢿⣍⠙⠿⣶⣦⣄⡀⠀code_execution: execute_code │
│⠀⠀⠉⠉⠁⠶⠟⠋⠀⠉⠀⢀⣈⣁⡈⢁⣈⣁⡀⠀⠉⠀⠙⠻⠶⠈⠉⠉⠀⠀cronjob: cronjob │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⡿⠛⢁⡈⠛⢿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀delegation: delegate_task │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠿⣿⣦⣤⣈⠁⢠⣴⣿⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀file: patch, read_file, search_files, write_file │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠻⢿⣿⣦⡉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀homeassistant: ha_call_service, ha_get_state, ... │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢷⣦⣈⠛⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀image_gen: image_generate │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣴⠦⠈⠙⠿⣦⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(and 11 more toolsets...) │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣤⡈⠁⢤⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠷⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀A vailable Skills │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠑⢶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀autonomous-ai-agents: claude-code, codex, hermes-agent, opencode│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠁⢰⡆⠈⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀creative: ascii-art, ascii-video, excalidraw, ideation, m...│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⠈⣡⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀data-science: jupyter-live-kernel │
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀devops: webhook-subscriptions │
│ email: himalaya │
│qwen3.5-35b-32k:latest · Nous Research gaming: minecraft-modpack-server, pokemon-player │
│ /home/alben/.hermes/hermes-agent general: dogfood │
│ Session: 20260416_001157_xxxxx github: codebase-inspection, github-auth, github-code-r...│
│ leisure: find-nearby │
│ mcp: mcporter, native-mcp │
│ media: gif-search, heartmula, songsee, youtube-content │
│ mlops: audiocraft-audio-generation, axolotl, clip, dsp... │
│ note-taking: obsidian │
│ productivity: google-workspace, linear, nano-pdf, notion, ocr...│
│ red-teaming: godmode │
│ research: arxiv, blogwatcher, llm-wiki, polymarket, resea...│
│ smart-home: openhue │
│ social-media: xitter │
│ software-development: plan, requesting-code-review, subagent-driven-d...│
│ │
│ 28 tools · 74 skills · /help for commands │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Welcome to Hermes Agent! Type your message or /help for commands.
✦ Tip: Browser pages over 8000 tokens are auto-summarized by the auxiliary LLM before returning to the agent.
在提示符后直接打字就行。
常用交互
hermes chat # 交互式对话
hermes "帮我写一个Python爬虫" # 单次任务
hermes doctor # 健康检查
hermes model # 切换模型
hermes model qwen3:32b # 直接指定模型
状态栏说明
qwen3.5-35b-32k:latest | 16.7K/65.5K | [###.......] 26% | 5m
| 部分 | 含义 |
|---|---|
qwen3.5-35b-32k:latest | 当前模型 |
16.7K/65.5K | 已用 / 总上下文 tokens |
26% | 上下文使用率 |
5m | 会话持续时间 |
好了,自己动手测试一下吧:
╭─ ⚕ Hermes ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
系统测试成功!Hermes Agent 正在运行。让我执行一个简单的命令来验证终端功能:
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
┊ ? preparing terminal…
┊ ? $ echo "Testing terminal access..." && date
0.5s
╭─ ⚕ Hermes ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
终端功能正常运作!当前是 2026 年 4 月 16 日星期四,协调世界时(CST)00:48:30。
我还可以测试其他功能,比如:
- 读写文件
- 执行 Python 代码
- 浏览网页
- 搜索文件
- 使用各种技能工具
请告诉我您想测试什么功能,或者有什么任务需要帮助!
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
⚕ qwen3.5-35b-32k:latest │ 16.7K/65.5K │ [███░░░░░░░] 26% │ 5m
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ ──────────────────────────────────────────────────────────────────────────
10. 常用命令速查
| 命令 | 说明 |
|---|---|
hermes chat | 交互式对话 |
hermes "任务描述" | 单次任务执行 |
hermes doctor | 健康检查 |
hermes model | 交互式选择模型 |
hermes model <模型名> | 直接指定模型 |
hermes --help | 查看更多命令 |
11. 常见问题 FAQ(实战踩坑)
Q1:安装脚本克隆 GitHub 失败
报错:GnuTLS recv error (-110) 或 HTTP/2 stream was not closed cleanly
原因:WSL2 网络不稳定 + 袋里干扰。
解决:
git config --global http.proxy ""
git config --global https.proxy ""
git config --global http.postBuffer 524288000
rm -rf ~/.hermes/hermes-agent
git clone --depth=1 https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent
多试几次,总会通的。
Q2:WSL 里 curl Ollama 连接超时
报错:Connection timed out
原因:Windows 防火墙有 ollama.exe 的 Block 规则。
解决:
# 管理员 PowerShell
Get-NetFirewallRule -DisplayName "ollama.exe" | Where-Object {$_.Action -eq "Block"} | Remove-NetFirewallRule
Q3:WSL 里 curl Ollama 连接被拒
报错:Connection refused
原因:Ollama 没有监听 0.0.0.0。
解决:
[System.Environment]::SetEnvironmentVariable("OLLAMA_HOST", "0.0.0.0", "User")
# 然后彻底重启 Ollama
Q4:hermes 命令找不到
解决:
ln -sf ~/.hermes/hermes-agent/hermes ~/.local/bin/hermes
export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Q5:Python 依赖安装超时
报错:Failed to download ... Try increasing UV_HTTP_TIMEOUT
解决:
UV_HTTP_TIMEOUT=300 uv pip install -e ".[messaging,cron,cli,mcp,pty]"
Q6:上下文窗口太小被拒绝
报错:context window of 32,768 tokens, below the minimum 64,000
解决:
sed -i 's/context_length: 32768/context_length: 65536/' ~/.hermes/config.yaml
Q7:WSL 导出备份时 ext4.vhdx 找不到
报错:无法将磁盘附加到 WSL2: 系统找不到指定的文件
原因:虚拟磁盘损坏。
解决:直接注销重建,反正也没什么数据:
wsl --unregister Ubuntu
Invoke-WebRequest -Uri "https://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz" -OutFile "G:\WSL\ubuntu.tar.gz"
wsl --import Ubuntu G:\WSL\Ubuntu G:\WSL\ubuntu.tar.gz --version 2
12. 模型推荐选型
| 模型 | 显存需求 | 中文 | 代码 | 推理 | 拉取命令 |
|---|---|---|---|---|---|
| qwen2.5:7b | 6 GB | 三星 | 两星 | 两星 | ollama pull qwen2.5:7b |
| qwen3:32b | 20 GB | 四星 | 三星 | 四星 | ollama pull qwen3:32b |
| deepseek-r1:32b | 20 GB | 三星 | 三星 | 五星 | ollama pull deepseek-r1:32b |
| qwen3.5:35b | 24 GB | 五星 | 四星 | 四星 | ollama pull qwen3.5:35b |
| qwen3-coder:30b | 20 GB | 三星 | 五星 | 三星 | ollama pull qwen3-coder:30b |
总结
完成以上步骤后,你拥有了:
- 完全本地的 AI Agent,数据不出本机
- 完全免费,无需任何 API 费用
- 断网可用,不依赖任何外部服务
- 74 个技能,28 个工具,能执行代码、操作文件、浏览网页
- 可扩展,支持 Skills 技能插件生态
graph LR
A["Hermes Agent\n本地 AI 助手"] --> B["文件管理"]
A --> C["代码执行"]
A --> D["浏览器控制"]
A --> E["任务委派"]
A --> F["代码生成"]
A --> G["文件搜索"]
style A fill:#4a0e8f,color:#fff
说白了这玩意就是个终端里的 AI 打工人,你说话它干活。至于干得好不好,取决于你喂它什么模型。好了就这样,有空再写怎么实际用它干活。