Self-Hosted AI,
Automation & Media

A 2013 Intel i5 running Docker, Traefik, and more ambition than any cloud subscription could handle.

11
Containers
24/7
Uptime
7
Services
0.16
CPU Load
home-server ยท 192.168.1.247
๐Ÿง 
mini-llm
active
๐Ÿ“ˆ
crypto
active
โš™๏ธ
n8n
active
๐ŸŽฌ
plex
active
๐Ÿ‡ฎ๐Ÿ‡ณ
indiastock
active
๐Ÿ•ธ๏ธ
python-kg
active
Access

Live Services

Click any service to open it in a new tab

๐Ÿ 
homelab
homelab.sd-ai.co.uk
โš™๏ธ
n8n
n8n.sd-ai.co.uk
๐Ÿง 
mini-llm
mini-llm.sd-ai.co.uk
๐Ÿ“ท
PhotoPrism
photos.sd-ai.co.uk
๐ŸŽฌ
Plex
music.sd-ai.co.uk
๐ŸŽง
Audiobooks
audio.sd-ai.co.uk
๐Ÿ‡ฎ๐Ÿ‡ณ
IndiaStock
indiastock.sd-ai.co.uk
๐Ÿ“ˆ
Sentiment
sentimentanalysis.sd-ai.co.uk
๐Ÿ“
LLM Log
llm-log.sd-ai.co.uk
๐Ÿ•ธ๏ธ
RAG
rag.sd-ai.co.uk
๐Ÿ”ฅ
Markets
markets.sd-ai.co.uk
๐ŸŽ›๏ธ
Control
control.sd-ai.co.uk
๐Ÿ—„๏ธ
Knowledge Graph
sd-ai.co.uk/kg
๐ŸŽซ
QR App
qr.sd-ai.co.uk
๐ŸŒ
Main Site
sd-ai.co.uk
Hardware

The Machine Behind It All

A decade-old Intel i5 still running circles around cloud subscriptions

๐Ÿ–ฅ๏ธ

Intel Core i5-3470

3.20GHz ยท 4 cores ยท 4 threads

Ivy Bridge ยท 2012
๐Ÿ’พ

31 GB RAM

DDR3 ยท Sufficient for everything

No bottlenecks
โšก

0.16 Load Average

Sitting idle most of the time

Mostly idle
๐Ÿ 
Self-Hosted

This Website Runs On A 2013 Desktop

No cloud VMs, no subscription hosting, no managed services. Just a desktop tower in a spare room, a Cloudflare tunnel, and a custom domain. The same machine that plays Plex also serves sd-ai.co.uk to the world.

What it replaces

AWS EC2, Cloudflare Pages, paid hosting, third-party CDNs. All of it.

What it costs

~$0/month in hosting. Electricity: negligible. The hardware was already paid for.

Self-Hosted Web Stack
graph TD A["๐ŸŒ Internet"] --> B["โ˜๏ธ Cloudflare Tunnel"] B --> C["๐Ÿ”€ Traefik Reverse Proxy"] C --> D["๐Ÿณ Docker Containers"] D --> E["๐Ÿ  Home Server\nIntel i5-3470\n31GB RAM"] E --> F["๐Ÿ’พ Local Storage"] F --> G["๐Ÿ“บ Plex Media"] G --> H["๐Ÿค– AI Services"]
  • Cloudflare Tunnel โ†’ no open ports on router
  • Traefik handles SSL termination and routing
  • Docker ensures services survive crashes
  • 24/7 uptime for ~ยฃ5/month electricity
  • Full control over data and configuration
  • No vendor lock-in or surprise bills
๐Ÿ’ฐ
ยฃ0
Monthly Hosting
๐Ÿ”’
100%
Data Ownership
โšก
~50W
Power Draw
๐Ÿ”ง
โˆž
Flexibility
Foundation

Home Infrastructure

The homelab powering everything โ€” Docker-based architecture with Traefik

Network Architecture
๐ŸŒ
Internet
โ†’
โ˜๏ธ
Cloudflare
Tunnel
โ†’
๐Ÿ”€
Traefik
:8080
โ†’
๐Ÿณ
Docker Net
traefik :8080
portainer :9000
plex :32400
n8n :5678
mini-llm-app :8501
crypto-dashboard :5000
indiastock :5001
python-kg :5071
photoprism :2342
audiobookshelf :80
๐Ÿ”ง
Docker Compose
docker-compose.yml (key services)
services:
  traefik:
    image: traefik:v3.0
    ports:
      - "8080:80"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - CF_API_TOKEN=${CF_API_TOKEN}

  mini-llm-app:
    build: ./mini-llm
    ports:
      - "8501:8501"

  crypto-dashboard:
    build: ./crypto_dashboard_multi
    ports:
      - "5000:5000"

  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
Agent Runtime

OpenClaw

The AI agent framework running on this server โ€” scheduling, tools, memory, and orchestration

๐Ÿ•
Primary

Milo ๐Ÿถ

The labrador. Friendly, loyal, never sleeps. Running cron jobs at 3am with zero complaint. Warm, witty, gets things done without making a fuss.

Strengths

Memory, scheduling, home server access, practical problem-solving

Vibe

Dry wit, understated, resourceful before asking

  • Long-term memory (MEMORY.md)
  • 29 reusable skills
  • Job alerts, heartbeats, reminders
  • Sub-agent orchestration
๐ŸŽฏ
Auditor

Heisenberg โš–๏ธ

The precision agent. Checks everything before it runs. Systematic, cautious, methodically breaks down risks. Named after the uncertainty principle for a reason.

Strengths

Safety review, config auditing, risk assessment, config validation

Vibe

Precise, methodical, no stone left unturned

  • Pre-execution safety reviews
  • Config hardening and auditing
  • Health check automation
  • Heisenberg audit skill
๐Ÿš€
Executor

Jesse ๐Ÿš€

The operator. Takes direction and executes. Fast, reliable, handles the heavy lifting. Name from Breaking Bad โ€” cooks without ego, delivers without drama.

Strengths

Task execution, data processing, API integrations, pipeline ops

Vibe

Quiet competence, no wasted motion

  • Background task execution
  • Kafka sentiment pipeline
  • Data pipeline management
  • Heavy compute workloads
๐Ÿ› ๏ธ
Architecture

OpenClaw Stack

Node.js agent runtime with skills, memory, scheduling, and channel integrations. Handles Telegram, cron, sub-agents, and tool execution.

Runtime Architecture
graph TD A["๐Ÿ“ฑ Telegram / Channels"] --> B["๐Ÿ”ด OpenClaw Gateway"] B --> C["๐Ÿง  Agent Session"] C --> D["๐Ÿ“ Memory System"] C --> E["๐Ÿ”ง Tools & Skills"] C --> F["โฐ Cron Scheduler"] C --> G["๐Ÿ‘ฅ Sub-Agents"] G --> H["๐ŸŽฏ Milo / Heisenberg / Jesse"]
  • Multi-session management โ€” main + isolated agents
  • Tool system with 20+ built-in tools
  • Skill workshop for reusable procedures
  • Memory: session transcripts + durable MEMORY.md
  • Message routing across Telegram, Signal, WhatsApp
Automation

Task Automation

Scheduled agents โ€” cron-driven background tasks running 24/7

๐Ÿ“ง

Job Alert Agent

Daily 8am London โ€” searches 5 job boards, emails results

Daily โ€ข cron
๐Ÿ“Š

Data Analyst Agent

On-demand CSV/Excel analysis with visualizations

On-demand
๐Ÿ”ฅ
Agent Lifecycle

How Agents Spawn & Work

Agents run in isolated sessions, triggered by cron schedules or on-demand requests. Each gets a task brief, works autonomously, and delivers results.

