I am a Principal AI Engineer at PHIL. I drive the technical architecture and implementation behind our AI adoption: proprietary coding agents, voice agents, and Rx processing agents.

Most of my work is defining what makes an agent production ready. That is, defining evaluation benchmarks and the infrastructure supporting them, designing experiments for optimizing accuracy, and writing policies that govern enterprise adoption.

Pre-2024, my work was primarily systems engineering. Since 2024, I have worked exclusively on AI engineering. At home I run open-weight models on an AMD Strix Halo box and build harnesses for them.

Aside from work, I love building educational software with my kids.


Self-hosted inference server

llama.cpp · ROCm · Qwen3 · private

I serve Qwen3 models with llama.cpp on the Strix Halo box. Speculative decoding took a 27B model from 9 to 16-18 tokens per second, and a unified KV cache stopped two concurrent replies from corrupting each other. In front of it sits a small gateway I wrote that gives each class of request its own budget and keeps a user on the same slot so the prefix cache gets reused.

mentat

Rust · llama.cpp · Qwen3 · Whisper · VOICEVOX · private

One local model on one machine runs a single chat thread with no end, and every message is kept. The model reads a view of fixed size and zooms into its past when it needs a detail. It takes voice in and out, handwriting in, and a tap-to-read aid, and I use it to practice Japanese.

mentat, a local tutor that reads its own past.
Infinite context in a single thread 0+8 0+4 4+4 8+4 0+2 2+2 4+2 6+2 8+2 10+2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 append, without end fold zoom the view, read every turn 6 lines cover all 16 messages a line holds at most 512 bytes stays under 28k tokens one thread: every message, kept forever summaries fold pairs into a tree; zoom opens one level at a time
Infinite context in a single thread: every message stays in the log, summaries fold the log into a tree, and the model reads a view of fixed size.

Mentat runs one chat thread and writes every message, word for word, to a log that only grows. In the background, the same local model folds each pair of neighbouring lines into one summary of at most 512 bytes, then folds those summaries again, so a binary tree grows over the log. Each turn, the model reads a view: the newest messages as one line each and, for everything older, the summaries that cover it, held under 28k tokens inside a soft 32k-token turn budget, usually between 12k and 24k. When it needs a detail, it calls zoom on a summary and gets the two lines under it, one level per call, down to the original message.

yugimoto, the king of games

TypeScript · MCTS · Cloudflare Workers · private

An AlphaZero-style player written with no ML libraries: tree search plus a 69,986-parameter network trained by self-play. It wins 74% of decided games against a greedy baseline. Without the network, the same search wins 47%. It takes 77 ms to decide a move in the browser.

78 seconds, no sound: character creation with the Guide, a Practice encounter against foes that search the rules engine, and the Codex.

redbluegreen

Rust (std only) · Linux kfd · RDNA 3.5 ISA

A GPU compute stack for an AMD integrated GPU with no ROCm and no HIP: raw kfd ioctls, AQL queues, and kernels I assembled by hand. Vector add reaches 225 GB/s, about 88% of peak. I traced 40 GPU resets along the way and wrote each one down as a rule about the hardware.


I am open to consulting and to interesting work.

Get in touch →