MadWeightsOpen weights research. The Raw Uncut.
TUTORIAL ·

Run Hermes Agent against your own local model server

At the end of this guide Hermes Agent will talk to a model you serve yourself, with llama.cpp, vLLM or a similar server, and you will know which settings keep long agent turns from timing out. It is for someone who already has a local server answering requests and wants an agent on top of it. Hermes Agent is the open-source agent from Nous Research; this is not their guide, and their documentation wins where it differs from what we write.

Requirements: a GPU server running llama.cpp, vLLM or a similar server with tool calling and at least 64,000 tokens of context · Linux, macOS or WSL2 with git and curl · current Hermes Agent release

Requirements

  • A model server with an OpenAI-compatible (/v1/chat/completions) or Anthropic-compatible (/v1/messages) endpoint.
  • A model with working tool calls and a context window of at least 64,000 tokens, the minimum Hermes Agent's provider docs give for agent use; smaller windows are rejected at startup.
  • Linux, macOS or WSL2, with git and curl.
  • An API key for your server, even a throwaway one, kept in an environment variable.

Steps

1. Install Hermes Agent

Use the install script from the official installation page. It is a one-line curl ... | bash command for Linux, macOS and WSL2; read the script first if you prefer. Then reload your shell, run the setup wizard and the built-in diagnostics (the setup and doctor subcommands in the CLI reference).

2. Make sure the server can do tool calls

Hermes Agent depends on tool calls. With llama.cpp, the chat template must be active (--jinja, on by default in current builds), or tool calls come back as raw text. With vLLM, pass --enable-auto-tool-choice and a --tool-call-parser that matches your model. Give the server at least 64,000 tokens of context per slot; with llama.cpp's -np, the context is split among slots.

llama-server -m <models-dir>/model.gguf --jinja -c 131072 -np 1 --host <server-address> --port 8080 --api-key <your-key>

Raise -np only if -c divided by -np still leaves 64,000 or more per slot. With Ollama below 24 GB of VRAM, the default context is 4,096 tokens; raise it on the server side as the provider docs describe.

3. Add the server as a named provider

Put the key in an environment variable of your choosing (this example uses LOCAL_LLM_KEY), then add a provider entry to the agent's config.yaml and make it the default model. The documented keys are api for the endpoint, key_env for the variable that holds the key, and transport for the protocol: chat_completions for OpenAI-compatible servers, anthropic_messages for Anthropic-compatible ones.

providers:
  local-server:
    api: http://<server-address>:8080/v1
    key_env: LOCAL_LLM_KEY
    transport: chat_completions
    default_model: my-model
    models:
      my-model:
        context_length: 131072
model:
  provider: local-server
  default: my-model

Older configs use base_url and api_mode; the docs list these as accepted legacy names. The model subcommand asks for the same fields if you prefer not to edit the file.

4. Set context length and compression

When a chat nears the context limit, Hermes Agent summarises older turns in a separate call. On a local server that call is a long prompt read plus a long answer, and it happens in the middle of a turn. Set context_length explicitly if auto-detection reports a wrong window, and keep compression starting early so the summary stays small.

compression:
  enabled: true
  threshold: 0.5
  target_ratio: 0.2
  protect_last_n: 20

These are the documented defaults in the configuration docs. The summariser's model is set under auxiliary.compression; leaving its model empty uses the main chat model.

5. Set reasoning effort

agent.reasoning_effort takes none, minimal, low, medium, high, xhigh, max or ultra, and is medium when unset. agent.reasoning_overrides sets it per model id. How a server uses the value varies, so check your server's logs to see what arrives.

agent:
  reasoning_effort: high

6. Set timeouts

agent.turn_liveness.timeout_s aborts a turn that makes no progress; the documented default is 600 seconds, and a value of 0 or less turns the watchdog off. Raise it if your server reads long prompts slowly. Single calls are bounded per provider by providers.<id>.stale_timeout_seconds, and each auxiliary task has its own timeout.

agent:
  turn_liveness:
    timeout_s: <seconds>

7. Cap output where it is honoured

The provider docs say Hermes Agent no longer reads model.max_tokens and sends no output cap to custom endpoints, so the server's default applies. Set a cap on the server, or pass one in the provider's extra_body, which is merged into every chat-completions request.

providers:
  local-server:
    extra_body:
      max_tokens: 8192

Check it worked

Run a one-shot question with the chat subcommand and --oneshot -q "...", as the CLI reference describes. The answer should come back and the agent should exit. Then ask for something that needs a tool, such as listing a directory, and watch your server's log for a request that carries tools. With llama.cpp you can also confirm that the server's /props response includes a chat_template field.

Common problems

  • Turns abort with a liveness watchdog message in long chats: every turn re-reads the whole prompt, and a compression call in the middle of a turn can outlast the watchdog. Keep compression.threshold low, raise turn_liveness.timeout_s, and start fresh chats before big tasks.
  • One request runs for minutes with no answer: without an output cap the model can keep thinking. Cap it on the server or in extra_body (step 7).
  • The main turn waits behind small jobs: titles, compression and memory review are separate calls that by default go to your main model and take server slots. Point auxiliary.<task> at a smaller model or another server, or turn off titles with auxiliary.title_generation.enabled: false.
  • Delegated agents time out: sub-agents inherit the parent's model unless delegation.model or delegation.provider say otherwise. Give them a smaller or faster model, or a longer budget.
  • Speed drops when two agents talk at once: if your server speeds up a single request with speculative drafting, a second request can turn that off for both. Let one agent request through at a time with a small queueing proxy, or give agents separate servers.
  • Context rejected at startup: the server reports less than 64,000 tokens. Raise it on the server side.
  • Tools ignored by llama.cpp: make sure --jinja is on and the model has a chat template with tool support.

Our recommendation

We'd give each agent its own provider entry pointing at the same server, with the key in an environment variable, so one change of address moves them all. We'd use high reasoning effort for the main agent: in our own comparison on real agent prompts, high fixed hard cases that lower settings did not, and repeated low-effort samples tended to make the same mistakes together. We'd keep compression early, chats short, and helper tasks off the main model, because every background call competes with the turn you are waiting for. And we'd send one request at a time to a server that drafts only for one, rather than share slots. On our three-V100 server, that single queue is what keeps drafting on.

Further reading