Why Run an AI Agent Locally?

Cloud AI is convenient, but there are real reasons to run your own: data stays on your machine, no API costs once you're set up, lower latency, and full control over the model and its behavior. Nous Research's Hermes series is one of the better open-source options for agentic tasks — it follows instructions reliably, handles structured output well, and works with most local inference runtimes.

This guide walks through getting Hermes running locally, then using it as an agent you can actually put to work.

What You Need

  • A machine with at least 8 GB RAM (16 GB is more comfortable)
  • macOS, Linux, or Windows with WSL2
  • About 5–8 GB of free disk space for the model weights
  • A GPU helps but is not required — CPU inference is slower but works fine for most tasks

Step 1: Install Ollama

Ollama is the simplest way to pull and run open-source models locally. One command installs it:

# macOS and Linux
curl -fsSL https://ollama.ai/install.sh | sh

# Windows — download the installer from ollama.ai

After installation, confirm it's running:

ollama --version

Step 2: Pull the Hermes Model

Nous Hermes 3 is fine-tuned on Llama 3 with a strong focus on instruction following and tool use. Pick a size that fits your hardware:

# 8B — runs on 8 GB RAM, good balance of speed and quality
ollama pull nous-hermes3:8b

# 70B — needs 40 GB+ RAM, considerably better reasoning
ollama pull nous-hermes3:70b

Start with 8B. It's fast enough to iterate on, and you can move up once you know what you're building.

Step 3: Test the Model

ollama run nous-hermes3:8b

You'll get an interactive prompt. Try something that tests structured reasoning:

>>> You are an AI agent. A user wants to book a meeting.
List the steps you'd take using tools called check_calendar(date) and book_slot(date, title).

If you get back a coherent set of steps with plausible tool calls, the model is working as expected.

Step 4: Hit the Local API

Ollama exposes the model on port 11434 using an API format compatible with OpenAI's. That means any Python or JavaScript code written for ChatGPT can be pointed straight at your local Hermes instance:

import openai

client = openai.OpenAI(
    base_url="http://localhost:11434/v1",
    api_key="ollama"  # any non-empty string
)

response = client.chat.completions.create(
    model="nous-hermes3:8b",
    messages=[
        {"role": "system", "content": "You are a helpful AI assistant."},
        {"role": "user", "content": "Summarize the following in three bullet points: ..."}
    ]
)

print(response.choices[0].message.content)

Step 5: Build a Simple Agent Loop

An agent loop keeps feeding the model's outputs back as context until a task is marked done. Here's a minimal working version:

import openai

client = openai.OpenAI(
    base_url="http://localhost:11434/v1",
    api_key="ollama"
)

def run_agent(task):
    messages = [
        {
            "role": "system",
            "content": (
                "You are a task-solving agent. Work through the problem step by step. "
                "When the task is fully complete, end your response with the word DONE."
            )
        },
        {"role": "user", "content": task}
    ]

    for step in range(10):  # cap at 10 steps
        response = client.chat.completions.create(
            model="nous-hermes3:8b",
            messages=messages
        )
        reply = response.choices[0].message.content
        print(f"Step {step + 1}:
{reply}
")
        messages.append({"role": "assistant", "content": reply})

        if "DONE" in reply:
            print("Task complete.")
            break

run_agent("Write a Python function that reads a CSV file and returns the column averages.")

Where Hermes Actually Works Well

A few agentic use cases that make sense for small teams:

  • Document processing — summarise contracts, invoices, and reports without sending anything to a third-party API
  • Support ticket triage — classify and route incoming queries automatically, running on your own server
  • Code review in CI — run a local model in your pipeline, no token costs or rate limits
  • Internal knowledge Q&A — index your own documentation and answer questions privately

A Few Tips

Start with the 8B model. It's fast enough to iterate on your prompts. Move to 70B once you know what you're building and need better reasoning.

  • Hermes responds better to explicit system prompts — be specific about the agent's role and constraints
  • The model handles JSON output well if you ask for it directly in the prompt ("respond only with valid JSON")
  • For document tasks, chunk large texts rather than trying to fit everything into a single prompt
  • Temperature 0.1–0.3 works better for agent tasks where you want consistent, predictable responses

Final Thoughts

Running Hermes locally costs nothing after the initial setup, keeps your data off external servers, and is more capable than most people expect. The 8B model on a modern laptop handles simple agent tasks in a few seconds per step — fast enough to be genuinely useful in production workflows.

We've been using local models internally at App4life for document processing tasks and it's worked well enough that we stopped reaching for cloud APIs for anything privacy-sensitive. If you're building something similar for your business and want to talk through the setup, get in touch.