ProLucius lion mascotProLucius
← All posts
building-alfred.md

From the ProLucius desk

Building Alfred: From Local LLMs to a Local AI Environment

10 min read

Hermes logo

The original idea: build an intelligent assistant that lived inside my own infrastructure, understood my systems, remembered useful context, and could actually do things instead of just talking about them.

That was the vision I had for Alfred.

The reality, however, was a little different.

Alfred proved to be an absolute nightmare to set up.

The original idea was simple enough: I wanted a truly intelligent assistant that could help me manage the overwhelming number of things I want to do, keep track of what I should be doing, and maybe bring some structure to the chaos by helping me schedule everything.

Naturally, I found myself leaning heavily toward artificial intelligence.

My overall views on AI haven't changed much — that's a topic I'll cover properly at a later date — but working closely with Large Language Models has definitely changed how I look at them.

To put it simply:

Sometimes they are unbelievably dumb.
Five minutes later, they can be complete lifesavers.

They can misunderstand the simplest instruction, confidently invent something that doesn't exist, forget what you were talking about, or take a perfectly straightforward task and somehow turn it into a philosophical debate.

But when everything lines up properly, they can also save an incredible amount of time.

The important lesson I learned while building Alfred is that an LLM is not really an autonomous assistant by itself.

It still needs:

  • Direction
  • Context
  • Tools
  • Memory
  • An environment designed around it

That realization became the foundation of Alfred.

I wasn't trying to build another chatbot.

I wanted to build a system.

A local assistant that could understand what I was asking, interact with the services I already use, remember useful information, perform actions, and eventually become something that felt less like opening ChatGPT and more like having an actual digital assistant living inside my infrastructure.

And because I apparently enjoy making simple projects unnecessarily complicated, I initially decided that the intelligence behind Alfred should also run locally.

That is where the real nightmare began.


Enter Hermes

hermes on alfred.png

The first major piece of Alfred became Hermes Agent.

Hermes was much closer to what I had imagined than simply running an LLM through a chat interface.

Instead of just sending text to a model and getting text back, Hermes gave the model an actual environment to operate in.

It could:

  • Work with files
  • Use the terminal
  • Search the web
  • Interact with tools
  • Maintain memory
  • Create and use skills
  • Perform multi-step tasks

In other words, Hermes wasn't really the intelligence itself.

The model was the brain. Hermes was the hands. Alfred was the system around both.

That distinction ended up becoming much more important than I expected.


The Local Model Phase

Naturally, once I had Hermes running, the next question was:

What model should Alfred use?

And because Alfred was supposed to be local, the obvious answer seemed to be a local model.

So I went down the usual rabbit hole.

Ollama. Hermes models. Qwen. Mistral. DeepSeek. Gemma.

Then came:

  • Different parameter counts
  • Different quantizations
  • Different context windows
  • Different amounts of VRAM
  • Different prompt formats
  • Different levels of tool-calling reliability

And an unreasonable amount of time spent reading benchmarks as if choosing the correct .gguf file would somehow unlock artificial general intelligence in my living room.

The local model rabbit hole

At first, it was genuinely exciting.

There is something very satisfying about running an LLM entirely on your own hardware.

You can disconnect the internet and it still works.

Your requests stay on your network.

You control the hardware.

You control the model.

You control the API.

And when you first see a model respond at a reasonable speed from a machine sitting in your house, it feels a little bit like magic.

The problem starts when you stop asking it simple questions.

Alfred wasn't supposed to just answer:

"What is the capital of France?"

I wanted Alfred to actually do things.

That meant Hermes had to give the model a large system prompt, tool descriptions, memories, files, command output, and the history of whatever task it was working on.

Suddenly the model wasn't dealing with a clean question anymore.

It was dealing with an environment.

And that is where a lot of local models started to fall apart.

A model might sound extremely intelligent in normal conversation and then completely lose the plot halfway through a tool call.

