What is MYRN?
MYRN is a self-hosted home lab built to support an ongoing Pathfinder 2e tabletop campaign. What started as a way to run Foundry VTT for a group of friends became an exercise in building a full production-grade system from scratch, on consumer hardware, with no cloud spend beyond a single domain name.
Everything on this site, the dice statistics, the campaign pages, the Discord authentication, runs on a repurposed laptop sitting on a shelf, managed entirely via SSH.
By the Numbers
Technical Stack
How It Was Built
System architecture
Build order
Repurposed laptop running Ubuntu Server. Foundry installed and configured for a Pathfinder 2e campaign on bare metal.
Named tunnel routes myrn.net and vtt.myrn.net to local services. No static IP, port forwarding, or firewall exposure.
pf2e-bot built with discord.py. Its 25 slash commands cover roll tracking, character management, session logging, and campaign utilities.
Replaced http.server with Flask, dynamic routing, Jinja2 templates, and a shared design system. Discord guild membership maps directly to the active character.
Nightly extraction reads Foundry's LevelDB store through a safe snapshot-and-parse flow. Rolls are normalised into SQLite idempotently.
PowerShell scripts pull six server components over SCP to a local drive. Wired gigabit networking improved transfer speed 2,600x over WiFi.
Three independently timed fixed CSS layers create the worm descent animation. The paginated button grid supports campaign routing, Discord auth gating, and mobile layouts.
Player-authored entries are tied to Discord identity. The journal includes localStorage unread tracking, unique-IP view counts, author-scoped editing, generated narration, a persistent audio player, and Discord history ingestion.
Self-hosted RAG powers the MYRN chest chatbox. It pulls 43,415 PF2e rules entries from Archives of Nethys into a local SQLite FTS5 database, refreshed monthly.
Each query runs through local retrieval and ranking before Cloudflare Workers AI inference, with local Ollama retained as fallback.
Inference moved from local CPU (Llama 3.1 8B via Ollama, 35–74s cold start) to Cloudflare Workers AI with Llama 3.3 70B as primary. First token is under 2.5 seconds on the free tier, with daily neuron usage well within the 10,000 neuron cap; the agentic query rewriter normalises questions before multi-term retrieval.
A full-stack audit found SQLite connection leaks exhausting the OS file descriptor limit and resolved all 19 connection sites. Additional fixes hardened sessions, media uploads, origin gating, and the AI endpoint concurrency cap.
Every distinct query submitted to MYRN is captured in a training database. A seed set of 50 hand-verified question/answer pairs covering rules, conditions, spells, items, and build advice serves as the evaluation baseline. A key-fact comparison harness tests live model responses against the seed set, identifying retrieval gaps and model errors. Findings feed directly back into retrieval tuning — improving spell/condition disambiguation, class feature matching, and multi-word entry detection.
Built and maintained by Alexander Bates Turriff.