dfejza.com

Work

AI Infra

  • MrHuang

    Code· beta

    Self-hosted AI companion that runs entirely on owned hardware — a Python/FastAPI backend with an in-house agent loop calling a local open-weight model (Qwen3, a ~35B / ~3B-active MoE) served on vLLM, so inference is 100% local with no cloud LLM and no per-token billing. Every conversation is stored locally on self-hosted infrastructure, building a persistent, private knowledge base that commercial chat tools don't keep. Reachable over WhatsApp (Meta Cloud API webhooks) and a web UI, with voice-note transcription via Deepgram and a self-hosted Whisper sidecar deployed as the swap-ready local path. Zero-trust networking via Cloudflare Tunnel + Tailscale, a fail-closed permission ceiling on every action, and a health-gated deploy pipeline that keeps production on a known-good build.

    Migrated from an earlier TypeScript/Express + Agent-SDK design to a self-hosted Python stack — a parity-verified, independently peer-reviewed cutover (8.1/10). An in-house stateless step loop on the OpenAI Python SDK talks to vLLM over its OpenAI-compatible API, with chain-of-thought reasoning on by default; tools run in-process (MCP dropped). A durable, crash-safe job spine — a bespoke scheduler, worker, and idempotent delivery ledger with leases and retries that survive crash and redeploy — runs the proactive/scheduled substrate, with a three-tier egress safety ladder (auto / gated+logged / human-approved) bounded by a fail-closed permission ceiling. Retrieval is single-vector semantic search over a local bge-small embeddings sidecar. A full self-hosted observability stack (Prometheus, Grafana-as-code, alerting, uptime checks, GPU exporter) ships alongside.

    PythonFastAPIvLLMQwen3 35B MoE (open-weight)OpenAI Python SDKSQLiteCloudflare TunnelTailscale

ML & Audio

  • RadioJP

    Live· beta

    Japanese radio streaming with real-time AI transcription. A faster-whisper pipeline continuously transcribes live broadcasts, MeCab adds furigana readings, and the frontend renders word-level karaoke highlighting synced to playback. Also features HLS streaming, station search, favorites, regional grouping, and RadiKo authentication for premium streams.

    A continuous Python transcriber polls stations every 10 seconds, feeding audio chunks to faster-whisper with VAD filtering and hallucination detection. MeCab post-processes segments to add kanji→furigana readings. An SSE streaming API delivers captions in real-time to the frontend, which highlights active words every 250ms with click-to-seek navigation. A caption gate pauses audio at the transcription horizon so playback never outruns captions. HLS.js handles stream playback with a three-tier recovery strategy, and a Zustand store persists player state across page navigations.

    TypeScriptReactNext.jsHLS.jsfaster-whisperPythonMeCabZustand

Finance

  • Golden Handcuff Fixer 2000

    Live· beta

    Monte Carlo financial simulator for expats weighing stay-or-quit decisions. Compare 7 scenarios side-by-side (work, quit, part-time, Coast FIRE, geo-arbitrage) or model a full life timeline across phases. Features break-even analysis, probability of ruin tracking, and a Die With Zero calculator.

    Runs a configurable Monte Carlo of log-normal returns per scenario — 500 paths by default, up to 2,000 — with percentile tracking (10th/25th/50th/75th/90th). The phased engine carries portfolio state across phase boundaries so a 'work 5yr → part-time 3yr → quit 12yr' plan produces a single continuous simulation. Break-even uses binary search to find the minimum work years that keep probability of ruin below 5%.

    TypeScriptReactNext.jsRechartsMonte Carlo
  • Budget Calculator

    Live· alpha

    Cost-of-living calculator covering 10 countries across Asia and the Middle East. Five lifestyle tiers from lean to comfortable, with per-city breakdowns for housing, food, transport, healthcare, government costs, and visa fees. Data sourced from primary research and auto-generated via a YAML pipeline.

    Country data lives in structured YAML research files and gets generated as TypeScript via a code-gen script — no manual edits to the runtime module. State is managed with useReducer, and a shared FX rate service with live currency conversion connects the budget output directly to the planner's scenario inputs.

    TypeScriptReactNext.jsYAML Pipeline

Web

  • Japan Memory Atlas

    Live· alpha

    A spaced-repetition quiz for learning Japan's geography — all 47 prefectures and the 23 wards of Tokyo. Answer on an interactive map and every correct guess leaves a visual trace, turning the map into a personal record of what you've mastered. Adaptive review surfaces your weak spots first.

    Each prefecture and ward is an FSRS card (ts-fsrs) scheduled by spaced repetition, with all progress persisted in localStorage. Correct = Good, incorrect = Again; response time is tracked for analytics but kept out of the recall signal. The interactive SVG map drives per-region click targets and a mastery heatmap derived from FSRS stability plus recent accuracy.

    TypeScriptReactNext.jsts-fsrsSVG
  • Piano App (name TBD)

    WIP· pre-alpha

    Four piano skill games designed to make daily practice addictive. Follows the 'Typing of the Dead' model — piano skills are the core game mechanics, not a layer on top. Visual note reading, finger independence drills, bass pattern rhythm, and chord QTEs, all collecting granular performance data to surface weak spots and track progress over time.

    Built on Vite + React 19 with PixiJS 8 for the space-themed game, VexFlow 5 for real-time music notation rendering, and smplr for piano sample playback. Performance data is collected per-session with a versioned localStorage schema.

    TypeScriptReactVitePixiJSVexFlow

Embedded

  • MrHuang Listener

    WIP· pre-alpha

    ESP32-S3 WiFi audio streaming device that captures speech from dual stereo microphones and streams it over the network to a Python asyncio UDP server, which hands it off to the MrHuang backend. The embedded voice-ingress front end for MrHuang — the hardware counterpart to the desktop mic daemon, both built to feed the same self-hosted speech-to-text layer.

    ESP-IDF firmware on an ESP32-S3. Two INMP441 MEMS I2S microphones in stereo configuration. The firmware reads the I2S samples and streams raw PCM over WiFi as UDP to a Python asyncio UDP server (Opus encoding is the planned next step), which ingests the audio and hands it off to the MrHuang backend. Work-in-progress: the audio path is still stubbed.

    CESP-IDFESP32-S3PythonHardware
  • USB HID Input Automator

    WIP· pre-alpha

    Hardware modification on a Seeed Studio XIAO RP2040: the microcontroller wires directly to a mouse's switch contacts and emits clicks at randomised intervals — exploring USB HID timing, hardware-level event injection, and CircuitPython on RP2040.

    Seeed Studio XIAO RP2040 microcontroller soldered to mouse switch contacts, powered by an internal LiPo. Firmware randomises intervals using a PRNG seeded from analog floor noise. A small project for learning USB HID descriptors and embedded power management.

    CircuitPythonRP2040USB HIDHardware