首页
看点啥
插画图片
首页 看点啥 Hermes Agent Windows 完整安装与本地模型配置操作步骤(实战版)

Hermes Agent Windows 完整安装与本地模型配置操作步骤(实战版)

2026-07-31 0

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 用户请绕道,你们一条命令就完事了。(实际上就是看各个平台吹了好几天了,拔个草。。。)

目录

  1. 系统要求
  2. 整体流程概览
  3. Step 1:安装 WSL2 并迁移到非 C 盘
  4. Step 2:在 WSL2 中安装 Hermes Agent
  5. Step 3:安装 Ollama(Windows 端)
  6. Step 4:打通 WSL2 到 Windows Ollama 的网络
  7. Step 5:配置 Hermes 连接本地模型
  8. Step 6:修复上下文窗口限制(必做)
  9. Step 7:启动并使用
  10. 常用命令速查
  11. 常见问题 FAQ(实战踩坑)
  12. 模型推荐选型

1. 系统要求

项目最低要求推荐配置
操作系统Windows 10 64位(2004+)Windows 11
WSL2必须
内存8 GB RAM16 GB RAM+
显卡显存(GPU推理)8 GB VRAM(7B模型)16 GB+ VRAM
磁盘空间20 GB 可用50 GB+
网络安装时需联网

2. 整体流程概览

flowchart TDA["Windows 环境"] --> B["安装 WSL2n迁移到非 C 盘"]B --> C["WSL2 内安装 Hermes Agentncurl 一键脚本"]C --> D["Windows 端安装 Ollaman下载目标模型"]D --> E["打通 WSL2 到 Windows 网络nOLLAMA_HOST + 防火墙"]E --> F["配置 Hermesn指向本地 Ollama"]F --> G["修复上下文窗口n32K 覆盖为 65K"]G --> H["hermes chatn开始使用"]style A fill:#1a1a2e,color:#fffstyle E fill:#c62828,color:#fffstyle G fill:#c62828,color:#fffstyle 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:WSLUbuntu" -Force# 导出备份wsl --export Ubuntu G:WSLubuntu-backup.tar# 注销原来的wsl --unregister Ubuntu# 重新导入到 G 盘wsl --import Ubuntu G:WSLUbuntu G:WSLubuntu-backup.tar --version 2

wsl --unregister Ubuntu# 下载 Ubuntu rootfsInvoke-WebRequest -Uri "https://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz" -OutFile "G:WSLubuntu.tar.gz"# 导入wsl --import Ubuntu G:WSLUbuntu G:WSLubuntu.tar.gz --version 2

3.3 修复默认用户

导入后默认是 root,需要创建普通用户:

# 进入 WSLwsl -d Ubuntu# 创建用户(替换 alben 为你的用户名)useradd -m -s /bin/bash albenpasswd albenusermod -aG sudo alben# 设置默认用户echo -e '[user]ndefault=alben' > /etc/wsl.confexit

回到 PowerShell 重启 WSL:

wsl --terminate Ubuntuwsl -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-agentgit clone --depth=1 https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent

4.4 安装 Python 依赖

cd ~/.hermes/hermes-agentexport PATH="$HOME/.local/bin:$PATH"uv venv venv --python 3.11export 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/hermesecho'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrcsource ~/.bashrchermes version# 输出 v0.8.0 就对了

5. Step 3:安装 Ollama(Windows 端)

  1. 访问 ollama.com
  2. 下载 Windows 版安装
  3. 安装后系统托盘有 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 utf8ollama create qwen3.5-35b-32k -f "Modelfile"

6. Step 4:打通 WSL2 到 Windows Ollama 的网络

这是整个教程最恶心的一步。WSL2 跑在虚拟网络里,localhost 指的是 WSL 自己,不是 Windows。

graph LRA["WSL2 Ubuntun172.27.x.x"] -- "localhost 不通" --> B["Windows Ollaman127.0.0.1:11434"]A -- "宿主 IP 通" --> C["Windows Ollaman0.0.0.0:11434"]style A fill:#2d6a4f,color:#fffstyle B fill:#c62828,color:#fffstyle 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# 应该看到:# TCP0.0.0.0:114340.0.0.0:0LISTENING

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 宿主 IPHOST_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 URLhttp://172.27.112.1:11434/v1(用你实际的宿主 IP)
API key留空(Ollama 不需要)
Model nameqwen3.5-35b-32k:latest
Context length32768

或者直接改配置文件:

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 ───────────────────────────────────────────────────────────────────────────────╮│Available 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...) ││⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣤⡈⠁⢤⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀││⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠷⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀Available 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 Researchgaming: minecraft-modpack-server, pokemon-player││ /home/alben/.hermes/hermes-agent general: dogfood││ Session: 20260416_001157_xxxxxgithub: 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..." && date0.5s╭─ ⚕ Hermes ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮终端功能正常运作!当前是 2026 年 4 月 16 日星期四,协调世界时(CST)00:48:30。我还可以测试其他功能,比如:- 读写文件- 执行 Python 代码- 浏览网页- 搜索文件- 使用各种技能工具请告诉我您想测试什么功能,或者有什么任务需要帮助!╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ⚕ qwen3.5-35b-32k:latest │ 16.7K/65.5K │ [███░░░░░░░] 26% │ 5m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────❯ ──────────────────────────────────────────────────────────────────────────

10. 常用命令速查

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 524288000rm -rf ~/.hermes/hermes-agentgit clone --depth=1 https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent

多试几次,总会通的。

Q2:WSL 里 curl Ollama 连接超时

报错:Connection timed out

原因:Windows 防火墙有 ollama.exe 的 Block 规则。

解决:

# 管理员 PowerShellGet-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/hermesexport 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 UbuntuInvoke-WebRequest -Uri "https://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz" -OutFile "G:WSLubuntu.tar.gz"wsl --import Ubuntu G:WSLUbuntu G:WSLubuntu.tar.gz --version 2

12. 模型推荐选型

模型显存需求中文代码推理拉取命令
qwen2.5:7b6 GB三星两星两星ollama pull qwen2.5:7b
qwen3:32b20 GB四星三星四星ollama pull qwen3:32b
deepseek-r1:32b20 GB三星三星五星ollama pull deepseek-r1:32b
qwen3.5:35b24 GB五星四星四星ollama pull qwen3.5:35b
qwen3-coder:30b20 GB三星五星三星ollama pull qwen3-coder:30b

总结

完成以上步骤后,你拥有了:

  1. 完全本地的 AI Agent,数据不出本机
  2. 完全免费,无需任何 API 费用
  3. 断网可用,不依赖任何外部服务
  4. 74 个技能,28 个工具,能执行代码、操作文件、浏览网页
  5. 可扩展,支持 Skills 技能插件生态

graph LRA["Hermes Agentn本地 AI 助手"] --> B["文件管理"]A --> C["代码执行"]A --> D["浏览器控制"]A --> E["任务委派"]A --> F["代码生成"]A --> G["文件搜索"]style A fill:#4a0e8f,color:#fff

说白了这玩意就是个终端里的 AI 打工人,你说话它干活。至于干得好不好,取决于你喂它什么模型。好了就这样,有空再写怎么实际用它干活。

喜欢(0)

上一篇

2026年我犯的最蠢的技术决策:为了追AI热点,把稳定系统改崩了

2026年我犯的最蠢的技术决策:为了追AI热点,把稳定系统改崩了

下一篇

Claude Code Router 接入过程的爬坑记录

Claude Code Router 接入过程的爬坑记录
猜你喜欢