← All posts

LLM + Local AI· April 21, 2026

The Sovereign AI Stack: Running Ollama and OpenClaw over Tailscale

A step-by-step technical breakdown of how I turned a Mac mini M4 Pro into a secure, local-first AI brain that monitors my business from anywhere.

Cloud AI is a privacy liability. I wanted a local-first brain that could monitor my business from anywhere, so I turned my Mac mini (M4 Pro, 64GB RAM) into a Sovereign AI Stack.

The Architecture

The Engine — Ollama (port 11434)

I originally ran llama3.1:8b, but it was eating ~11.8GB RAM and causing system hangs. Swapped to qwen2.5:7b-instruct (later qwen3-coder:30b to fix tool-calling loops). Smaller, instruct-tuned, ~746ms inference times.

The Gateway — OpenClaw (port 18789)

The API wrapper that gives the LLM agency. It uses skills like himalaya for email and native system commands. I built custom state-tracking logic in a HEARTBEAT.md file to keep the agent from looping into repetitive cycles.

The Mesh — Tailscale

To access the stack remotely without opening ports, I use Tailscale in userspace-networking mode on macOS—no root required. I configured a custom launchd service to bind the socket to ~/.local/share/tailscale/tailscaled.socket.

The Result

A secure, air-gapped-capable AI agent accessible via 100.81.136.53 from anywhere on the planet. Sovereign tech. No subscriptions. No data leaving the machine.

← Back to index
The Sovereign AI Stack: Running Ollama and OpenClaw over Tailscale · A Hidden Empire