Hermes Agent
How to connect Hermes Agent to a LiteLLM proxy
Updated 28 November 2026
Hermes runs the agent and its tools. LiteLLM sits between Hermes and the model provider. Hermes sends the proxy a chat request with a model alias and a virtual key. LiteLLM looks up the alias and uses its own provider credentials to reach the model. If you already have the proxy URL, alias and virtual key, go to LiteLLM on ReadyHermes for the Model key panel. If you manage Hermes yourself, use the terminal wizard or the YAML instructions.
Sources read on 28 November 2026 include the Hermes Agent 0.23.5 provider guide, the Hermes model settings and LiteLLM’s Hermes client guide. The proxy version reviewed was LiteLLM 1.111.0, which GitHub marked as its latest release. It was published on 25 November. The 27 November release belongs to the separate 1.108.20 LTS line.
Start LiteLLM with a model Hermes can call
On the proxy host, use a Python environment with Python 3.10 or later, below 3.16. Install the proxy and the database extra in that environment. The database extra installs the Prisma command-line tool.
pip install "litellm[proxy]"
pip install 'litellm[extra_proxy]'On a fresh proxy, generate the administrator’s master key once.
echo "sk-$(openssl rand -hex 32)"Save the result securely. Use that same value for LITELLM_MASTER_KEY when you start the proxy and when you issue a virtual key. Set OPENAI_API_KEY to your upstream OpenAI key for this example. Point DATABASE_URL at an empty PostgreSQL database reserved for LiteLLM. Use an account that can create and update its tables. The connection string has the form postgresql://<user>:<password>@<host>:<port>/<dbname>.
In the same Python environment, go to the installed package’s litellm/proxy directory, which contains schema.prisma. Run prisma generate to create the database client, then return to the directory where you want to save config.yaml.
Save the following as LiteLLM’s config.yaml. Under model_list, model_name is the alias your client will request. The nested model identifies the provider and model LiteLLM should call. Use a model your provider account can access and that supports tool calls.
model_list:
- model_name: gpt-6.1-sol
litellm_params:
model: openai/gpt-6.1-sol
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: os.environ/LITELLM_MASTER_KEYFor a local-only setup on one machine, start the proxy from the directory containing config.yaml with the command below. It accepts connections only from that machine.
litellm --config config.yaml --host 127.0.0.1LiteLLM’s default host listens on all IPv4 interfaces. For remote access, expose only the routes your clients need over HTTPS. Check the port in LiteLLM’s startup output before sending a key. The examples use port 4000. If LiteLLM started on a different port, use that port in every local URL below.
LiteLLM also documents litellm --model gpt-6.1-sol for a single-model start. Use the configuration file for the virtual-key setup above. See the LiteLLM configuration examples and the CLI database requirement.
Issue a virtual key for the model alias
Open a second terminal on the proxy host with LITELLM_MASTER_KEY set. Use the master key to authorise this request. The models list limits the new key to the alias you configured above. If you changed that alias, change it here too.
curl 'http://localhost:4000/key/generate' \
--header "Authorization: Bearer $LITELLM_MASTER_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{"models": ["gpt-6.1-sol"]}'Copy the returned virtual key for Hermes. Keep the master key with the proxy administrator and the upstream OpenAI key on the proxy host. The LiteLLM virtual-key guide documents the database requirement and the key-generation endpoint.
Connect Hermes with the terminal wizard
- On the machine running Hermes, open a terminal and run
hermes model. Choose Custom endpoint (enter URL manually). The provider guide calls this option “Custom endpoint (self-hosted / VLLM / etc.)”. The first label is the one in the 0.23.5 model picker. The in-chat/modelcommand switches between providers you have already added. - Use
http://localhost:4000/v1if Hermes can reach LiteLLM through localhost on port 4000. For a remote proxy, enter its HTTPS base URL ending in/v1, such ashttps://litellm.example.com/v1. Hermes appends/chat/completions. At the key prompt, paste the virtual key. - Hermes probes the endpoint. Choose Chat Completions for the API mode. Select your alias from the discovered models or type it. For the example above, enter
gpt-6.1-sol. Leave context length blank for automatic detection, then accept or change the display name.
The wizard saves the key under an endpoint-specific environment variable in the profile’s .env and writes a reference into the configuration. If CUSTOM_BASE_URL is already set in the environment that runs Hermes, set it to the same LiteLLM base URL you entered in the wizard. Then start a new session and check the request.
Configure the same connection in YAML
Edit your Hermes profile’s config.yaml. For the default profile, this is ~/.hermes/config.yaml. Choose one example below. In either one, use a proxy URL Hermes can reach and set default to the exact LiteLLM alias your virtual key can access.
For the simple form, update your existing model section. If the Hermes environment already sets CUSTOM_BASE_URL, set it to the same LiteLLM URL. It takes precedence over the URL in this section. Remove any old api_key or api credential from that section before changing base_url. Set key_env to the name of the variable holding the virtual key. Keep the key itself out of config.yaml and source control.
model:
provider: custom
default: gpt-6.1-sol
base_url: http://localhost:4000/v1
api_mode: chat_completions
key_env: LITELLM_API_KEYFor options such as a conversation header, use a named provider. Add litellm under your existing providers section, or create that section if it is missing. Set api to your proxy base URL. In your existing model section, set provider to custom:litellm and default to your alias.
providers:
litellm:
api: http://localhost:4000/v1
transport: chat_completions
key_env: LITELLM_API_KEY
model:
default: gpt-6.1-sol
provider: custom:litellmSave the complete virtual key as LITELLM_API_KEY in the active Hermes profile’s .env file. For the default profile, that file is ~/.hermes/.env. Then run hermes and start a new conversation.
Verify the request, the tool call and the deployment
- Check model discovery. LiteLLM serves
GET /v1/models. Look for the alias when Hermes lists the models. If it is missing, compare the spelling in the proxy’smodel_namewith the aliases allowed on the virtual key. - Check a chat request. Start a new Hermes session with
hermesand send a short prompt. Hermes callsPOST /v1/chat/completions. Open/uion the proxy. On a fresh install with the settings above, sign in asadminwith the master key as the password. Create and test your own administrator account before disabling the shared login, as described in the Admin UI guide. In Logs, look for the request under your virtual key and model alias. If you received only a virtual key, ask your administrator to confirm the request. - Check a tool call. Give Hermes the path to a small text file in its workspace and ask it to read the first line with its file tool. Check the tool result against the file. If text replies work but this test fails, check that the model behind the alias supports tools.
An alias may cover multiple deployments. To see which one answered in a Hermes gateway reply, enable the final-message footer in the active gateway profile’s config.yaml and include served_model in its fields. The default profile uses ~/.hermes/config.yaml. The footer is off by default.
display:
runtime_footer:
enabled: true
fields: ["model", "served_model"]Hermes first reads the x-litellm-model-id response header, then x-litellm-model-api-base if the ID is empty. The footer shows a differing deployment when reported. Without either header, it can still show a different model chosen by Hermes during fallback. See the header lookup and gateway footer settings.
Keep a conversation on the same deployment
If several deployments serve one alias, you can ask LiteLLM to keep a conversation on the deployment that handled its first request. In the named Hermes provider above, add this line alongside transport and key_env.
session_affinity_header: x-litellm-session-idHermes sends the conversation ID on requests to this proxy, including title generation and compression when those tasks use the same proxy. The ID survives compaction and changes for each new conversation. Hermes leaves this header off by default. On the LiteLLM side, enable session affinity in the proxy’s configuration.
router_settings:
optional_pre_call_checks: ["session_affinity"]Use a routing strategy that supports session affinity, such as the default simple-shuffle. Save both YAML files and restart LiteLLM. To check routing, use an alias with at least two healthy deployments. Send two prompts in the same new Hermes conversation and compare the x-litellm-model-id values. Matching IDs show that both requests reached the same deployment. A base URL in the footer cannot distinguish deployments that share that URL.
By default, LiteLLM remembers the deployment until the conversation goes an hour without a request. It can select another healthy deployment if the first is in cooldown. If requests can reach more than one proxy instance, configure Redis so the instances share the session pin. See LiteLLM’s session affinity guide.
When delegated requests or fallback behave differently
Chat works, but a delegated task gets a 404. A subagent can have its own endpoint. Hermes infers its protocol from delegation.base_url. If that endpoint accepts Anthropic Messages and Hermes misses it, set the mode explicitly in your existing delegation settings.
delegation:
api_mode: anthropic_messagesIf the proxy exposes OpenAI Chat Completions to the subagent, use chat_completions even when Anthropic serves the model upstream. The endpoint that the subagent calls determines the protocol. See the Hermes delegation settings.
The proxy picked a different deployment. The Hermes provider guide labels its example “with fallback”, but both deployments share the alias best and the configured strategy is latency-based-routing. That selects by latency within one group. For an ordered backup across model groups, LiteLLM documents fallbacks under router_settings in its failover guide.
The proxy reports a daily limit. Hermes treats “Too many tokens per day”, “daily limit” and “tokens per day” as exhausted quota, like HTTP 402. If the error reaches Hermes, it can switch to a backup provider and model you configured with hermes fallback or fallback_providers. See how to configure a Hermes fallback model.
LiteLLM on ReadyHermes
If you already run a LiteLLM proxy, its OpenAI-compatible base URL fits the Model key panel when it uses a public HTTPS hostname on port 443. A path such as /v1 is allowed. The panel rejects localhost, private addresses, bare IP addresses, other ports, query strings and credentials in the URL.
- In Model key, choose Your own API key, then Other endpoint. Enter the base URL and paste the LiteLLM virtual key. The panel sends it as
Authorization: Bearer <key>. - Select the alias from the proxy’s model list or type it. Press Switch to my key. ReadyHermes sends a small chat completion to test the key. After a successful test, the assistant restarts on that key in about a minute.
The panel cannot add custom headers, so it cannot set session_affinity_header. Running LiteLLM on or with a ReadyHermes assistant beyond this panel setup is untested. Our model key overview covers the hosted options.
Questions
Which LiteLLM URL goes in Hermes Agent?
Use http://localhost:4000/v1 if Hermes can reach LiteLLM through localhost on port 4000. For a remote proxy, use its HTTPS base URL ending in /v1. Hermes appends /chat/completions.
Which LiteLLM key and model name does Hermes need?
Give Hermes a virtual key and a model_name alias that the key can access. The administrator uses the master key to issue the virtual key. The upstream provider key stays on the proxy.
How can we check that Hermes used the LiteLLM proxy?
Send a prompt in a new Hermes session. In the proxy dashboard at /ui, check Logs for your virtual key and model alias. On a fresh proxy set up as shown above, the first login uses admin and the master key. If you received only a virtual key, ask your administrator to confirm the request. Then test a tool call.
How can a Hermes conversation stay on the same LiteLLM deployment?
Set session_affinity_header to x-litellm-session-id on the named Hermes provider and enable session_affinity in LiteLLM’s optional_pre_call_checks. Use a supported routing strategy, save both files and restart LiteLLM. For an alias with at least two healthy deployments, compare x-litellm-model-id across two prompts in the same new conversation. Matching IDs mean both requests reached the same deployment.
Does ReadyHermes accept a LiteLLM proxy URL?
A public HTTPS hostname on port 443 fits the Other endpoint option. Enter the base URL, virtual key and model alias. The panel cannot add the session affinity header. LiteLLM use beyond this panel setup is untested.