How to Run AI Locally in 2026 (Full Beginner Guide)
45 min: run AI models locally, pick models, his Mac Mini command center, use Claude Code to set it up. Real but off-niche.
Tools featured in this playbook
This article was originally posted on YouTube
Closed-source AI can change in the snap of a finger: access gets pulled, quality changes, prices go up. Open-weight models are not on par with the bleeding edge, but for many day-to-day use cases they are becoming more than good enough. So it's worth having the "insurance policy" of knowing how to run them.
The twist in this guide: I use closed-source tools like Claude Code and Codex to set up, build and bug-fix the open-source setup. You get the best of both worlds.
Why run AI locally
Vendor risk: a model can be pulled or come back weaker.
The bill: $100 to $200 plans are heavily subsidized. That won't last.
Privacy: I had my DNA analyzed by local models that sent nothing anywhere, then used closed-source models on the synthesis.
Ambient agents: agents that run 24/7 on dirty work (security checks, app health, RAG on your files) for the price of electricity instead of API costs.
If you tried Ollama two years ago and were underwhelmed, you were right. The models were toys. Today's models are better, and you can attach them to harnesses.
The 5 layers to understand
Hardware: your Windows laptop, Mac, Mac Mini or Mac Studio. It decides which models you can run and how fast (tokens per second).
Models: open-weight models (Qwen, GLM, Kimi, Gemma and others), where the weights are public.
Inference engine: usually llama.cpp, the bridge that runs your prompt through the model. vLLM is the alternative for team scale, when many people hit the same model at once.
Gateway: typically LiteLLM. It gives you an OpenAI-compatible API, so every app talks to whatever model you want. Swapping models is like swapping one cable.
Interface: Open WebUI, which looks and feels like ChatGPT or Claude.
On top, a harness gives the model "limbs": reading and writing files, running bash, calling tools. That is why people love Claude Code and Codex. It's the model plus its limbs.
Step 1: find the models your hardware can run
In a terminal with Claude Code, I prompt:
"Can we use the OpenRouter API to pull the latest open-source models of the past 6 months? Categorize them into text-only versus multimodal." OpenRouter is one platform to reach any model, with rankings and a public API.
"Go through my current operating system specs and tell me which models I'm eligible to run, if I want a model that is really good at text but can also understand images. Make sure it doesn't run slow on this computer."
Claude reads your chip, memory and storage, and gives a shortlist plus the models that are too big. Keep in mind you can't use all your RAM for models, because other apps need some too.
Step 2: download and serve the model
Ask Claude to download the recommended model. It checks Hugging Face, the app store for models (original, quantized and fine-tuned versions).
Check you have the disk space. Mine was about 65 to 70 GB.
Claude installs what's missing (Ollama, Homebrew), fixes things like the Python version, and reports the tokens per second and memory use. Try not to exceed 50% of your memory.
Chat with it in LM Studio or Ollama. Both are wrappers around llama.cpp. Mine ran at 60 tokens per second.
I do the same on my Mac Mini over SSH.
Step 3: reach it from anywhere with Tailscale
Tailscale is a private encrypted network that connects your devices as if they were in the same room, without port forwarding. The personal plan is free. I send a chat from my phone, the Mac Mini runs the inference and the answer travels back encrypted.
Step 4: try before you download
Use OpenRouter to test models on your own tasks first. I gave Claude Code the "Claude Code integration" page from the OpenRouter docs and asked for a plan to use the OpenRouter API natively. It created shortcut commands that open Claude Code's harness with Kimi or GLM as the model. The open model then gets plan mode, sub-agents and all the tools.
A good split: closed source for detailed planning, bug review and testing. A workhorse like GLM for admin tasks such as renaming files or searching.
My favorites: Qwen and MiniMax for agentic coding, GLM as a workhorse. Gemma is decent but sometimes oddly restrictive. MiniMax also has interesting voice cloning.
Key terms in plain English
Parameters (14B, 70B): a proxy for how capable the model is. Rule of thumb: divide the parameter count by about two to get the GB of memory you need. A 70B model needs roughly 35 to 40 GB. A 14B needs 5 to 7.
Quantization (16-bit, 8-bit, 4-bit): compression, like video resolution. At 1-bit and below, the model loses too much. Find the smallest quantization of the smallest model that still passes your tests.
GGUF: the universal format. It works with llama.cpp, so with Ollama and LM Studio.
MLX: the Apple-native format, optimized for Apple Silicon. Only relevant on a Mac.
KV cache: the context that piles up during a conversation. To keep it small: shorten the agent's system prompt, write shorter instructions, and summarize older messages. Pruning the Hermes agent system prompt took my "hello" from 2 minutes to 30 seconds.
Sparse attention: the model picks the most relevant past tokens instead of rereading everything.
Tokens per second: 5 to 10 is very slow. At 60 to 70 you get a paragraph in 10 to 15 seconds.
Harnesses
You can borrow Claude Code's or Codex's harness, or use an open-source one like pi.dev, a minimal framework you shape yourself. The trade-off: with pi.dev you have to keep tweaking it as new models come out. Give your model feedback and after 5 to 15 iterations it gets good.
Step 5: build the command center
My dashboard runs only on local models on a Mac Mini: AI chat (Open WebUI), Hermes agent, document Q&A (RAG), image generation with ComfyUI, local n8n workflows and an extensions tab.
I built it from the open-source ODS repo on GitHub:
Paste the GitHub link into Claude Code.
Prompt: "Fan out some sub-agents to read through this GitHub repository and come back with a plan to set this up locally on our system with our downloaded Qwen models."
Answer its questions in plain English and let it execute. It took about 45 minutes.
Open the localhost address, name the platform, create your user and pick the features.
Then install extensions and integrations, and keep shaping it into your own setup.
Comments
Login to leave a comment