It might:

  • Call the wrong tool
  • Invent arguments
  • Ignore part of the system prompt
  • Lose important context
  • Get halfway through a task and decide it had finished

Or, my personal favorite:

Confidently tell me that something had been successfully completed when absolutely nothing had happened.

The smaller models were particularly vulnerable to this.

They were impressive for their size, but I was asking them to do a job that was much larger than simply generating text.


More Hardware Wasn't the Answer

For a while, my response to this problem was essentially:

"Maybe Alfred just needs more GPUs."

This led to experimenting with distributing local inference across multiple machines.

At one point, Alfred was using local Ollama instances over the LAN, and I experimented with NVIDIA's PAIR to route model requests across different systems.

Technically, it worked.

And from an infrastructure perspective, it was actually quite interesting.

Hermes could live on one machine while the LLM lived somewhere else.

The assistant itself didn't need the GPU.

Inference could happen on another computer entirely, as long as Alfred could reach it over the network.

The old architecture

flowchart LR
    U[Me] --> A[Alfred / Hermes]
    A --> P[PAIR]
    P --> G1[GPU Machine 1]
    P --> G2[GPU Machine 2]
    G1 --> O1[Ollama / Local Model]
    G2 --> O2[Ollama / Local Model]

That separation taught me something useful about Alfred's architecture.

But it also created another problem.

I was building an increasingly complicated AI cluster to avoid paying for an AI subscription.

There were multiple machines.

Multiple models.

Routing.

GPU memory constraints.

Context limits.

Model loading times.

Quantization choices.

Performance differences between machines.

And yet, after all that work, I could open Claude or Codex and get a substantially better result almost immediately.

That was the point where the project needed a reality check.


The Local Model Was Never the Important Part

Eventually I had to admit that my local models were not going to outperform the frontier models.

Especially when it came to complex agentic tasks and coding.

I could spend an evening testing models and tweaking parameters.

Or I could give the same problem to Codex.

And Codex would usually understand the task faster, reason about it better, make fewer mistakes, and require far less babysitting.

There is absolutely a place for local models.

They are useful.

They are interesting.

And the rate at which they are improving is ridiculous.

But for Alfred, they had become a distraction.

I was optimizing the wrong part of the system.

The goal wasn't:

Build the smartest possible model inside my house.

The goal was:

Build a useful assistant that lives inside my house.

Those are not the same thing.

Once I realized that, the architecture became dramatically simpler.


Hermes + Codex

Hermes with Codex

The current version of Alfred doesn't use a local LLM at all.

It also no longer uses PAIR.

Instead:

Alfred runs Hermes locally on my LAN, while Codex provides the intelligence behind it.

And strangely enough, this hybrid setup feels much closer to the original vision than the fully local version ever did.

Hermes still lives inside my network.

Hermes still has access to the tools and systems I decide to expose to Alfred.

Hermes still handles the agent environment.

It can work with local files.

It can execute commands.

It can interact with my infrastructure.

It can maintain Alfred's memory and skills.

It can serve as the bridge between an LLM and everything I actually want Alfred to control.

The difference is that I stopped insisting that the brain also had to live in my house.

Codex handles the difficult reasoning.

Hermes handles the environment.

That division makes far more sense.

The current architecture

flowchart LR
    U[Me] --> A[Alfred]
    A --> H[Hermes Agent]
    H --> C[Codex]
    H --> F[Local Files]
    H --> T[Terminal / Scripts]
    H --> S[Self-hosted Services]
    H --> M[Memory & Skills]

This is much closer to what Alfred was supposed to be from the beginning.

Not a local model.

A local agent environment.


Why Run Hermes Locally Then?

This was the question I eventually had to answer.

If I'm already using Codex, why bother running Alfred locally at all?

Why not just use Codex directly?

Because Codex and Alfred solve two different problems.

