国内服务器安装hermes速度慢解决办法
慢是正常的,国内挂机宝装 Hermes 基本就是”五层墙”叠加:
慢的原因
1. 所有依赖都走国外源,没一个用国内镜像
Hermes 安装脚本要下载:uv(Astral 官方)、Python 3.11(python.org)、Node.js 22(nodejs.org)、PortableGit(GitHub release)、ripgrep、ffmpeg——全从欧美服务器拉,国内直连每秒几十 KB 是常态,超时更是家常便饭。
2. pip/uv 全走 PyPI 默认源
uv pip install .[all] 从 pypi.org 拉几百个包,单个包几 KB 到几十 MB,PyPI 国内直连也慢。
3. npm 赠送一坨慢
agent-browser、playwright + chromium 浏览器,npmjs.org + Playwright CDN 都是海外。
4. git clone GitHub
从 NousResearch/hermes-agent 仓库拉代码,GitHub 国内限速/超时。
我扒了 install.sh 的完整逻辑,6 个下载源全是硬编码国外,脚本里没有任何国内镜像选项:
| 依赖 | 下载源 | 大约大小 | 国内直连状态 |
|---|---|---|---|
| uv | astral.sh | ~20MB | 慢 |
| Python 3.11 | GitHub astral-sh/python-build-standalone | ~50MB | 慢 |
| Node.js 22 | nodejs.org/dist/ | ~30MB | 慢 |
| PyPI 依赖 | pypi.org/simple/ | 几百MB累计 | 极慢 |
| npm 依赖 + Playwright | npmjs.org + playwright.azureedge.net | ~150MB(Chromium) | 极慢 |
| git clone | github.com/NousResearch/hermes-agent | ~20MB | 慢/超时 |
但好消息是,你可以用环境变量绕过大部分慢点。实操步骤:
解决办法 组合命令(一键复制)
=== Hermes Agent 国内挂机宝加速安装 ===
预装 uv
mkdir -p ~/.hermes/bin
curl -L https://ghfast.top/https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-linux.tar.gz | tar xz -C ~/.hermes/bin
预装 Node.js 22
mkdir -p ~/.hermes/node
curl -L https://npmmirror.com/mirrors/node/latest-v22.x/node-v22.22.2-linux-x64.tar.xz | tar xJ -C ~/.hermes/node –strip-components=1
预 clone 仓库
git clone –depth 1 https://ghfast.top/https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent
设国内源环境变量
export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
export npm_config_registry=https://registry.npmmirror.com
export PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright
跑安装脚本
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
这样原本几小时 + 大概率超时的安装过程,应该 15-20 分钟就能跑完。