国内环境部署 Hermes Agent 的一些经验
最近在内网服务器上部署 Hermes Agent,踩了几个典型的国内网络问题,简单记录一下。
1. npm 使用国内源
先切换 npm 源,否则部分 Node 依赖会很慢:
npm config set registry https://registry.npmmirror.com2. uv 配置清华源
Hermes 使用 uv 管理 Python 依赖,建议先配置 uv 源:
mkdir -p ~/.config/uv
cat > ~/.config/uv/uv.toml <<'EOF'
default-index = "https://pypi.tuna.tsinghua.edu.cn/simple"
EOF有些安装脚本可能不会正确读取 uv.toml,可以再加环境变量兜底:
export UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple"需要长期生效可以写入:
echo 'export UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple"' >> ~/.bashrc
source ~/.bashrc3. 先下载脚本并修改仓库地址
国内直接执行远程安装脚本时,可能会卡在 GitHub clone 阶段。建议先把安装脚本下载到本地,确认内容后再改 repo 地址:
curl -fsSL https://raw.githubusercontent.com/nousresearch/hermes-agent/main/install.sh -o install-hermes.sh然后编辑脚本:
nano install-hermes.sh把里面类似:
https://github.com/nousresearch/hermes-agent.git替换成:
https://gh-proxy.org/https://github.com/nousresearch/hermes-agent.git再执行:
bash install-hermes.sh这类代理适合公开仓库,不建议用于私有仓库或带 token 的地址。
4. Playwright 浏览器下载加速
Hermes 可能会自动下载 Chromium,默认 CDN 很慢:
export PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright如果需要长期生效,也可以写入 ~/.bashrc。
5. DuckDuckGo 问题
Hermes 默认部分功能会访问 DuckDuckGo,国内经常无法访问。建议:
- 配置代理;
- 或关闭 web search;
- 或改用其他搜索 API。
整体来看,国内部署 Hermes 主要问题集中在:
GitHub + PyPI + Playwright CDN + DuckDuckGo把这些源和代理处理好后,部署体验会顺畅很多。