Chapter 4412 min read
Connect Hermes Agent
Install Hermes Agent on macOS, Linux, or Windows and connect it to the CCHP gateway with an LLM key. Add a custom endpoint with the hermes model wizard or the config file, enter the model ID and context length, and verify the connection.
Hermes Agent is an open-source AI agent from Nous Research that you can use in a terminal, a desktop app, and chat apps. It calls the CCHP gateway in the OpenAI-compatible Chat Completions format. After you install Hermes Agent, you need only the gateway URL, an LLM key, the model ID, and the model’s context length to connect it.
What you need#
- LLM key: A full key with the status Active (not the masked key in the list). If you don’t have one yet, see Create an LLM key.
- Network: The installation downloads the Hermes Agent code and the tools it needs, such as Python and Node.js, from GitHub and other sites. Make sure that your computer can reach
github.com.
Already installed Hermes Agent? Skip to configuration.
Step 1: Install Hermes Agent#
Select your operating system and pick any installation method. The first method in each tab is the officially recommended one. Installing Hermes Agent with Homebrew, pip, or uv isn’t officially supported, so don’t use these methods.
When you run the install script in a terminal, the script opens the Hermes Agent setup wizard (titled Hermes Agent Setup Wizard) before it finishes, and the wizard recommends signing in to Nous Portal by default. You don’t need this wizard to connect to CCHP: when you see it, press Esc to exit, and the installation continues to completion. You configure CCHP in step 4.
macOS
System requirements: a Mac with Apple silicon (M series). Macs with Intel chips aren’t officially supported.
Official install script (recommended)
Open Terminal and run:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bashThe script installs the program to ~/.hermes/hermes-agent/ and the hermes command to ~/.local/bin/, and it automatically downloads the tools it needs, such as Python and Node.js, so you don’t need to install them first. The script needs Git: if your Mac doesn’t have the Apple command line developer tools yet, macOS opens an installation dialog. After you complete the installation as prompted, the script continues automatically.
When the installation finishes, the terminal shows Hermes Agent install complete. Run: hermes. Open a new terminal window or run source ~/.zshrc, and then use hermes. To update, run hermes update.
Hermes Desktop app
Requires macOS 12 or later.
- Go to the Hermes website, hermes-agent.nousresearch.com, and click
Download desktop appin the Mac OS column to downloadHermes-Setup.dmg. - Open
Hermes-Setup.dmg, run the installer in it, and follow the prompts to complete the installation. The installer installs Hermes Agent (including thehermescommand) and then builds the desktop app, which takes a few minutes. - The first time you open the desktop app, it asks you to choose a model provider. Click the link that skips this step (
I'll choose a provider laterin the English UI). You configure CCHP in step 4.
If you already installed Hermes Agent with the install script, you don’t need to download the installer: run hermes desktop in a terminal to build and open the desktop app.
Linux
System requirements: an x86_64 or ARM64 processor. Hermes Agent is officially tested on the latest Ubuntu, and other distributions that use glibc and systemd usually work too.
Official install script (recommended)
The script needs Git, curl, and tar. If any of them is missing, install it with your distribution’s package manager. For example, on Ubuntu or Debian, run:
sudo apt update && sudo apt install -y git curl tarThen run the install script:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bashThe script installs the program to ~/.hermes/hermes-agent/ and the hermes command to ~/.local/bin/, and it automatically downloads the tools it needs, such as Python and Node.js. On minimal installations of Debian, Ubuntu, and RHEL-based systems that lack libatomic, the script installs it with the system package manager and asks for your sudo password once at the start.
When the installation finishes, the terminal shows Hermes Agent install complete. Run: hermes. Open a new terminal window or run source ~/.bashrc (source ~/.zshrc if you use Zsh), and then use hermes. To update, run hermes update.
Docker
Requires Docker. The official image nousresearch/hermes-agent supports x86_64 and ARM64. Run these commands to pull the image and create the data directory:
docker pull nousresearch/hermes-agent:latest
mkdir -p ~/.hermesThe container uses ~/.hermes/ on the host as its data directory, where the config and the key are saved. In the later steps, replace the hermes command with docker run -it --rm -v ~/.hermes:/opt/data nousresearch/hermes-agent, followed by the original arguments. For example, hermes model in step 4 becomes:
docker run -it --rm -v ~/.hermes:/opt/data nousresearch/hermes-agent modelHermes Agent in the container can access only the files in the container and the directories mounted into it. To update, run docker pull nousresearch/hermes-agent:latest again.
Windows
System requirements: Windows 10 or Windows 11 on an x64 or ARM64 processor.
PowerShell install script (recommended)
You don’t need admin rights, and you don’t need to install Git or Python first, because the script prepares the tools it needs automatically. Open PowerShell and run:
iex (irm https://hermes-agent.nousresearch.com/install.ps1)The script installs Hermes Agent to %LOCALAPPDATA%\hermes\ and adds the hermes command to the current user’s PATH. When the installation finishes, a line that starts with Hermes Agent install complete appears. Open a new PowerShell window before you use hermes, because windows that are already open don’t read the new PATH. To update, run hermes update.
Hermes Desktop app
- Go to the Hermes website, hermes-agent.nousresearch.com, and click
Download desktop appin the Windows column to downloadHermes-Setup.exe. - Run
Hermes-Setup.exeand follow the prompts to complete the installation. The installer installs Hermes Agent (including thehermescommand) and then builds the desktop app, which takes a few minutes. - The first time you open the desktop app, it asks you to choose a model provider. Click the link that skips this step (
I'll choose a provider laterin the English UI). You configure CCHP in step 4.
If you already installed Hermes Agent with the install script, you don’t need to download the installer: run hermes desktop in PowerShell to build and open the desktop app.
WSL2
Hermes Agent can also run in WSL2, but it doesn’t run reliably in WSL1. Choose this method if you need a Linux environment or your code is already in WSL2.
Open PowerShell as an administrator and run the command below to install WSL2 and the default Ubuntu. Restart your computer when prompted. After the restart, Ubuntu opens and asks you to set a new Linux username and password.
wsl --installIn the Ubuntu terminal, run the Linux install script:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bashFrom then on, run hermes in the WSL terminal. Hermes Agent in WSL2 and Hermes Agent installed directly on Windows each use their own config, so in step 4, use the Linux paths.
After the installation, open a new terminal window and run:
hermes --versionResult: The first line of the output starts with Hermes Agent v, followed by the version number. If you use Docker, run docker run --rm nousresearch/hermes-agent --version to check. If hermes can’t be found, make sure that you’re in a terminal window that you opened after the installation finished. If you run into problems installing or running Hermes Agent, run hermes doctor, which lists the missing components and how to fix them.
After installation: Configure CCHP#
Recommended: Use Magpie or CC Switch to configure CCHP through a graphical interface. Once you verify the connection in that guide, you can start using the client without following the manual steps on this page.
Configure manually: Start at step 2 to get the gateway URL and model details, then use the Hermes Agent wizard or edit the config file yourself. Verify the connection in step 5.
Step 2: Get the gateway URL#
In the sidebar, click API Keys, then copy the URL in the OpenAI row of the API base URLs card at the top of the page, for example https://api.cchp.example.com/v1. Hermes Agent uses this URL, which ends with /v1.
If the page doesn’t show this card, your admin hasn’t set the gateway public URL yet. Ask your admin for the gateway URL, and add /v1 at the end.
Step 3: Choose a model#
In the sidebar, click Models & Pricing, find the model you want to use in Hermes Agent, and note two things:
- Model ID: the monospace text under the model name, for example
claude-opus-5-5. Click the card to open the details, then click the model ID to copy it. - Context length: Ctx on the model card, or Context length in Overview in the details, for example
1M.
Hermes Agent requires a context length of at least 64,000 tokens, and it rejects smaller models at startup. Hermes Agent can’t read the context length from CCHP. If you don’t enter it, Hermes Agent can only estimate it from the model name, and the estimate may not match the actual value, so you enter it manually in step 4. Hermes Agent relies on tool calls to complete tasks, so choose a model with the Function calling capability badge.
To find models, see View available models.
Step 4: Configure Hermes Agent#
You can use the Hermes Agent setup wizard or edit the config file directly. Pick either one. If you installed Hermes Agent with the desktop app, you also complete this step in a terminal.
Hermes Agent saves its config in the data directory: the key in the .env file, and the other settings in config.yaml.
- macOS, Linux, WSL2, and Docker:
~/.hermes/ - Windows:
%LOCALAPPDATA%\hermes\
Use the setup wizard
Run the command below in a terminal, not in a Hermes Agent conversation. If a conversation is open, enter /quit to exit it first. If you use Docker, run docker run -it --rm -v ~/.hermes:/opt/data nousresearch/hermes-agent model.
hermes modelIn the provider list, select Custom endpoint (enter URL manually), then fill in the prompts:
API base URL: Paste the gateway URL from step 2, for examplehttps://api.cchp.example.com/v1.API key: Paste the LLM key. The characters you enter appear as*.- The wizard uses this key to request the gateway’s model list. A line that starts with
Verified endpoint via https://api.cchp.example.com/v1/modelsmeans that the URL and the key work. If a line that starts withWarning: could not verify this endpointappears, pressCtrl+Cto cancel, check the URL and the key, and run the command again. Select API compatibility mode: Enter2to selectChat Completions.- Select the model: The wizard lists the models that this key can call. Enter the number in front of a model, or enter the model ID from step 3 directly. If only one model is listed, the wizard asks whether to use it. Press
Enterto confirm. Context length in tokens: Enter the context length from step 3 as an integer, for example1000000for1Mand200000for200K.Display name: EnterCCHP. The next time you runhermes model, the provider list shows this name.
Result: The wizard shows Default model set to: claude-opus-5-5 (via https://api.cchp.example.com/v1). The key is saved in the .env file in the data directory, and the other settings are saved in config.yaml.
Edit the config file
First, write the LLM key to the .env file in the data directory. If the file doesn’t exist, create it:
CCHP_API_KEY=cch_llm_live_xxxxxxxxThen open config.yaml in the same directory with a text editor, or run hermes config edit to open it. Replace the whole model section with the content below. If the file has no model section, add it at the end of the file:
model:
provider: custom
base_url: https://api.cchp.example.com/v1
api_mode: chat_completions
key_env: CCHP_API_KEY
default: claude-opus-5-5
context_length: 1000000base_url: The gateway URL from step 2.api_mode: Keepchat_completions, which sends requests in the Chat Completions format.key_env: The name of the variable that holds the key. It must match the name in.env.default: The model ID from step 3.context_length: The context length from step 3, as an integer, for example1000000. Don’t write it as1M.
After you save the file, the settings take effect the next time you start Hermes Agent.
Step 5: Verify the connection#
In a terminal, run hermes to start Hermes Agent. If you use Docker, run docker run -it --rm -v ~/.hermes:/opt/data nousresearch/hermes-agent.
Result: The welcome banner shows the model and the context length you configured, for example claude-opus-5-5 · 1M context. If you used the config file, (pinned) also appears after the context length.
Send a message, for example “Introduce yourself in one sentence.” If Hermes Agent replies normally and you can continue the conversation over several turns, the connection works. The desktop app and the command-line version share the same config, so new conversations in the desktop app also use this model.
In CCHP’s Call Records, you can see these requests and the cost of each one. Hermes Agent’s auxiliary tasks, such as title generation and context compression, also use this model by default, so Call Records may show more requests than the messages you sent. To check the costs, see Provider groups and your final price.
Switch to another model#
- If you use the setup wizard: Run
hermes modelagain, selectCustom endpoint (enter URL manually)again, and enter the same gateway URL and key. Then select the new model and enter its context length. - If you use the config file: Change
defaultandcontext_lengthinconfig.yaml.
Frequently asked questions#
What if Hermes Agent says at startup that the context window is below 64,000?#
The message is Model ... has a context window of ... tokens, which is below the minimum 64,000 required by Hermes Agent. Hermes Agent can’t use a model with a context length below 64,000 tokens, so switch to a model with a larger context. If the model’s actual context length is 64,000 or more, the value in the config is too small. Correct context_length with the value you found in step 3, or run the setup wizard again.
What if requests return 401 invalid LLM token?#
The key that Hermes Agent sends is invalid. Check the following:
- Whether you copied the whole key and its status is Active. If the key is disabled, expired, or revoked, see Create an LLM key.
- If you use the config file, whether the value of
key_envexactly matches the variable name in.env. If the names don’t match, Hermes Agent can’t read the key.
What if requests return 403 this client is not allowed for the organization or team?#
Your organization or team has turned on Client restriction, which allows calls only from specific clients. When Hermes Agent connects to a custom endpoint, its requests by default carry nothing that identifies Hermes Agent, so CCHP can’t recognize it as Hermes Agents. To fix this:
-
Ask your organization admin or team admin to allow Hermes Agents in Client restriction. See Manage teams.
-
Add the two lines below to the
modelsection ofconfig.yaml, keep the other settings as they are, and then restart Hermes Agent:config.yamlyaml model: default_headers: User-Agent: hermes-agent
What if a model appears in Models & Pricing but calls to it return 403 or 404?#
Usually, the model isn’t in the key’s Model whitelist, or the model ID has a spelling or letter-case error. To troubleshoot based on the returned message, see View available models.