I’ve spent the better part of this year building a home AI setup that I actually use every day, and it has gone through more rebuilds than I’d like to admit. The current version has finally stopped changing every weekend, so here’s how it works and why I built it this way.
The short version: one Open WebUI container is the front door, a Cloudflare tunnel with Google sign-in lets me reach it from anywhere, and behind it is a stack of local and cloud models that I can swap in and out without anyone downstream noticing.
Why Not Just Pay for ChatGPT?
In theory a commercial chat subscription does everything most people need. In reality you’re locked into one vendor’s models, one vendor’s tools, and one vendor’s idea of how you’re supposed to use them. You’re also stuck with their guardrails, which tend to get twitchy around exactly the cybersecurity tasks I need help with, and you rarely get to see the raw data behind the answers.
The bigger problem is the data. Every message, every web search, every document I hand the AI goes to a third party. They say they don’t keep it and they delete the logs. I don’t take that on faith. Recent research shows AI vendors aren’t doing a good job of keeping prompt data private, and even when their intentions are good, that’s an awful lot of trust to hand someone else.
My day job is cybersecurity and compliance consulting, which means a lot of what I touch is sensitive client data that can’t leave the house. And even for my personal stuff, I don’t want my whole life in the hands of one more vendor — especially a young AI startup with no real track record.
So the design goal was simple. Keep the documents on hardware I own, and make the model behind the chat window a swappable part.
Open WebUI: The Center of Everything
Open WebUI is a self-hosted chat interface that looks and feels a lot like the commercial products. The difference is that it doesn’t care who’s on the other end of the wire. Anything that speaks the OpenAI API (or Ollama’s API) can be plugged in as a connection, and you can have as many of them as you want at the same time.
Here’s roughly how I launch it. Every secret in this post is a placeholder — fill in your own.
#!/usr/bin/env bash
# chat.sh - (re)deploy Open WebUI
docker kill chat 2>/dev/null; docker rm chat 2>/dev/null
docker pull ghcr.io/open-webui/open-webui:latest
docker run -d \
--name chat \
--restart always \
-p 127.0.0.1:8080:8080 \
-v open-webui:/app/backend/data \
-e WEBUI_SECRET_KEY="$(cat ~/.secrets/webui_secret)" \
-e GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com" \
-e GOOGLE_CLIENT_SECRET="$(cat ~/.secrets/google_oauth_secret)" \
-e ENABLE_OAUTH_SIGNUP=true \
ghcr.io/open-webui/open-webui:latest
Two things worth pointing out.
The open-webui volume is where everything lives: chat history, uploaded documents, the vector database for retrieval, user accounts and settings. That volume never leaves my house. Back it up and you’ve backed up the whole thing.
The port is bound to 127.0.0.1 rather than 0.0.0.0, so nothing on the internet (or even the rest of my LAN) can talk to this container directly. That’s the tunnel’s job.
Tools, Search, and Agentic Workflows
Chat is the boring part. The interesting part is what the model can do.
Open WebUI supports MCP servers and OpenAPI tool servers as first-class connections, and that’s where most of my time has gone. I’ve got MCP servers running on the same box for my calendars, my RSS reader, weather, flight tracking, email, and my budget. When I ask “what’s on my calendar tomorrow and is the weather going to mess with that flight?” the model goes and looks it up instead of guessing.
Web search runs through a local SearXNG instance, so search queries don’t get tied to an account either. The helper services bind to the box’s LAN address (LAN_IP below) rather than localhost, because Open WebUI reaches them from inside its own container:
docker run -d --name searxng \
-p "$LAN_IP":8888:8080 \
-v searxng-config:/etc/searxng/ \
-v searxng-cache:/var/cache/searxng/ \
docker.io/searxng/searxng:latest
Point Open WebUI at it under Admin Settings → Web Search with the URL http://<host>:8888/search?q=<query>.
And for the truly agentic stuff, I run an Open Terminal container. This gives the model a sandboxed shell with its own home directory, so it can write and run a script, poke at a file, or chain a few commands together to answer a question. Each one gets its own volume and its own API key:
docker run -d \
--name chat-terminal-a \
--restart unless-stopped \
-p "$LAN_IP":8000:8000 \
-v chat-terminal-a:/home/user \
-e OPEN_TERMINAL_API_KEY="$(uuidgen)" \
ghcr.io/open-webui/open-terminal
The sandbox is a container, not my host. If the model does something dumb in there (and it has), I delete the volume and move on.
One lesson learned the hard way: tool definitions are not free. At one point I had over 200 tools enabled, and their descriptions were eating about 58,000 tokens of every request before I’d typed a word. One to-do app integration alone was 18,000 of those. Turn on what you need for the conversation and leave the rest off.
Keeping Documents Local
When you upload a PDF to Open WebUI, it’s chunked, embedded and stored in the local volume. Retrieval happens on the box. The only thing that ever leaves is whatever text gets stuffed into the prompt for the model you’ve chosen.
Which means the real privacy question is “which model is answering?” If it’s one of my local models, the document never leaves the house at all. If it’s a cloud model, only the relevant chunks go out, and only because I picked that model for that chat.
One gotcha worth knowing about. Open WebUI uses a “task model” behind the scenes to generate retrieval queries, titles and tags, and it will happily run that on a different model than the one you’re chatting with. I spent an embarrassing amount of time chasing 30 to 80 second delays on every message with an attachment before figuring out it was generating retrieval queries on my slowest machine. Turning off Retrieval Query Generation in the document settings fixed it immediately.
Getting In From Anywhere: Cloudflare Tunnel and Google SSO
I don’t open ports on my home firewall. Ever.
Instead, a Cloudflare tunnel runs as a container on the same box. It makes an outbound connection to Cloudflare, and Cloudflare routes requests for my chat hostname back down that connection. There’s no inbound port, no dynamic DNS, and no certificate to renew on my end.
The setup is one container:
#!/usr/bin/env bash
# cloudflared.sh - tunnel for the chat UI
docker kill cloudflared-chat 2>/dev/null; docker rm cloudflared-chat 2>/dev/null
docker pull cloudflare/cloudflared:latest
docker run -d \
--name cloudflared-chat \
--restart unless-stopped \
--network host \
cloudflare/cloudflared:latest \
tunnel --no-autoupdate run --token "$(cat ~/.secrets/cf_tunnel_chat)"
You get the token when you create the tunnel in the Cloudflare Zero Trust dashboard (Networks → Tunnels → Create a tunnel → Cloudflared). Then add a public hostname, something like chat.example.com, pointed at http://localhost:8080.
I run one tunnel per service rather than one big tunnel with lots of routes. It’s a little more to manage, but if I need to kill access to one thing, I stop one container and nothing else notices.
Putting Google in Front of It
A tunnel alone just makes the app reachable. The second half is Cloudflare Access, which puts a login page in front of the hostname before any traffic reaches my network.
The recipe:
- In Zero Trust, go to Settings → Authentication and add Google as a login method. You’ll need an OAuth client ID and secret from the Google Cloud console, with
https://<your-team>.cloudflareaccess.com/cdn-cgi/access/callbackas the redirect URI. - Under Access → Applications, add a Self-hosted application for
chat.example.com. - Give it a policy with action Allow and an Emails include rule listing exactly the Google accounts that should get in.
Somebody who isn’t on that list never sees Open WebUI’s login page at all. They get Cloudflare’s, and it says no.
Then Open WebUI does its own Google sign-in on top (that’s the GOOGLE_CLIENT_ID and ENABLE_OAUTH_SIGNUP in the launch script). So it’s two layers, and since both are the same Google account, it costs me one extra click and no extra passwords. You can collapse it to a single login by having Open WebUI trust the identity header Cloudflare passes along, but I like having the app enforce its own accounts in case I ever fat-finger the Access policy.
The Flexibility Payoff
Here’s why this setup is worth the effort.
Open WebUI’s Admin Settings → Connections page takes any number of OpenAI-compatible endpoints. I can have a local model, Anthropic, OpenAI, and anything else that shows up next month all listed side by side. Every chat gets a model dropdown. If a new model comes out on a Tuesday, I can have it in the dropdown by Tuesday afternoon, and all my tools, documents and history come along for the ride.
That’s where the real lock-in lives with the commercial tools. Not in the model, but in the history, documents and tools you’ve piled up around it. Here, all of that sits in my volume, and the model is just a URL.
The Local Hardware
Now for the part I’m proudest of, because none of it was bought for this.