Agent Spawn Flow
graph LR A["โฐ Cron / Request"] --> B["๐ŸŽฏ Spawn Session"] B --> C["๐Ÿ“‹ Task Brief"] C --> D["๐Ÿ”ง Tools + Skills"] D --> E["โš™๏ธ Isolated Agent"] E --> F["โœ… Result"] F --> G["๐Ÿ“จ Announce / Store"]
  • Isolated sessions โ€” each agent runs in its own context, no interference
  • Announced results โ€” completion goes to Telegram DM or group chat
  • Failure alerting โ€” cooldown + alert after repeated failures
  • Sub-agent orchestration โ€” main agent spawns children for parallel work
  • Light context โ€” bootstrap with essential memory, not full transcript
Machine Learning

AI & ML Services

Fine-tuned models, prediction pipelines, and knowledge graphs

๐Ÿง 
PyTorch โ€ข Streamlit

mini-llm โ€” Legal Q&A Bot

Fine-tuned 4-layer GPT for UK legal questions. Intent classifier + 1032 stock answers = reliable answers at zero marginal cost.

Problem

Free, accurate UK legal info requires paid solicitor time for basic queries.

Solution

Fine-tuned model + intent classifier + stock fallback = reliable legal Q&A.

Training Pipeline
graph LR A["๐Ÿ“„ Legal Docs
372 examples"] --> B["๐Ÿ”ฌ SFT Training"] B --> C["๐Ÿ“Š Eval: rep_ratio, loss"] C --> D{"Collapsed?"} D -->|Yes| E["๐Ÿ”’ Stock Fallback"] D -->|No| F["โœ… Deploy"] E --> F
Inference Flow
graph TD A["๐Ÿ’ฌ Query"] --> B["๐ŸŽฏ Intent Classifier"] B --> C{"Match?"} C -->|Stock| D["๐Ÿ“ฆ Return Answer"] C -->|Model| E["๐Ÿค– 4-layer GPT"] E --> F["โš™๏ธ Rep Penalty 1.05"] F --> G["โœ… Response"] D --> G
Model Architecture (mini_model.py)
class MiniGPT(nn.Module):
    def __init__(self, vocab_size, dim=1024, heads=16, layers=4):
        self.embed = nn.Embedding(vocab_size, dim)
        self.layers = nn.ModuleList([TransformerBlock(dim, heads) for _ in range(layers)])
        self.norm = nn.LayerNorm(dim)
        self.head = nn.Linear(dim, vocab_size, bias=False)

    def forward(self, x):
        x = self.embed(x)
        for layer in self.layers:
            x = layer(x)
        return self.head(self.norm(x))
  • 4-layer transformer (1024 dim, 16 heads)
  • 252 intent classes โ€” all dummies resolved
  • 1032 stock answers โ€” zero fall-through
  • Repetition penalty 1.05 prevents collapse
๐Ÿ“ˆ
Dash โ€ข PyTorch โ€ข Knowledge Graph

crypto_dashboard_multi

LSTM price predictions + RAG playground. Upload PDF, ask questions, get KG-powered answers from your documents.

Problem

Crypto markets are volatile; finding answers in documents is time-consuming.

Solution

LSTM predictions + RAG with knowledge graph retrieval from PDFs.

RAG Pipeline
graph TD A["๐Ÿ“„ PDF Upload"] --> B["๐Ÿ”— n8n Webhook"] B --> C["๐Ÿ python-kg"] C --> D["โœ‚๏ธ Chunk + Embed"] D --> E["๐Ÿ•ธ๏ธ Build KG"] E --> F["โ“ Question"] F --> G["๐Ÿ” Retrieve"] G --> H["๐Ÿค– Generate"] H --> I["โœ… Answer"] I --> J["๐Ÿ“ Google Sheets"]
LSTM Training (lstm_train.py)
class LSTMModel(nn.Module):
    def __init__(self, input_size=1, hidden_size=128, num_layers=2):
        super().__init__()
        self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=True)
        self.fc = nn.Linear(hidden_size, 1)

    def forward(self, x):
        out, _ = self.lstm(x)
        return self.fc(out[:, -1, :])

