1 安装 Hermes
Linux、macOS 或 WSL2 可使用安装脚本。
- 安装
bash
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash- 运行并配置
Setup
bash
hermes setup| 配置项 | 建议 / 值 |
|---|---|
Setup mode | 选择 Quick Setup |
Provider | 选择 Custom endpoint / OpenAI-compatible |
Base URL | https://maas-api.cn-huabei-1.xf-yun.com/v2 |
APIKEY | 填写 APIKEY |
Model ID | spark-x2.5 |
Context length | 按实际授权的上下文长度填写 |
- 环境变量方式
Linux / macOS
bash
export OPENAI_BASE_URL="https://maas-api.cn-huabei-1.xf-yun.com/v2"
export OPENAI_API_KEY="<你的 APIKEY>"- config.yaml 示例
YAML
yaml
model:
default: spark-x2.5
provider: custom
base_url: https://maas-api.cn-huabei-1.xf-yun.com/v2APIKEY 建议通过 Hermes 的凭证流程保存,避免将明文密钥写入共享配置文件。
- 开始使用
聊天
bash
hermes chat切换模型
text
/model custom:spark-x2.5