Strata on an Old Gaming PC
My primary model runs on a gaming desktop I built years ago. It’s an Intel Core i7-10700K with 64 GB of DDR4, an RTX 5060 Ti 16 GB that I added later, and the old RTX 2060 6 GB still in the second slot. The board only gives the 5060 Ti a PCIe Gen3 x8 link, which is a little like putting a race engine in a minivan. It still gets the job done, and when I have some spare cash, a more modern motherboard is first on the list.
The inference server on that machine is called Strata. It’s an OpenAI-compatible server in the llama.cpp family, and right now it’s serving a quantized Qwen 3.8 model with a 262,000-token context window.
The numbers from my last benchmark run: about 58 tokens per second when it’s writing, about 1,330 tokens per second when it’s reading a 64,000-token prompt, and around 30 seconds to load the model cold. It aced every test in my benchmark suite, including finding needles in a 64k-token haystack, and a cloud model acting as judge scored its long-form answers 8.5 out of 10.
It also reuses the prompt cache between turns, which is the thing that makes agents tolerable on local hardware. A follow-up to a 20,000-token conversation comes back in under a second instead of 17.
That’s a pretty good return on a machine that was otherwise collecting dust.
A 2021 MacBook Pro on a Shelf
The backup is a 16-inch MacBook Pro from 2021 with an M1 Max and 64 GB of unified memory. It lives on a shelf, plugged in, lid closed, running Ollama.
Apple Silicon is slow at reading long prompts compared to a real GPU. But 64 GB of memory the GPU can use directly means it can load models that won’t fit on a 16 GB card at all. Its current model writes about 23 tokens per second, and it also passed every test in my suite. That’s well under half of Strata’s speed on output, and roughly a sixth of it on long prompts.
So it’s not the machine I want answering. It’s the machine I want answering when the other one is down for an update. Which happens more than you’d think.
Switchboard: The Failover Router
Here’s the problem with two local machines and a cloud API. Every app that uses AI needs to know about all three, decide which is up, and handle failing over between them. I had that logic copy-pasted into four different apps, with four slightly different bugs.
So I built Switchboard, a small open-source gateway that hides the whole chain behind one model name. Clients talk to it with the OpenAI or Anthropic API and ask for a single model. Switchboard tries each backend in order until one answers:
- Strata on the gaming PC
- The MacBook on the shelf
- Claude Haiku in the cloud, with a hard $5-per-day spending cap
The config is one YAML file, and it reloads live when you edit it:
clients:
- name: open-webui
key: ${SWITCHBOARD_OPENWEBUI_KEY}
- name: news-agent
key: ${SWITCHBOARD_NEWS_KEY}
routes:
- name: home # the one model name clients see
context_tokens: auto
blocks:
- id: gaming-pc
provider: openai
base_url: http://gaming-pc.lan:11435/v1
api_key: ${STRATA_KEY}
model: qwen3.8-flash-next-iq3_s
timeouts: {connect: 3, first_token: 300, idle: 120, total: 3600}
cooldown: {after_failures: 2, seconds: 30, probe: true}
- id: macbook
provider: openai
base_url: http://macbook.lan:11434/v1
model: inkling-2-mini:latest
context_fallback: 262144
timeouts: {connect: 3, first_token: 360, idle: 180, total: 3600}
- id: claude-haiku
provider: anthropic
base_url: https://api.anthropic.com
api_key: ${ANTHROPIC_API_KEY}
model: claude-haiku-5-5
default_max_tokens: 16000
drop_params: [temperature, top_p, top_k]
pricing: # USD per million tokens; the cap needs this
input_per_mtok: 0.10 # use the provider's current rates
output_per_mtok: 0.50
spend_cap_usd_per_day: 5.00 # skipped for the rest of the day once hit
It fails over on the things that mean “this backend is broken” (connection refused, timeouts, 5xx errors, rate limits, a prompt too big for that model’s context window) and passes everything else straight back to the client. It figures out each backend’s context window on its own and advertises the smallest one in the chain, so clients don’t send something only the cloud model could handle. There’s a live inspector page for watching requests flow through, which has saved me hours of guessing.
Deploying it is a locked-down container:
docker run -d \
--name switchboard \
-p "$LAN_IP":5034:8000 \
-v "$PWD/switchboard/config:/config:ro" \
-v switchboard_state:/state \
--read-only --tmpfs /tmp \
--cap-drop ALL --security-opt no-new-privileges:true \
--restart unless-stopped \
switchboard:latest
And then in Open WebUI it’s just one more connection: base URL http://<host>:5034/v1, the client key, done. A “home” model shows up in the dropdown, and I stop caring which machine is actually answering.
I’ll admit I was tempted to make it smarter. Queueing, session stickiness, fixing up malformed tool calls from models that get confused. Every time, I talked myself out of it. A router that just routes is a router I can debug at 3 AM.
What I’ve Built on Top of It
With one stable endpoint to point at, building AI tools got a lot easier. Everything below talks to Switchboard and nothing else, and most of it runs on the local models for free.
- NewsBrief runs a team of agents at 3 AM that read my RSS feeds by section, summarize them, drop the duplicate stories, and email me one briefing before I wake up.
- DawnPatrol is a threat-hunting pipeline for my home network. It reviews the overnight security telemetry and only emails me when it finds something high or critical.
- PatchPatrol scans every container image on the box for known vulnerabilities each night and feeds a short patch queue into the morning briefing.
- PennyPatrol handles household finances. It categorizes transactions, tracks budgets, and sends a weekly report. Exactly the sort of data I’d never hand to a cloud chatbot.
- PromiseMap reads contracts and pulls out the obligations hidden in them (deadlines, notice periods, deliverables) so nothing slips.
- BenchPatrol benchmarks any model endpoint for speed and quality, which is where all the numbers in this post came from.
- A handful of MCP servers for calendars, RSS, weather, flight tracking and email, so the model in Open WebUI can look things up instead of making them up.
Where It Landed
The whole thing runs on hardware I already owned, costs me at most $5 a day when everything local is down (usually it’s nothing), and keeps my documents in my house. If a better model comes out tomorrow, I change one line of YAML and every tool I’ve built picks it up.
That’s the setup. For now. The AI space is continuing to evolve rapidly, and as new stuff comes online I’m certain that I’ll be adapting it for my own use and adjusting my configuration accordingly. In the meantime, hopefully this writeup can help others figure out how to do this themselves in their own homes and avoid some of the headaches that I found along the way.
