Skip to content

llmapi-pro/hermes-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hermes-setup

One-shot config script that wires llmapi — a Claude-compatible relay — into Hermes Agent as a custom_providers backend.

Languages: English · 中文


English

What it does

  • Appends a custom_providers entry named llmapi to ~/.hermes/config.yaml, with api_mode: anthropic_messages so Hermes speaks the Claude Messages protocol upstream.
  • Writes LLMAPI_KEY=... into ~/.hermes/.env (idempotent — replaces an existing line, never duplicates).
  • Belt-and-suspenders: explicitly sets api_mode after the named-custom switch (runs hermes config set model.api_mode anthropic_messages if the CLI is on PATH). No-op on Hermes ≥ v0.5; safety net for older versions.
  • Backs up your existing config.yaml and .env before touching them.

Quick start

# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/llmapi-pro/hermes-setup/main/setup.sh | bash

# or, recommended: download and review first
curl -fsSL https://raw.githubusercontent.com/llmapi-pro/hermes-setup/main/setup.sh -o setup.sh
less setup.sh
bash setup.sh
# Windows PowerShell
iwr -useb https://raw.githubusercontent.com/llmapi-pro/hermes-setup/main/setup.ps1 | iex

# or, recommended: download and review first
iwr -useb https://raw.githubusercontent.com/llmapi-pro/hermes-setup/main/setup.ps1 -OutFile setup.ps1
notepad setup.ps1
.\setup.ps1

You can pass the API key via the LLMAPI_KEY environment variable; otherwise the script will prompt for it.

LLMAPI_KEY=sk-cp-XXXXXXXXXX bash setup.sh

Manual config (3 steps)

If you prefer not to run the script, do this by hand:

  1. Append to ~/.hermes/config.yaml:

    custom_providers:
      - name: llmapi
        base_url: https://llmapi.pro
        api_key_env: LLMAPI_KEY
        api_mode: anthropic_messages
  2. Add your key to ~/.hermes/.env:

    LLMAPI_KEY=sk-cp-XXXXXXXXXX
  3. Belt-and-suspenders api_mode set (no-op on Hermes ≥ v0.5; safety net for older versions):

    hermes config set model.api_mode anthropic_messages

Then in Hermes:

/model custom:llmapi:claude-sonnet-4-6

Why the extra api_mode set?

Belt-and-suspenders: after the named-custom switch we explicitly pin model.api_mode to anthropic_messages. On Hermes ≥ v0.5 the named-custom switch already sets the right mode, so this is a no-op. On older Hermes versions it is a safety net that ensures the active provider talks Claude Messages. Remove that line if you ever switch back to a non-Claude-compatible provider.

Requirements

  • Hermes Agent installed and run at least once (so ~/.hermes/config.yaml exists).
  • bash (Linux/macOS) or PowerShell 5.1+ (Windows).
  • An llmapi API key.

License

MIT


中文

一键把 llmapi(Claude-compatible relay)配成 Hermes Agentcustom_providers 后端。

脚本做什么

  • ~/.hermes/config.yaml 追加一条名为 llmapicustom_providers 条目,api_mode: anthropic_messages(让 Hermes 用 Claude Messages 协议和上游通信)。
  • LLMAPI_KEY=... 写进 ~/.hermes/.env(幂等,已存在则替换,不重复追加)。
  • 保险设置:命名 custom provider 切换后显式设一次 api_mode(如果 hermesPATH 里,脚本会执行 hermes config set model.api_mode anthropic_messages)。Hermes ≥ v0.5 是 no-op;老版本作为安全兜底。
  • 改动前自动备份 config.yaml.env

快速开始

# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/llmapi-pro/hermes-setup/main/setup.sh | bash
# Windows PowerShell
iwr -useb https://raw.githubusercontent.com/llmapi-pro/hermes-setup/main/setup.ps1 | iex

也可以先下载、审计、再跑。

key 走环境变量,没有就交互输入:

LLMAPI_KEY=sk-cp-XXXXXXXXXX bash setup.sh

手工配置(3 步)

  1. ~/.hermes/config.yaml 追加:

    custom_providers:
      - name: llmapi
        base_url: https://llmapi.pro
        api_key_env: LLMAPI_KEY
        api_mode: anthropic_messages
  2. ~/.hermes/.env 写入:

    LLMAPI_KEY=sk-cp-XXXXXXXXXX
  3. 保险设置 api_mode(Hermes ≥ v0.5 是 no-op;老版本作为安全兜底):

    hermes config set model.api_mode anthropic_messages

进 Hermes 后:

/model custom:llmapi:claude-sonnet-4-6

为什么多设一次 api_mode

保险设置:命名 custom provider 切换后,脚本会把 model.api_mode 显式钉成 anthropic_messages。Hermes ≥ v0.5 命名切换本身就会设对,所以这步是 no-op;老版本作为安全兜底,保证当前 provider 走 Claude Messages 协议。如果你以后切回非 Claude-compatible provider,记得改回去。

前置条件

  • 已装 Hermes Agent 且至少跑过一次(~/.hermes/config.yaml 存在)。
  • bash(Linux/macOS)或 PowerShell 5.1+(Windows)。
  • 一把 llmapi API key。

许可证

MIT

About

One-shot setup for using llmapi as Hermes Agent backend (Claude-compatible relay, anthropic_messages protocol)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors