Part 5: AI
18. The AI part: what you're building#
What you'll get: a small AI language model running on the server itself. It needs no cloud and no subscription, and nothing you ask it leaves the house.
Be realistic: an old laptop runs small models. Expect short answers that take 30 seconds to a few minutes on a dual-core CPU. It's good for searching and summarising your own documents. Don't expect ChatGPT.
The pieces#
flowchart TD
subgraph SRV["Home server"]
subgraph AIACC["'ai' account"]
E["AI engine<br/>llama-server"]
M[("Model file<br/>.gguf, read-only")]
E --- M
end
R["Document search<br/>Recoll"]
AG["Agent system<br/>(optional)"]
R -- "passages" --> Q["ask-pages script"]
Q -- "question + passages" --> E
AG -- "127.0.0.1:8095" --> E
end
Y["You on your Mac / PC"] -- "SSH tunnel" --> E
NET(("Internet"))
E -. "blocked by<br/>network guard" .-x NET
| Piece | Plain meaning | Chapter |
|---|---|---|
AI engine (llama-server from llama.cpp) |
The program that runs a model and answers questions | 20 |
Model (a .gguf file) |
The AI's "brain": one big file, 1–3 GB | 20 |
ai account |
A locked account that runs the engine and can't read your files | 20 |
| Service | Starts the engine automatically and limits its memory and CPU | 21 |
| Network guard | Stops the AI account from reaching the internet | 22 |
| SSH tunnel | Your private door to talk to it from your Mac or PC | 23 |
| Recoll | Finds which document and page talks about your question | 24 |
| Agent system | Optional extra software that queues jobs and has a dashboard | 25 |
What connects to what#
- The engine listens on
127.0.0.1:8095, which means this computer only. Not your Wi-Fi, not Tailscale, not the internet. - You reach it through an SSH tunnel you open when you need it.
- The
aiaccount can't go out to the internet, and can't read/srv/filesor your home folder.
The full map, with the rest of the server, is on How the parts connect.
Before you start#
You need Chapters 1–14 done: Debian installed, SSH with keys, firewall, Tailscale. Hard drives (15–17) aren't needed; the model lives on the internal disk.
| You need | Minimum | Comfortable |
|---|---|---|
| RAM | 4 GB (1.5B model) | 8 GB (3B model) |
| Free disk | 5 GB | 20 GB |
| CPU | any 64-bit Intel/AMD | supports AVX2 (checked in Chapter 19) |