Connect Hermes
Route the NousResearch Hermes agent to any ModelWorks circuit as a model provider via the OpenAI SSE adaptor.
Connect Hermes to ModelWorks
Hermes is a function-calling AI agent by Nous Research with 266K+ GitHub stars. This guide shows you how to connect Hermes to any circuit on ModelWorks as a model provider.
Prerequisites
- Hermes installed
- A ModelWorks account — sign up
- A ModelWorks API key — from Settings → Security Tokens
Step 1: Get your adaptor URL
Every circuit with an OpenAI SSE adaptor exposes a URL like:
https://modelworks.ai/api/circuit-adaptors/ca-xxxxxxxxxxxxxxxxx/queryFind it on the circuit page under Adaptors → OpenAI SSE.
Step 2: Configure Hermes
Hermes uses environment variables or a config.yaml to connect to model providers. Point it at your ModelWorks OpenAI SSE adaptor:
Environment variables
export MODELWORKS_ADAPTOR_URL="https://modelworks.ai/api/circuit-adaptors/ca-xxxxxxxxx/query"
export MODELWORKS_API_KEY="mw_YOUR_API_KEY"Config file
Add to your Hermes config.yaml:
model:
provider: modelworks
base_url: https://modelworks.ai/api/circuit-adaptors/ca-xxxxxxxxx/query
api_key: mw_YOUR_API_KEY
model: glm-53-abliteratedDirect OpenAI-compatible connection
Hermes can also connect through the OpenAI-compatible interface by setting the base URL and API key:
from hermes import Hermes
agent = Hermes(
base_url="https://modelworks.ai/api/circuit-adaptors/ca-xxxxxxxxx/query",
api_key="mw_YOUR_API_KEY",
model="glm-53-abliterated"
)Step 3: Run your first circuit
Start Hermes and send a prompt:
hermes chatThe circuit runs on ModelWorks and the response streams back to your Hermes agent.
Troubleshooting
| Issue | Fix |
|---|---|
| 401 Unauthorized | Your API key expired. Generate a new one from Settings → Security Tokens. |
| 402 Payment Required | Your wallet needs credits. Fund it at modelworks.ai/settings/wallet. |
| Connection refused | Verify the adaptor URL — it must be the full https://...query path. |
| Empty response | Check that the circuit version is RUNNING (not STAGING). |