Projects / homelab-agent-stack · 2025 - present · Sole operator

Local AI Agent Platform

A self-hosted AI agent platform - locally served 125B-class LLM (~150 tok/s sustained on one 32 GB card), tool-using runtime, role-scoped bots, guardrails, and unattended overnight pipelines.

What it is: My home server - one self-built box (specs and power engineering on its own page) - runs a private platform where an AI agent lives - reachable from my phone like a group-chat bot, able to read my inbox, watch deadlines, and operate the machine under guardrails. What it does: morning mail triage, deadline sweeps, overnight batch jobs, encrypted messaging, private web search, and hardware monitoring - all self-hosted on locally served models, no cloud AI accounts.

This page is intentionally architecture-level. Hostnames, addresses, ports and topology specifics are not published - that is part of the point.

The platform, in one picture

WireGuard tunnel no exposed ports Home network - one self-hosted server, zero SaaS in the loop Phone the agent's chat UI Mail inbox forwarded, read-only Laptop vault + project folders SimpleX relays SMP + XFTP, Docker no number, no metadata SearXNG metasearch agent's web backend JSON API, self-hosted Mail triage reads, ranks, drafts never sends unattended Syncthing vault + repos mirrored vendor-free, P2P Agent runtime agent framework with tool use: browser, terminal, scheduler role-scoped bot profiles mail, school, homelab each with persona, allowlist, routines guardrails read-only defaults, approval gates append-only run logs on every job overnight jobs prepare, never deploy the controls I design into tooling at work Local LLM endpoint quantized model on a consumer GPU OpenAI-compatible API Overnight pipelines multi-hour cron jobs, unattended append-only logs, no-deploy gate Hardware daemons fan PID curves, headless RGB narrow, auditable agent commands inference
The stack as one picture. Devices come in through WireGuard only - no open ports - and the forwarded mail inbox is the only third-party account in the frame: the agent reads and drafts, and never sends unattended. Everything else (relays, search, sync, inference, scheduled pipelines) runs on the same box. Intentionally architecture-level: no addresses, ports or device names, same rule this page holds itself to.
  • Agent runtime. An LLM served locally (quantized model on consumer silicon) behind an OpenAI-compatible endpoint, driven by an agent framework with tool use (browser automation, terminal, scheduler). Multiple role-scoped bot profiles (mail, school, homelab), each with its own persona, tool allowlist, and scheduled routines.
  • Messaging. A self-hosted SimpleX channel reaches my phone like a group-chat bot - agents announce, I reply, nothing leaves my infrastructure. No phone number, no third-party metadata; the relay deployment itself is on the infrastructure page.
  • Mail. A read-only triage inbox: all personal mail forwards into one account; a morning routine reads, prioritizes, and drafts; sending is always gated on an explicit human OK.
  • Overnight pipelines. A cron scheduler runs multi-hour unattended jobs: bulk document processing, reference-draft generation, research digests, each writing an append-only run log and a morning report. No-deploy gate: overnight jobs may prepare artifacts, never push them live.
  • Sleep-time compute (in progress). An always-on agent only spends tokens when someone asks, and the hardware can work 24 hours while its owner can't. This experiment builds the missing layer: a scheduler that manufactures useful demand for the GPU's dark hours.
  • Nightly media pipeline (in progress). An overnight lane turns my own notes into short narrated explainer videos - animation engine, TTS narration, ffmpeg stitching - behind hard QA gates (duration, audio stream, decode-clean, non-black frames) and honest morning reports.
  • Live data over saved exports. When a grading platform's share pages turned out to be JavaScript-only shells, the real payload was in its student-facing API - the tooling I built pulls live rubric-level data instead of trusting silently-lossy PDF exports.

Serving details

What the box actually serves, in numbers. All measured here with the sustained protocol (150 s of continuous generation before each sample; medians), unless stated otherwise.

Setting Value
Model qwen3.8-flash-next-unsloth-ud-iq4_xs - 125B-class Mixture-of-Experts LLM, ~6B active parameters per token
Quantization IQ4_XS - chosen for capacity, not speed
Context window 131,072 tokens
Speculative decode on (draft acceptance 224/225 short-context; falls to ~70% at long context)
Concurrency one engine slot, strict FIFO - three role-scoped agents plus chat share it

The memory split is the whole trick. VRAM (32 GB) holds the dense attention path, an elastic KV cache, and a ~23 GiB hot-expert cache (~10.3k expert slots; 90-99% hit rate, so only 0.1-2.2% of routed lookups ever leave the GPU). The full expert tier - ~58 GB - plus a 42 GB n-gram table live in the 96 GB of system RAM and stream over a PCIe link that measures ~55 GB/s. A single 32 GB consumer card serving a 125B-class model is a memory-architecture problem, not a compute one.

Throughput. Sustained single-stream decode runs ~152 tok/s (150.7 t/s at stock voltage/cap; 152.2 t/s at the adopted -50 mV + 285 W point). Prefill - the other half of time-to-first-token - is bandwidth-bound and behaves completely differently: short prompts prefill at ~1,195-1,210 tok/s (flat-to-better as the power cap drops, which is itself the bandwidth-bound proof), and a 116,000-token prompt prefills in 32.8 s (~3,565 tok/s) at the deep-context gate.

Concurrency, measured rather than configured. Four simultaneous requests on the FIFO slot aggregate 136.5 tok/s (8.79 s wall; median of three back-to-back probes - the probe itself is a bimodal +-8% jitter, so single concurrency readings don't count). A two-slot batching experiment genuinely overlapped the streams and raised the aggregate by nothing (109-127 tok/s) while halving per-stream speed and worsening wall time (11.5 s vs 9.4 s) - reverted, because on a power-capped card whose experts live in RAM the cap is a hard throughput wall (matches upstream's own batching rule for this hardware class). Practical shape under load: one shared ~150 tok/s pipe, effective per-request throughput degrades ~1/N, requests queue strictly.

KV strategy. Pay-as-you-go KV allocation replaced up-front RAM-pinned KV in a hash-gated A/B: decode +1.4%, 4-stream aggregate +8.6%, ~65 GiB of pinned RAM handed back to the system, outputs bit-identical. The soak included a parked 99,209-token conversation (148.8 t/s decode, 99.2% expert hits); all four pre-registered KEEP criteria passed the final recheck, and it is the live strategy.

The machine and the numbers underneath

Everything above runs on one self-built Ubuntu box behind WireGuard-only access, and the inference server is treated like the production infrastructure it is: hypotheses pre-registered before anything is touched, every change gated on 30-run bit-exact output hashes, sustained-measurement protocol after single-shot probes proved unreliable - and retracted readings kept in the log, not quietly deleted. The hash-gated power/voltage ladders - the dot-plot figures, the adopted operating point, and the full benchmark record behind the numbers above - live on Home Server Infrastructure.

Why it matters to me

Running this is the most honest systems interview I can give myself. Every layer fails loudly somewhere I can read, every credential I don't hand to a vendor is a threat model I don't have to audit, and the agent's guardrails (read-only defaults, approval gates, append-only logs) are exactly the controls I design into enterprise tooling at work.

← all projectsQuestions? Email me