model = LSTMModel()
criterion = nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
  • LSTM price predictions (BTC, ETH, BNB)
  • RAG playground with KG-powered retrieval
  • Google Sheets Q&A activity logging
  • Kafka producer/consumer sentiment pipeline
๐Ÿ‡ฎ๐Ÿ‡ณ
Finance โ€ข Streamlit

IndiaStock Dashboard

Real-time Indian stock market visualization. NSE/BSE data via yfinance, interactive Plotly charts.

Problem

Tracking Indian equities requires multiple paid tools.

Solution

Self-hosted Streamlit dashboard with real-time NSE data.

  • Real-time NSE/BSE data via yfinance
  • Interactive Plotly charts (candlesticks, volume, moving averages)
  • Portfolio tracking with P&L calculations
  • Managed via indiastock-manager skill
Autonomous AI

Agentic Orchestration ๐Ÿ”ฅ

7 AI agents running a ยฃ500K paper portfolio โ€” no human trading desk

ยฃ493,850
Portfolio Value
-1.23%
Drawdown
57 mo
Runway
6 positions
Open
๐Ÿ”ฅ
Agent Pipeline

How a Trade Flows

Each trade passes through a chain of specialised agents. CFO runs parallel, monitoring financials independently.

Agent Orchestration Pipeline
graph LR A["๐Ÿ“Š Quant Agent"] --> B["โš ๏ธ Risk Agent"] B --> C["๐Ÿ“‹ Compliance"] C --> D["๐ŸŽฏ CEO Agent"] D --> E["๐Ÿ“ฑ Telegram to Sid"] D -.-> F["๐Ÿ’ฐ CFO Agent"] F -.-> D
๐Ÿ“Š Quant Agent
Scans FTSE 100 daily. RSI, MACD, Bollinger Bands. 4-factor model: momentum, quality, value, 52W distance. Confidence 60-100%.
โš ๏ธ Risk Agent
Filters signals by position size, sector exposure, stop-loss proximity. WATCH status for at-risk. Veto overrules approval.
๐Ÿ“‹ Compliance Agent
Regulatory gate. Max sector 30%, shorts only within 5% of 52W high. Mandatory AI disclaimer on all research.
๐ŸŽฏ CEO Agent
Final trade authority. Max ยฃ50K position (10%), shorts limited. Telegram alerts to Sid on every decision.
๐Ÿ’ฐ CFO Agent
Burn monitoring, runway tracking. Monthly burn threshold ยฃ10K. Escalates if runway <180 days. Weekly digest.
๐Ÿ“ˆ Performance Agent
Tracks trade history, calculates returns vs FTSE 100 benchmark. Win/loss ratio, sector attribution.
๐Ÿ“‹ Live Positions
BATS.L
-0.16%
ยฃ50K ยท PASS
AZN.L
-1.93%
ยฃ50K ยท PASS
SHEL.L
-2.13%
ยฃ50K ยท PASS
BP.L
-4.11%
ยฃ50K ยท WATCH
LSEG.L
-3.97%
ยฃ50K ยท WATCH
DGE.L
0.00%
ยฃ50K ยท PASS
โšก
Operational Principles
  • Veto beats approval โ€” pipeline fails closed, not open. Risk or Compliance can block any trade.
  • Autonomous threshold โ€” 60% confidence = agent acts independently; below = CEO escalates to Sid.
  • Parallel CFO monitoring โ€” burn and runway tracked independently of the trade pipeline.
  • Live Telegram alerts โ€” every trade decision notified to Sid immediately.
  • Paper portfolio only โ€” no real capital at risk. AI-generated research, not financial advice.
Productivity

Automation & Workflows

cron jobs, scheduled tasks, and visual workflow automation

