ML / Quant Engineer · Writing & Code

Deep dives, then
the code behind them.

Writing on reinforcement learning, MLOps, and quantitative systems — each post backed by runnable code and real benchmark numbers from a four-year solo build of a SAC pair-trading system.

6 Posts · 3 Projects · Live on IBKR · OOS Sharpe 3.716
01 — Featured Writing
All posts ↗
02 — Live System
01
2022 – Present

Stock Trading AI

Statistical Arbitrage System · SAC RL · Live on IBKR

OOS Sharpe

3.716

Ann. Return

+71.5%

IBKR Live Pairs

32

An ML-driven stat-arb system, designed and operated solo — from alpha research through live execution on IBKR. The core problem with statistical arbitrage is regime dependency: cointegration that holds in mean-reverting conditions deteriorates in trending regimes, causing pair spreads to diverge without reversion. An HMM regime classifier detects the current market state in real time and routes signals to the appropriate strategy branch. A SAC RL agent handles position sizing — its entropy-maximizing objective scales exposure with predicted signal strength, automatically cutting risk when conviction is low. Entry and exit signals are generated by an XGBoost / LightGBM / CatBoost ensemble and a PyTorch TFT sequence model, trained on multi-timeframe features from FMP, FRED, yfinance, and Alpha Vantage, stored in a DuckDB feature store. Live orders execute on IBKR via ib-async.

OOS Sharpe 3.716 · Ann. Return +71.5% vs SPY benchmark +11.7%
HMM regime classifier feeds a strategy router — different signal logic per regime state
SAC RL agent drives position sizing — entropy-maximizing policy scales exposure with signal conviction, not fixed rules
Ensemble (XGBoost + LightGBM + CatBoost) + PyTorch TFT generate entry/exit signals; Optuna hyperparam sweep per model
Data pipeline: FMP + FRED + yfinance + Alpha Vantage → DuckDB feature store → multi-timeframe feature engineering → model training & inference
FastAPI service layer: MongoDB (Beanie ODM) for trade records, Redis for cache, DuckDB for analytical queries — each layer purpose-fit
Live execution on IBKR — 32 active stat-arb pairs, real-time order management and P&L tracking via ib-async
Rust TUI (Ratatui + Tokio) for terminal monitoring; Tauri 2 + SvelteKit desktop dashboard
03 — Side Project
02
2023

ReadBooks.ai

LLM-powered PDF Translation Desktop App

Languages

30+

LLM Backend

Claude

Platform

Native

A Tauri 2 native desktop app for reading English technical books in your native language, paragraph by paragraph. The original approach attempted to fine-tune T5 and fairseq models directly on Korean–English pairs — this was abandoned when the Korean training corpus proved too thin, producing token-level noise instead of coherent output. The architecture was rebuilt around Claude Haiku via the Anthropic API, with the Rust backend handling all network I/O through reqwest, while pdfjs-dist on the SvelteKit frontend extracts and segments paragraph-level text blocks from PDF files. An SSE-streamed Ask AI panel lets users ask questions mid-read, injecting the current page text as context so answers are always relevant to what's on screen.

pdfjs-dist parses PDF structure and extracts text at paragraph granularity
Rust backend (reqwest + tokio) calls Claude Haiku API with async concurrency
30+ language support — translation target is user-configurable at runtime
SSE streaming delivers Ask AI responses token-by-token for low-latency feel
Failure-driven pivot: T5/fairseq fine-tune failed → insufficient Korean data → Claude API
Fully offline-capable except for API calls; no server, no account required beyond API key
04 — Side Project
03
2024

Mandai

Goal Management Desktop App with Built-in AI Coach

AI Providers

4

Methodology

3-in-1

Storage

Local-first

A Tauri 2 desktop app that replaces three separate productivity tools — Mandala Chart, GTD, and Pomodoro — with one coherent workflow. The Mandala Chart gives goals a spatial structure: each outer cell expands into its own 3×3 action plan, with a drill-down navigator that moves through hierarchy levels. GTD state management runs as an explicit state machine in Rust, tracking items across Inbox → Next Actions → Waiting → Done with enforced transitions. Pomodoro sessions drive the focus cycle and write session data to DuckDB through the Rust backend, keeping everything local-first with no cloud dependency. An Ask AI feature injects the current goal and its context into a configurable LLM prompt — supporting OpenAI, Anthropic, Gemini, and Groq — and streams the coaching response back via SSE.

3-in-1 workflow: Mandala Chart spatial hierarchy + GTD state machine + Pomodoro timer
Rust state machine enforces GTD transitions — no invalid state changes possible
Drill-down navigation: click any cell to expand its own 3×3 Mandala sub-plan
DuckDB via Rust backend — all data stays local, zero cloud dependency
Multi-provider AI: OpenAI · Anthropic · Gemini · Groq — user-selectable at runtime
SSE-streamed Ask AI with goal context injection and GTD expert system prompt