Install Hermes Agent
On macOS, install with the official script, reload your shell, and start Hermes:- The script brings its own uv, Python 3.14, Node, ripgrep, and FFmpeg, so you don’t need to install Python first.
- It puts the
hermescommand in~/.local/bin/, the code in~/.hermes/hermes-agent/, and your data and settings in~/.hermes/. - Installing with pip, uv, or Homebrew isn’t supported by the project. On Apple Silicon Macs you can also use the Hermes Desktop app.
Connect LaoZhang API
1
Create a token
In Tokens, create a token in the
default group with the Usage first billing mode, then copy the key. The wizard uses the OpenAI format; if you later use Claude over the Anthropic format, you’ll add a second token in the Claude Code group.2
Start the model wizard
Run:From the provider list, choose Custom endpoint (self-hosted / VLLM / etc.).
3
Enter the endpoint details
- API base URL:
https://api.laozhang.ai/v1 - API key: your LaoZhang API key
- Model name: the full model ID, such as
deepseek-v4-pro - Context length: leave it blank and Hermes detects it
4
Run a task that uses a tool
hermes -z runs a single prompt and exits. Ask for something that needs a tool:hermes without arguments for an interactive session.Edit the config file
The wizard is the quickest way in. To set things up by hand, or to see what the wizard changed, open~/.hermes/config.yaml. The smallest working setup looks like this:
~/.hermes/config.yaml
hermes config set call saves one key to config.yaml:
key_env tells Hermes which environment variable holds the key. Put the key itself in ~/.hermes/.env, not in the YAML file:
~/.hermes/.env
- Keep
/v1at the end ofbase_url. Hermes sends requests to/v1/chat/completionsunder that address. - Uppercase names passed to
hermes config setgo to.envinstead ofconfig.yaml. - To try another model for one run without editing the file, use
hermes -m gpt-6.1-solor setHERMES_INFERENCE_MODEL.
Switch models with a named provider
A named provider lets you keep the LaoZhang API endpoint in one place and switch models in the middle of a session:~/.hermes/config.yaml
custom:laozhang:, as long as it supports tool calling.
Use Claude over the Anthropic format
When Hermes talks to Claude over the Anthropic Messages format, it adds prompt caching on its own. An agent resends the conversation and tool definitions on every step, so cached input can cut the cost of long sessions noticeably; see prompt cache billing. Add a second provider withapi_mode: anthropic_messages:
~/.hermes/config.yaml
Claude Code token group. Create one in Tokens with the Usage first billing mode and add it to ~/.hermes/.env next to the first key:
~/.hermes/.env
- Use
https://api.laozhang.aias the address. Hermes also accepts it with/v1and removes the suffix itself. - Hermes sends the key in the
x-api-keyheader. Each provider reads its own key, named inkey_env. - Claude models on this format:
claude-sonnet-5-5,claude-opus-5-5, andclaude-haiku-5-5. Automatic prompt caching applies to these. - Other models on this format:
glm-5.2,deepseek-v4-pro, anddeepseek-v4-flash. - Switch between the two providers in a session with
/model custom:laozhang-claude:claude-opus-5-5or/model custom:laozhang:gpt-6.1-sol.
- Add
api_mode: anthropic_messagesundermodel. - Change
base_urltohttps://api.laozhang.ai. - Set
key_envtoLAOZHANG_CLAUDE_API_KEY.
Choose a model
Hermes needs a model that returns tool calls and has a context window of at least 64K; it won’t start with a smaller one. These models return tool calls in streaming Chat Completions requests:
Since November 4, 2026, GPT-6 and GPT-5.6 models such as
gpt-6-sol and gpt-5.6-sol can also reason and call tools in the same Chat Completions request. Prices are in the model catalog.
Read images with a text-only model
Side tasks such as session titles, context compression, and image reading use the main model unless you set them separately. If your main model can’t read images, set a vision model underauxiliary. Replace the placeholder with the ID of a model that accepts image input, from the model catalog:
~/.hermes/config.yaml
Use Hermes on Telegram and other chat apps
The messaging gateway runs the same agent on Telegram, Discord, Slack, WhatsApp, Feishu, WeCom, and other platforms. It reads the model from the same~/.hermes/config.yaml, so the LaoZhang API setup above carries over with no extra configuration.
1
Set up a platform
2
Start the gateway
config.yaml, and the request shows up in your call logs.FAQ
I get a 401
The key is wrong or was cut off when copied. Check the key lines in~/.hermes/.env, including LAOZHANG_CLAUDE_API_KEY if you use the Anthropic format. Make sure each key_env value in config.yaml uses the same name as its line. See Invalid API key or 404.
I get a 403 or 503 “no available channels”
The token’s group doesn’t include the model, or the model ID is misspelled. Use adefault group token for the OpenAI format and a Claude Code group token for the Anthropic format, both with the Usage first billing mode, and copy the ID from the model catalog. For Claude, claude-haiku-4-5-20251001 isn’t offered; use claude-haiku-5-5. See Check model availability and access.
I get a 404
For the OpenAI format, the base URL must end in exactly one/v1: https://api.laozhang.ai/v1. A missing or doubled /v1 returns 404.
Hermes won’t start and reports the context length is too small
Hermes requires at least 64K of context. Switch to a model from the table above. If you typed a context length in the wizard, runhermes model again and leave the field blank, or enter the model’s real context length.
The agent replies but never runs a tool
Hermes calls the model through Chat Completions and expects tool calls back. Switch to a model from Choose a model.OPENAI_BASE_URL, OPENAI_API_BASE, or LLM_MODEL has no effect
Hermes reads the custom endpoint fromconfig.yaml, not from these variables:
OPENAI_BASE_URLandOPENAI_API_KEYapply only to the built-inopenai-apiprovider.OPENAI_API_BASEisn’t read.LLM_MODELhas been removed. UseHERMES_INFERENCE_MODELor-mfor a one-off model.
hermes config set llm.* are out of date. The keys are model.*, such as model.default.