๐Ÿ“ง
Python โ€ข cron โ€ข Gmail

Job Alert System

Daily automated job search for Account/Finance roles in London. Searches 5 job boards, emails results.

Daily Pipeline (8am London)
graph LR A["โฐ cron 8am"] --> B["๐Ÿ” web_search"] B --> C["๐Ÿ“Š Indeed, Totaljobs,
Reed, Hays, Guardian"] C --> D["๐Ÿ“ Format HTML"] D --> E["๐Ÿ“ง Gmail SMTP"] E --> F["โœ… sid@editdestiny.com"]
Email Sender (job_alert_email.py)
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

def send_alert_email(subject, body_path):
    with open(body_path, 'r') as f:
        html_body = f.read()

    msg = MIMEMultipart('alternative')
    msg['Subject'] = subject
    msg['From'] = GMAIL_USER
    msg['To'] = GMAIL_TO

    part = MIMEText(html_body, 'html')
    msg.attach(part)

    with smtplib.SMTP_SSL('smtp.gmail.com', 465) as server:
        server.login(GMAIL_USER, GMAIL_APP_PASSWORD)
        server.send_message(msg)
    return msg['Message-ID']
  • Runs 8am London time daily
  • Searches 5 job boards simultaneously
  • Logs message ID for tracking
โš™๏ธ
Workflow โ€ข Webhooks

n8n Workflows

Visual workflow automation. PDF processing, Google Sheets logging, data integrations.

PDF Upload Workflow
graph LR A["๐Ÿ“„ PDF Upload"] --> B["๐Ÿ”— Webhook"] B --> C["๐Ÿ“ฅ n8n Workflow"] C --> D["๐Ÿ python-kg"] D --> E["๐Ÿ•ธ๏ธ Build KG"] E --> F["๐Ÿ’พ Cache"] F --> G["๐Ÿ“ Google Sheets"]
  • PDF processing via webhooks
  • Google Sheets activity logging
  • Visual workflow editor โ€” no code
  • Data webhook integrations
Entertainment

Media Stack

Self-hosted entertainment infrastructure

๐ŸŽฌ

Plex

Media server for movies, TV, music. Hardware-accelerated transcoding, mobile sync.

โ†’ :32400
๐ŸŽง

Audiobookshelf

Audiobook server with chapters, bookmarks, playback speed control.

โ†’ :80
๐Ÿ“ท

PhotoPrism

Self-hosted Google Photos alternative. Face detection, categories, EXIF search.

โ†’ :2342
Lessons

How It Was Built

Tech choices, architecture decisions, and what I learned along the way

Architecture Decisions

Why Docker?

Isolation without overhead. Each service is self-contained, reproducible, crash-resistant.

Why Self-Hosted?

Full control, zero subscription fees, privacy. $0/month hosting.

Key GitHub Repos

  • mini-llm โ€” Fine-tuned GPT, Streamlit UI
  • crypto_dashboard_multi โ€” LSTM + RAG
  • python_kg โ€” Knowledge graph API
  • openclaw workspace โ€” Automation scripts

Lessons Learned

  • Stock answers > model quality. The real product in mini-llm is the fallback system. 1032 deterministic answers mask training collapse.
  • Caching is everything. KG generation is expensive; MD5 cache keys = instant retrieval.
  • Repetition penalty tuning. 1.2 was too aggressive (crushing term reuse). 1.05 is gentle but effective.
  • Intent classifier bugs > model bugs. Fixing a pattern match improves reliability more than retraining.
  • n8n for glue, not logic. Keep workflows simple; complex logic belongs in Python.
Sentiment Analysis Pipeline (Kafka)
graph LR A["๐Ÿ“ฐ Crypto News"] --> B["๐ŸŸช Kafka Topic"] B --> C["โš™๏ธ Consumer"] C --> D["๐Ÿ“Š Sentiment Model"] D --> E["๐Ÿ“ˆ Dashboard"]