Codex Alfred / Hermes
Provides intelligence and reasoning Lives inside my LAN
Can understand a Docker problem Can inspect the Docker host
Can write a shell command Can run the shell command
Can reason about a config file Can read the real config file
Can explain how to restart a service Can eventually restart the service
Knows how things should work Can interact with how my systems actually work

That difference is enormous.

The useful part of Alfred was never really the language model.

It was the fact that there was an agent permanently sitting inside my LAN with controlled access to the things I care about.

That agent can become a common interface to everything else.

Instead of individually building integrations between myself and every service on my network, I can gradually teach Alfred how those systems work.

Give Hermes a skill for one service.

Give it another skill for something else.

Expose an API.

Add documentation.

Add a script.

Add permissions.

Over time, Alfred becomes more capable without necessarily changing the model behind it.

And that is probably the biggest lesson I've learned from this entire project.


The Model Is Replaceable

Originally, I treated the model as the core of Alfred.

Now I see it as one component.

An extremely important component, obviously.

But still replaceable.

Today, Alfred uses Codex.

Tomorrow, maybe something else is better.

Maybe local models eventually become good enough that I move parts of Alfred back onto my own hardware.

Maybe I use different models for different tasks.

None of that should require rebuilding Alfred.

Hermes is what allows that separation.

The intelligence can change.
The infrastructure remains.
The tools remain.
The memory remains.
The skills remain.
Alfred remains.

Trying to predict which model will be the best model six months from now is probably pointless.

The models are changing too quickly.

Building an environment that can make use of whichever model happens to be best?

That feels much more useful.


So What Is Alfred Now?

At this point, Alfred is no longer my attempt to build a local LLM.

It is my attempt to build a local AI environment.

The distinction sounds small, but it completely changed the direction of the project.

The intelligence doesn't have to be local.
The assistant does.

Hermes sits on my network and provides the tools, memory, skills, and access that turn a language model into something actually useful to me.

Codex currently provides the reasoning behind it.

And Alfred is the identity I'm building around the whole thing.

Eventually, I want Alfred to be able to:

  • Look across my infrastructure
  • Understand the systems I've given it access to
  • Help manage projects
  • Keep track of things I've forgotten about
  • Automate repetitive work
  • Reduce the mental overhead of maintaining everything I insist on running

Whether the tokens that make those decisions are generated three meters away from me or three thousand kilometers away has become considerably less important.

What matters is what Alfred can actually do.

And perhaps ironically, giving up on the requirement for everything to be local is what finally made the local part of Alfred genuinely useful.


Where Alfred Goes Next

The foundation is finally starting to make sense.

The next stage is less about chasing models and more about making Alfred useful inside the environment it already has.

That means better skills.

Better memory.

Better access controls.

More integrations.

And, eventually, giving Alfred enough understanding of my infrastructure that I can stop thinking about which machine runs which service and simply ask for what I want.

That is the version of Alfred I actually wanted to build.

It just took me a rather long detour through local LLMs, GPU routing, quantization, context windows, and several questionable infrastructure decisions to figure that out.


Suggested Images for This Post

For the finished article, I'd use 4–6 images rather than putting a screenshot after every section.

  1. Hero image — Hermes logo or Alfred branding

    • hermes-logo.png
  2. Hermes running locally

    • images/hermes-on-alfred.png
    • Terminal/UI showing Hermes running on the Alfred host.
  3. The local-model rabbit hole

    • images/local-model-rabbit-hole.png
    • Ollama model list, model directory, or a collage of models you tested.
  4. Old local architecture

    • Use the Mermaid diagram above, or export it as images/old-alfred-architecture.png.
  5. Hermes + Codex

    • images/hermes-codex.png
    • A clean screenshot showing the current configuration without exposing secrets.
  6. Current Alfred architecture

    • Use the Mermaid diagram above, or export it as images/current-alfred-architecture.png.

Tip: Your own screenshots will make this post much stronger than generic AI artwork. Blur hostnames, IPs, tokens, API keys, usernames, and anything else you don't want publicly exposed before publishing.