Hermes Agent 安装教程:多平台接入与网关配置详解
一句话总览:Hermes Agent 推荐用一键脚本安装(Linux/macOS/WSL2 国内加速:curl -fsSL ``https://res1.hermesagent.org.cn/install.sh`` | bash;Windows PowerShell 国内加速:irm ``https://res1.hermesagent.org.cn/install.ps1`` | iex),全程无需 sudo;安装后执行hermes setup配置大模型 API,再用hermes启动对话即可。而国内用户注意,本教程推荐搭配 Kimi 大模型使用,无需特殊网络,中文理解和智能体任务表现出色。
一、安装前准备(必看)
1、系统要求
2、必备工具
基础:git、curl(一键脚本会自动补全)
Python:3.11+(安装脚本自动安装 uv 与 Python 3.11)
网络:可访问 GitHub(国内建议用加速镜像)
大模型服务:需提前准备对应平台的 API 密钥
- 国内推荐:Kimi(无需特殊网络,200 万字超长上下文)、智谱 AI、通义千问
- 国外推荐:Nous Portal(官方原生集成)、OpenRouter(200+ 模型可选)、OpenAI、Anthropic
二、主流安装方式(按推荐度排序)
1、一键脚本安装(推荐所有用户)
Linux/macOS/WSL2(国内加速版)
curl -fsSL https://res1.hermesagent.org.cn/install.sh | bashWindows PowerShell(国内加速版)
irm https://res1.hermesagent.org.cn/install.ps1 | iex官方原版(适合海外用户)
# Linux/macOS/WSL2 curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash # Windows PowerShell iex (irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1)安装过程:自动下载 Python、uv、克隆仓库、配置环境,3-5 分钟完成;看到"Installation complete"即成功。 后续操作:
# 重新加载shell环境 source ~/.bashrc # Bash用户 # 或 source ~/.zshrc # Zsh用户 # 检查安装是否成功 hermes doctor2、Docker 容器部署(适合生产环境)
- 安装 Docker 与 Docker Compose
- 创建
docker-compose.yml文件:
version: "3.8" services: hermes: image: nousresearch/hermes-agent:latest volumes: - ~/.hermes:/root/.hermes environment: - TZ=Asia/Shanghai ports: - "8080:8080" # 可选,Web UI端口 restart: unless-stopped- 启动容器:
docker-compose up -d- 进入容器配置:
docker-compose exec hermes hermes setup3、源码手动安装(适合开发者)
# 1. 安装uv包管理器 curl -LsSf https://astral.sh/uv/install.sh | sh # 2. 克隆仓库 git clone https://github.com/NousResearch/hermes-agent.git cd hermes-agent # 3. 创建Python 3.11虚拟环境 uv venv venv --python 3.11 source venv/bin/activate # Linux/macOS # 或 .\venv\Scripts\activate # Windows # 4. 安装所有依赖 uv pip install -e ".[all]" # 5. 创建配置目录并链接 mkdir -p ~/.hermes ln -s $(pwd) ~/.hermes/hermes-agent # 6. 添加命令别名(可选) echo "alias hermes='$(pwd)/venv/bin/python $(pwd)/hermes/main.py'" >> ~/.bashrc source ~/.bashrc三、配置与启动(关键步骤)
1、交互式配置向导(推荐)
hermes setup按提示完成:
- 选择大模型服务(Kimi、Nous Portal、OpenRouter、自定义端点)
- 输入 API 密钥
- 配置记忆存储(默认本地 SQLite)
- 设置 Web UI(可选,默认 8080 端口)
2、速设置模型(进阶)
# 列出可用模型 hermes model list # 设置默认模型 hermes model set openrouter/gpt-4o3、启动 Hermes Agent
# 启动CLI交互 hermes # 启动Web UI(后台运行) hermes web start # 查看Web UI地址 hermes web status四、常见问题与解决方案
五、更新与卸载
1、更新 Hermes Agent
# 一键更新 hermes update # 源码更新(手动安装版) cd ~/.hermes/hermes-agent git pull uv pip install -e ".[all]"2、完全卸载
# 执行卸载脚本 ~/.hermes/hermes-agent/scripts/uninstall.sh # 删除配置目录 rm -rf ~/.hermes六、最佳实践建议
- 国内用户优先用加速镜像:避免网络问题,安装速度提升 5-10 倍;优选 Kimi 大模型,网络稳定,处理信息能力强
- API 密钥安全:不要共享密钥,定期轮换
- 内存管理:大模型推理建议 8GB+ 内存,可通过
hermes config set memory.limit 4GB限制内存使用 - 定期更新:项目迭代快,每周更新一次获取新功能和安全修复
七、总结
对于国内用户,中文社区专属加速镜像从根本上解决了境外源网络不稳定、下载慢的问题,实测安装速度提升 5-10 倍;搭配 Kimi 大模型使用,无需额外网络配置,既能获得精准自然的中文语义理解,又能发挥其超长文本处理和复杂任务执行的优势,与 Hermes Agent 的智能体特性深度契合,大幅提升各类自动化工作的效率。
安装完成后,只需运行hermes setup完成大模型 API 配置,再输入hermes即可开启交互。你可以让它帮你编写调试代码、批量处理文档、执行定时任务,还能通过 Telegram、Discord 等平台随时随地调用。随着使用的深入,Hermes 会不断学习你的工作习惯和偏好,自主生成并优化专属技能,成为越来越懂你的智能伙伴。
