Hermes
Hermes 是一个轻量级、高智能的 通用大模型 API 代理与并发控制网关。
它原生支持几乎所有主流协议(OpenAI, Google Gemini, Anthropic 以及本地模型如 Ollama/vLLM)的相互代理、格式转换与路由分发。开箱自带包含 30+ 全球模型厂商 的庞大字典。
通过多账号轮询与智能并发排队,它能彻底解决 API Key 限流、封禁或余额耗尽导致的业务中断问题。最新版本为纯 零配置 (Zero-Config) 驱动,内置 SQLite 数据库和 Web Admin Dashboard (管理面板)。
核心特性
- 客户端一键自动配置:破除商业 AI 客户端(如 Claude Code, Codex, Cursor)锁定官方 API 的限制,让你在闭源软件中自由使用第三方模型。强烈推荐搭配 DeepSeek!
- 全协议与厂商支持:内置 30+ 厂商字典,无需手动翻找 Base URL。
- 简单/专家双模式 UI:简单模式极速配置,专家模式解锁并发限制、计费告警、正则表达式硬编码路由等全量控制权。
- 双轨模型映射引擎:支持按语义智能映射跨协议请求,也支持 1对1 精确匹配。
- 多账号池与单并发物理隔离:基于物理账号排队请求,从物理层面实现单并发隔离,防封号利器。
- 五态熔断器与自动重试轮询:空闲/繁忙/冷却/观察/耗尽,网关内置重试环,处理上游 429/5xx 错误时自动轮询备用节点并进行指数退避。
- 0 依赖部署:单文件可执行,内置 Web UI 与数据库迁移,开箱即用。
协议与路由矩阵
| 源协议 (客户端) | 目标协议 (上游) | 说明 |
|---|---|---|
| openai | openai | 透传 + 轮询 (兼容所有 OpenAI 格式的 API) |
| openai | anthropic | OpenAI 格式 → Anthropic 格式转换 |
| openai | OpenAI 格式 → Google Gemini 格式转换 | |
| anthropic | anthropic | 透传 + 轮询 |
| anthropic | openai | Anthropic 格式 → OpenAI 格式转换 |
| 透传 + 轮询 | ||
| local | local | 本地模型无鉴权透传 (Ollama/vLLM) |
快速安装
所有配置、计费记录和 SQLite 数据库 (polarisagi_hermes.db) 将安全保存在:~/.polarisagi/hermes/。
macOS / Linux
默认安装:
curl -sSL https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/install.sh | bash
中国地区 (代理加速):
curl -sSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/install.sh | bash
Windows (PowerShell as Admin)
默认安装:
iwr -useb https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/install.ps1 | iex
中国地区 (代理加速):
iwr -useb https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/install.ps1 | iex
网关将作为后台服务运行并开机自启。
一键卸载
macOS / Linux
默认卸载:
curl -sSL https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/uninstall.sh | bash
中国地区 (代理加速):
curl -sSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/uninstall.sh | bash
Windows (PowerShell as Admin)
默认卸载:
iwr -useb https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/uninstall.ps1 | iex
中国地区 (代理加速):
iwr -useb https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/hermes/main/scripts/uninstall.ps1 | iex
快速上手
默认情况下,网关监听在 127.0.0.1:27777。
- 管理面板: 访问 http://127.0.0.1:27777/dashboard
- 添加渠道: 选择协议 → 选择厂商 → 填入 API Key → 保存。
- 一键客户端配置: 导航到 "Client Config",选择目标软件,选择要注入的 API Key 即可完成。
- API 端点 (Endpoints) (在各类 AI 工具中填入以下 URL 即可,API Key 任意填写):
- OpenAI 协议:
http://127.0.0.1:27777/v1/openai/ - Anthropic 协议:
http://127.0.0.1:27777/v1/anthropic/ - Google 协议:
http://127.0.0.1:27777/v1/google/
- OpenAI 协议: