Axel Verne → Junk Drawer kit → Chapter 13
Chapter 13 — The Oracle I: Local AI on Old Hardware
23 blocks to copy, in the order they appear in the chapter. Nothing here is required to be typed by hand.
This page has the commands. The book has the rest. Chapter 13 in the book adds the drawer check (will your hardware do it?), checkpoints, "Make it good", "When it breaks" and an honest upgrade check.
Read two full chapters free (PDF): Chapter 1 and the Pi-hole chapter, straight from the book.
Get the next build by email. What I ran, on what hardware, and commands that paste. Free, unsubscribe any time.
Step 1: Install Ollama
13.1 · bash
curl -fsSL https://ollama.ai/install.sh | sh
ollama --version13.2 · bash
curl -fsSL https://ollama.ai/install.sh | sh13.3 · bash
ollama serve & # starts the daemon in backgroundStep 2: Pull a model
13.4 · bash
ollama pull qwen2.5:7b13.5 · bash
ollama listStep 3: Run the model locally
13.6 · bash
ollama run qwen2.5:7b "What is the capital of France?"13.7 · text
The capital of France is Paris.13.8 · bash
ollama run qwen2.5:7b "Explain Docker in one paragraph for someone who's never heard of it."Step 4: Open WebUI (the nice interface)
13.9 · bash
docker pull ghcr.io/open-webui/open-webui:latest
docker run -d \
--name open-webui \
-p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-v /srv/lab/data/open-webui:/app/backend/data \
ghcr.io/open-webui/open-webui:latest13.10 · yaml
services:
open-webui:
image: ghcr.io/open-webui/open-webui:latest
container_name: open-webui
ports:
- "3000:8080"
environment:
OLLAMA_BASE_URL: "http://host.docker.internal:11434" # Linux: http://172.17.0.1:11434
TZ: "Pacific/Honolulu"
volumes:
- /srv/lab/data/open-webui:/app/backend/data
restart: unless-stopped13.11 · bash
DOCKER_HOST=$(ip route | grep docker | awk '{print $3}')
# or hardcode it: usually 172.17.0.113.12 · bash
cd /srv/lab/compose/open-webui
docker compose up -d
docker compose logs -fStep 5: Connect to Ollama
13.13 · yaml
# If that doesn't work, try this in compose.yaml:
services:
open-webui:
image: ghcr.io/open-webui/open-webui:latest
# ... rest of config ...
network_mode: "host" # lets it reach localhost:11434 directlyStep 6: Add RAG (your documents)
13.14 · text
@<filename> Summarize this document.When it breaks
13.15 · bash
docker network inspect bridge | grep Gateway # should show something like 172.17.0.113.16 · bash
ollama show qwen2.5:7b13.17 · bash
ollama serve --gpu true &13.18 · bash
sudo lsof -i :3000
mkdir -p /srv/lab/data/open-webui
docker compose up -d13.19 · bash
ollama pull qwen2.5:7b && ollama run qwen2.5:7b "test prompt"
ollama pull llama3.2:3b && ollama run llama3.2:3b "test prompt"Make it good
13.20 · bash
export OLLAMA_KEEP_ALIVE="24h" # keep the model in memory for 24 hours
ollama run qwen2.5:7b "hello"13.21 · yaml
services:
open-webui:
image: ghcr.io/open-webui/open-webui:latest
environment:
OLLAMA_KEEP_ALIVE: "24h"13.22 · bash
ollama pull qwen2.5:7b:latest # highest quality, biggest13.23 · bash
ollama pull qwen2.5:3b-q2_K # tiny, very fast, dumbGet the next build in your inbox
An email when a new build write-up goes up: what I ran, on what hardware, and the commands that paste. Free, unsubscribe any time. The kit stays free either way.