Hermes Agent
How to run Hermes Agent with llama.cpp
Updated 1 December 2026
Run llama-server with a GGUF model in the same operating system environment as Hermes Agent, then point Hermes at the server’s OpenAI-compatible API. If Hermes runs inside WSL2, start the server inside that same WSL2 environment for these localhost steps. Check the context window the server reports before starting a chat. After Hermes replies, test a tool call.
The steps come from the Hermes Agent 0.23.5 documentation and source and the llama.cpp v1.1.0 documentation and source, read on 30 November 2026. The primary references are the Hermes Providers guide, the Hermes Local Models guide, the llama-server reference and the llama.cpp function-calling guide.
Install llama.cpp and get a GGUF model
llama.cpp runs models on your CPU or GPU. Its HTTP server, llama-server, loads the model and generates replies. Hermes sends the conversation and descriptions of its available tools to the server. Hermes runs permitted tool calls and sends their results back to the model. Some operations can require approval or be blocked.
Start by installing Hermes Agent. For a prebuilt version of llama.cpp, download and unpack the package for your operating system and hardware from build b12774, which the v1.1.0 release points to. If you picked a CUDA build for Ubuntu or Windows and need the runtime libraries, download the matching cudart archive from the same release and put the extracted library files next to the server executable.
To build it yourself, unpack a source archive from the v1.1.0 release and follow the build instructions from the extracted folder. If your terminal can’t find llama-server, launch it by its path in the unpacked package or build folder.
On macOS, the Hermes guide also documents this Homebrew install command.
brew install llama.cppDownload a GGUF model with a context window of at least 64,000 tokens and a chat template that handles tool calls. For the example below, download Qwen3.5-9B-Q4_K_M.gguf and save it as ~/models/Qwen3.5-9B-Q4_K_M.gguf. Create a models folder in your home directory if needed.
Start llama-server on port 8080
Run this command in a macOS, Linux or WSL terminal. If you saved the GGUF file elsewhere, change the path after -m. On native Windows, open PowerShell and type & before the quoted full path to llama-server.exe. After -m, enter the quoted full path to the GGUF file and keep the remaining flags as shown.
llama-server -m ~/models/Qwen3.5-9B-Q4_K_M.gguf --ctx-size 65536 -np 1 --jinja --port 8080 --host 127.0.0.1The command requests 65,536 tokens, as shown in the Hermes Quickstart. It starts one slot, enables Jinja for chat templates and listens on port 8080 for local connections. Leave the server running while you set up Hermes in another terminal.
With the default settings, leaving out --ctx-size lets llama.cpp shrink the model’s context window to fit available memory. Setting --ctx-size 0 explicitly requests the model’s full window and prevents that automatic reduction. If the server runs out of memory, try a smaller compatible GGUF model or use the Hermes macOS guide’s settings for reducing cache memory on supported hardware. If you request a smaller window, check that the server still reports at least 64,000 tokens per slot.
The macOS guide shows a listening message on port 8080 after a command that leaves out --port. Use the tagged llama.cpp server reference for the actual default, 9931. If you leave out the port flag, use http://localhost:9931/v1 for the default port. If you copy an example that uses bare -fa, the v1.1.0 parser expects a value. The macOS guide uses -fa on.
If you configured --api-key or --api-key-file, use a matching key in the Hermes setup. Authenticated requests send it in the Authorization header as a bearer token. The server returns HTTP 401 on protected routes when the key is missing or wrong.
Connect Hermes to the Chat Completions API
Before running hermes model, open http://localhost:8080/health in your browser. Use your server’s port if it differs. If the model is still loading, wait and refresh until you see {"status":"ok"}. If the browser can’t connect, check the address and port in the server terminal. This check also works with server authentication enabled.
hermes model- Choose Custom endpoint (enter URL manually). The Providers guide uses a different label. This is the one in the 0.23.5 CLI menu.
- Enter
http://localhost:8080/v1for the server on port 8080. Give Hermes the base URL ending in/v1. Hermes adds/chat/completionswhen it sends a request, so pasting the full/v1/chat/completionsroute into the base URL field gives it the wrong path. If the server requires a key, enter it. A blank prompt can reuse a saved key for the same protocol, hostname and port. If the server does not require a key and there’s none saved for that address, leave the prompt blank. - Select Chat Completions. Accept the detected model if it matches the one you loaded, or enter the model ID using the lookup below. Leave the context prompt blank for detection or enter the context you verified on the server, then confirm a display name.
To look up the model ID, open http://localhost:8080/v1/models and copy the id under data. Use your server’s port if it differs. If you set a server key, make the request with an HTTP client that sends the key as a bearer token. If you configured --alias, the server reports that alias as the ID.
The wizard checks for a model list under the base you enter. If it finds the list only after adding or removing /v1, it saves the working base. llama.cpp v1.1.0 serves models and chat both with and without that prefix. Use /v1 here because it matches the upstream client example.
For manual setup, run hermes config edit to open your profile’s configuration. In the model block, replace the example model name with the ID from the lookup above. For an authenticated server, store the key in your Hermes profile’s .env file. In the model block, remove any existing api_key or api entry, then set key_env to the name of the variable holding the key.
model:
default: your-model-name
provider: custom
base_url: http://localhost:8080/v1
api_mode: chat_completionsCheck that the model has enough context
Hermes Agent 0.23.5 rejects a resolved context window below 64,000 tokens for this setup. Older Hermes guidance suggested a range starting at 32k. Use the 0.23.5 floor because its startup check enforces it. With authentication off, run the command below in a macOS, Linux or WSL terminal with jq installed to check the single-model server’s slot size. Change the port in the URL if your server uses a different one.
curl http://localhost:8080/props | jq '.default_generation_settings.n_ctx'On native Windows, open http://localhost:8080/props in your browser with authentication off. You can use the browser on macOS, Linux or WSL too. If you set a key, use an HTTP client that sends it as a bearer token. Look for default_generation_settings.n_ctx in the JSON response.
The server can cap the slot at the model’s training context or a configured --kv-unified-per-slot limit. The Providers guide describes splitting the context across slots. In v1.1.0 that division applies when the key-value cache is split. With a unified cache, the slots share one pool. Check the reported slot size before relying on a multi-slot setup.
If the server reports less than 64,000, check the requested size and any per-slot cap, then restart it with enough context. If the model itself is the limit, choose one that supports a larger window.
Run hermes --cli and send a short message. After the first reply, enter /context in Hermes and compare its reported window with the slot size from /props. When Hermes identifies a llama.cpp server through /models, it tries /v1/props and falls back to /props. It uses the slot size when it can match it to the model.
If Hermes detects the wrong size and the slot meets the 64,000-token minimum, run hermes config edit, set model.context_length to the verified slot size and start a new chat. To increase the slot size itself, change the server settings.
Send a message and test a real tool call
Once Hermes replies in the terminal, create a small text file with a distinctive line in a location Hermes can read. Ask Hermes to use read_file on the file’s full path and quote the line. Look for a completed tool entry labelled Read or read for your file, then check that the reply quotes the line you wrote.
If tool calls appear as JSON in the reply, check the model’s chat template and the server settings. The Providers guide says disabling Jinja makes the server ignore tools. Follow the llama.cpp v1.1.0 source for this version. It enables Jinja by default, and with --no-jinja it rejects requests that include a nonempty tools list or set tool_choice to anything other than auto. If --skip-chat-parsing or LLAMA_ARG_SKIP_CHAT_PARSING is forcing tool calls to appear as plain text, use --no-skip-chat-parsing to restore normal parsing.
llama.cpp normally uses the chat template from the model file. The function-calling guide describes a generic fallback. In v1.1.0, if no built-in handler recognises the template, the server tries to build a parser from it to read the model’s tool calls. See the v1.1.0 source.
If your model provides a separate tool-use template, restart llama-server with --chat-template-file followed by the path to that file, then repeat the file test. The server includes the chat_template field in /props even when Jinja is disabled, so use a completed tool call to verify the setup.
When to use Hermes’s built-in llama.cpp provider
Hermes also has a llamacpp provider for its Local Models workflow. Hermes Agent 0.23.5 pins llama.cpp build b12144 for the runtime it manages. The steps above use the custom endpoint for a server you start yourself.
To use the llamacpp provider with your own unauthenticated server on port 9931, set model.provider to llamacpp, model.default to the model ID from /v1/models and providers.llamacpp.base_url to http://localhost:9931/v1. If your server requires a key, use the custom endpoint steps above.
If you already use another local runtime, see the separate guides for Ollama, LM Studio and vLLM.
llama.cpp on ReadyHermes
ReadyHermes hosts Hermes Agent on its own servers. We have not tested llama.cpp on or with hosted assistants, and ReadyHermes does not install a model runtime on your computer. The same-machine setup above is for self-hosted Hermes.
In your ReadyHermes account, the Model key panel’s Other endpoint option accepts OpenAI-compatible APIs at a public HTTPS hostname on port 443. A path such as /v1 is allowed. The panel rejects localhost, private addresses, bare IP addresses, query strings and credentials embedded in the URL. It sends the API key as a bearer token. See the model setup overview.
ReadyHermes has an always-on assistant with AI included and a 30-minute free trial.
Questions
Can Hermes Agent use a model running in llama.cpp?
Yes. Start llama-server with your GGUF model, run hermes model and choose Custom endpoint (enter URL manually). Enter your base URL, select Chat Completions and accept the detected model or enter the ID from /v1/models.
Which llama.cpp base URL should you enter in Hermes Agent?
Use http://localhost:8080/v1 if you started llama-server with --port 8080. The upstream default port is 9931, so use http://localhost:9931/v1 for that port. Hermes appends /chat/completions to the base URL.
How much context does Hermes Agent need with llama.cpp?
Hermes Agent 0.23.5 requires at least 64,000 tokens for this setup. The example requests 65,536 tokens with --ctx-size 65536. Check default_generation_settings.n_ctx in /props for the context the single-model server gives a slot.
Why is Hermes printing tool calls as text?
Check that Jinja is enabled and that the model has a suitable tool-use template. Jinja is enabled by default in llama.cpp v1.1.0. If the server is forcing plain-text output, use --no-skip-chat-parsing to restore normal parsing. Verify the fix with a completed tool call in Hermes.
Can a ReadyHermes assistant connect to llama.cpp on localhost?
No. ReadyHermes requires a public HTTPS hostname on port 443 for Other endpoint. ReadyHermes has not tested llama.cpp with hosted assistants.