← back to portfolio
Case Study / FIG. C2
A Multi-Node Homelab — Trading Platform, Agent Orchestration & Local-First LLM Inference
Role Sole engineer, architecture through deployment
Stack Docker Compose, FastAPI, PostgreSQL/TimescaleDB, Redis, Ollama, Cloudflare Tunnel
Context
Alongside the home automation work, I design and operate a small distributed homelab spanning several always-on nodes, running three production-grade services: tickerTap (an AI-assisted trading platform), an AI agent orchestration stack, and a local multi-agent reasoning swarm — without relying on a single cloud provider for compute or inference.
tickerTap — a Bloomberg-terminal-inspired trading platform
FastAPI async backend plus a React 19 SPA, backed by PostgreSQL/TimescaleDB for time-series-heavy financial data and Redis for caching. Background work runs through arq workers — trading, paper-trading, alerting, and market scanning — each reporting an independent heartbeat over Redis so a stalled worker is visible before it silently stops mattering.
- Auth & hardening — JWT auth with Argon2id password hashing, SlowAPI rate limiting, structured JSON logging via
structlog, and Alembic-managed schema migrations.
- CI — GitHub Actions runs ruff + black + pytest against live Postgres/Redis service containers on every PR, plus a matrix build across two Python versions.
- A grounded AI layer — a Telegram bot exposes on-the-go trade analysis, backed by a ChromaDB-based RAG store that surfaces similar past trades with known outcomes, so recommendations are grounded in actual history rather than pure model output.
- A self-improving feedback loop — a remote worker host runs an Ollama-scored news pipeline that learns calibration rules weekly from tracked prediction outcomes, closing the loop between "the model said X" and "here's what actually happened."
Local-first AI orchestration
A separate agent stack coordinates n8n workflow automation, a Postgres+pgvector store, and Redis, alongside a monitoring service that runs health checks, tracks resource usage, and can Wake-on-LAN idle compute rather than leaving it running around the clock. A different multi-agent reasoning swarm — a Logician / Devil / Aggregator pattern — runs entirely on local hardware via Ollama: no API key, no per-token billing, no outbound dependency on a single vendor for the reasoning loop itself.
Deployment approach
- Isolated by default — every service ships as its own Docker Compose stack with per-container memory limits, health checks, and internal-only bridge networks; databases and caches never get a host port.
- No open inbound ports — public exposure goes through Cloudflare Tunnel rather than router port-forwarding: an outbound-only connection from a containerized
cloudflared, so nothing needs a hole punched in the network edge.
- Collision-free by convention — each stack gets its own private subnet, so unrelated services can share a host without their Docker networks ever colliding.
- Audited before going public — before linking any of these repos from this site, I ran a full-history security audit across all six (every branch, every commit, not just the current diff) to confirm nothing sensitive had ever been committed, rather than assuming a clean current state meant a clean history.
The common thread across all three systems is the same: keep inference and orchestration local and observable, keep secrets and state out of source control, and treat "how do I expose this safely" as a first-class design decision rather than an afterthought bolted on before launch.