前言
Hermes Agent 是由 Nous Research 开发的开源 AI 代理框架,支持多渠道接入(微信、Telegram、Discord 等),功能强大,配置灵活。
本文将详细介绍如何在 Linux 服务器上部署 Hermes Agent。
环境要求
- 操作系统:Linux(Ubuntu 22.04+/Debian 12+ 推荐)
- Python:3.10+
- Node.js:18+(某些插件需要)
- 内存:建议 2GB+
安装步骤
1. 安装依赖
# Ubuntu / Debian
apt update && apt install -y git curl python3 python3-pip python3-venv
# 安装 uv(Python 包管理器)
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc
2. 克隆仓库
git clone https://github.com/nousresearch/hermes-agent.git
cd hermes-agent
3. 安装 Python 依赖
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
4. 初始化配置
hermes setup
按照提示选择 LLM 提供商(如 DeepSeek、OpenAI、Anthropic 等),配置 API Key。
配置 LLM 提供商
编辑 ~/.hermes/config.yaml:
model:
default: deepseek-v4-flash
provider: deepseek
api_key: sk-你的key
Hermes 支持多种提供商:
| 提供商 | 模型示例 | 特点 |
|---|---|---|
| DeepSeek | deepseek-v4-flash | 性价比高 |
| OpenAI | gpt-4o | 性能强 |
| Anthropic | claude-sonnet-4 | 代码能力强 |
| OpenRouter | 聚合多模型 | 灵活切换 |
配置消息平台
微信
在 ~/.hermes/.env 中配置:
WEIXIN_TOKEN=你的token
微信接入需要 iLink 协议,具体对接方式可参考官方文档。
Telegram
TELEGRAM_BOT_TOKEN=你的bot_token
Discord
DISCORD_BOT_TOKEN=你的bot_token
启动服务
# 启动网关(消息平台接入)
hermes gateway start
# 启动 WebUI(桌面管理界面)
hermes webui start
WebUI 默认运行在 http://127.0.0.1:8787。
配置为系统服务(自启动)
# WebUI 服务
cat > /etc/systemd/system/hermes-webui.service << 'EOF'
[Unit]
Description=Hermes Web UI
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/usr/local/lib/hermes-webui
ExecStart=/path/to/hermes webui start
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now hermes-webui
常用命令
hermes gateway status # 查看网关状态
hermes gateway restart # 重启网关
hermes gateway logs # 查看日志
hermes insights --days 7 # 查看使用统计
hermes update # 更新 Hermes
hermes auth # 配置认证
总结
Hermes Agent 部署并不复杂,核心步骤就三步:
- 安装依赖和 Hermes
- 配置 LLM API Key
- 配置消息平台并启动
部署完成后,你就可以通过微信、Telegram 等方式随时随地与 AI 助手对话了。
“stay hungry, stay foolish.”