Coldforge: Reliable by design.

How to Run Hermes Agent Locally with Ollama on an 8 GB Linux VPS (Zero Subscription Cost)

You can run a capable AI agent without a monthly model bill, even on modest hardware. This guide installs Hermes Agent, the open-source self-improving agent from Nous Research, and points it at a small local model served by Ollama on a Linux VPS with 8 GB of RAM. All inference stays on your machine.

The trade-off is real. Small models on a CPU are slower and weaker at tool calling than large cloud models. For chat, drafting, research and lighter agent tasks they work well and cost nothing ongoing.

Read this first: Hermes needs a 64,000-token context window. Ollama's default is only 4,096 tokens (2,048 in older releases), and Hermes will refuse a model with a smaller window. Raising it uses a lot of memory, which is the main challenge on an 8 GB server. Step 5 covers it. Treat 8 GB as the practical minimum for trying this, not a comfortable setup.

What you need

Step 1: Install and verify Ollama

Ollama is the simplest way to run open-weight models and expose an OpenAI-compatible API.

curl -fsSL https://ollama.com/install.sh | sh

Verify that the service is running:

ollama --version
curl http://127.0.0.1:11434/api/tags

You should see a JSON response. An empty model list, {"models":[]}, is fine at this stage. On most Linux installs the service starts automatically through systemd.

Step 2: Choose and pull one or two models

On 8 GB of RAM, stay with small models. Larger ones will swap heavily or fail to load cleanly. Sizes and context windows below come from the Ollama model library.

Small models for an 8 GB server
ModelDisk sizeContext windowBest for on 8 GB
qwen3:4babout 2.5 GB256KBest overall balance and the better chance of usable tool behaviour
llama3.2:3babout 2.0 GB128KFastest and lightest; chat and simple Q&A (Hermes's own local guide lists it as chat only)
phi4-miniabout 2.5 GB128KSolid reasoning for the size, with function calling support
qwen3:8babout 5.2 GB40KNot recommended here: the weights take most of your RAM and the 40K window is below the Hermes minimum

Pull the ones you want:

ollama pull qwen3:4b
# optional second model
ollama pull llama3.2:3b

Test a model quickly:

ollama run qwen3:4b
# type a short prompt, then /bye

Ollama loads models on demand and unloads idle ones. Two installed models are fine on disk, but on 8 GB of RAM you should only use one at a time.

Step 3: Install Hermes Agent

Use the official installer from Nous Research:

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

When it finishes, reload your shell so the hermes command is found:

source ~/.bashrc

Alternatively, Ollama can install and configure Hermes for you in one step:

ollama launch hermes

That command offers to install Hermes if it is missing, lets you pick a model, and points Hermes at your local Ollama. If you use it, skip to Step 5, and check afterwards that the context length matches what you set there.

Step 4: Point Hermes at your local Ollama server

Hermes needs to know where to send requests.

Option A: interactive setup

hermes setup
# or, to change the model later
hermes model

Choose Custom endpoint (under More providers), then enter:

Option B: edit the config file

Edit ~/.hermes/config.yaml:

model:
  default: "qwen3:4b"
  provider: "custom"
  base_url: "http://127.0.0.1:11434/v1"
  context_length: 64000

Step 5: Tune for 8 GB of RAM and a CPU

Raise Ollama's context window to 64,000 tokens

The context window cannot be set through the OpenAI-compatible API that Hermes uses, so set it on the server. Create a systemd override:

sudo systemctl edit ollama.service

Add these lines, then save and exit:

[Service]
Environment="OLLAMA_CONTEXT_LENGTH=64000"
Environment="OLLAMA_KEEP_ALIVE=24h"
Environment="OLLAMA_FLASH_ATTENTION=1"
Environment="OLLAMA_KV_CACHE_TYPE=q4_0"
Environment="OLLAMA_MAX_LOADED_MODELS=1"

Then reload and restart the service:

sudo systemctl daemon-reload
sudo systemctl restart ollama

What each line does:

Why the cache setting matters. By our estimate from the published architecture of qwen3:4b, a 64,000-token cache at the default f16 needs roughly 9 GB, which will not fit beside the 2.5 GB model. At q8_0 it is roughly 4.5 GB, and at q4_0 roughly 2.3 GB. That is why this guide uses q4_0. After the service restarts and you have sent a message, run ollama ps and free -h to see the real memory use. If the server starts swapping, use a smaller model or a larger server.

Raise the Hermes timeout

Slow CPU responses should not fail. Create or edit ~/.hermes/.env:

HERMES_API_TIMEOUT=1800

Hermes already treats local endpoints generously, but setting this explicitly is harmless.

Step 6: Start Hermes and test

hermes

Begin with a simple chat. Then try a light tool-oriented task, such as asking it to list the files in the current directory or summarize a short text file. The first reply can be very slow, because Hermes sends its system prompt and tool list with every request and a CPU has to process them before it answers.

Important expectations

  • Full agent features (reliable file editing, terminal commands, complex tool chains) depend on the model supporting structured tool calling. Many of the smallest models do this only weakly or not at all. qwen3:4b is generally the better of the options listed here.
  • Responses will be slower than cloud APIs. This is normal on a CPU.
  • You can switch models inside a session with the /model command if you pulled more than one, but remember that only one fits in memory at a time.

Optional: messaging gateway

Hermes can also expose itself through Telegram, Discord, Slack and similar platforms while still using your local model. To set it up, run:

hermes gateway setup

Then chat with the agent from your phone. The inference still happens on the VPS.

Troubleshooting tips

Final notes

This setup gives you a fully local, zero-subscription agent. It will not match a large cloud model on hard multi-step tool use, but for everyday questions, drafting, research and lighter automation it is capable and completely private.

Start with qwen3:4b, get a working chat session, then experiment with tools. You can add a second model later, or pair it with a free cloud tier for the occasional heavy task.

Sources

Commands and model details were checked against these pages on October 16, 2026. Model sizes and tool support change often, so check them again before you build.

Get the Coldforge newsletter

Plain-language updates on AI agents for business. No jargon, no hype, no spam. Unsubscribe any time.

We use your email for the newsletter only. See our privacy page.