分享技术 · 探索极限 · Code is Art
Linux 发布 2026-05-14 2阅读 约 3分钟阅读

Hermes 安装代理配置

在国内网络环境下部署 Hermes Agent 的实战经验:npm 淘宝源、uv/PyPI 清华源、GitHub clone 代理加速、Playwright Chromium 下载优化、DuckDuckGo 替代方案。

国内环境部署 Hermes Agent 的一些经验

最近在内网服务器上部署 Hermes Agent,踩了几个典型的国内网络问题,简单记录一下。

1. npm 使用国内源

先切换 npm 源,否则部分 Node 依赖会很慢:

npm config set registry https://registry.npmmirror.com

2. 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 ~/.bashrc

3. 先下载脚本并修改仓库地址

国内直接执行远程安装脚本时,可能会卡在 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

把这些源和代理处理好后,部署体验会顺畅很多。

发表回复