← Back to Work

Durable job orchestration for production LLM pipelines

AI Job Dispatcher

A production multi-lane LLM job system that non-technical teammates run by dropping files into a shared folder, no client and no dashboard, just a queue that behaves.

Role
Sole engineer, designer, and operator
Year
2025
Status
Live
  • Python (standard library only)
  • SQLite (WAL mode, durable ledger)
  • Filesystem-based durable queue
  • Claude Code CLI (headless `-p` reasoning lane)
  • Enterprise-managed hardware, restricted egress

~720 lines

Supervisor size (stdlib only, no framework)

2025 · T-Mobile AI engineering stretch assignment (matthewperez.com/resume)

7

Sandbox regression scenarios

2025 · T-Mobile AI engineering stretch assignment (matthewperez.com/resume)

Challenge

A video production team needed a way to run LLM jobs, transcript cleanup, script review, reasoning passes, without asking non-technical teammates to touch a terminal or install anything. The delivery constraints were real: no admin rights, managed enterprise hardware, restricted egress. Whatever ran it had to be simple enough to trust with no supervision, and it had to fail loudly rather than quietly, because a silent bad answer is worse than a crash.

Process

The interface is a shared folder. Drop a file in, a job runs, a result comes out. Underneath that is a Python supervisor I deliberately kept stdlib-only, roughly 720 lines, with a durable filesystem queue and a WAL-mode SQLite ledger tracking every job’s state. Two worker lanes stay isolated from each other: a local media lane for file-based processing, and a headless reasoning lane that shells out to the Claude Code CLI (claude -p) in a fresh subprocess per job, so no job’s context ever bleeds into the next. If the supervisor dies mid-job, recovery is a simple state flip, anything left PROCESSING goes back to queued on restart, and a 7-scenario sandbox test harness exercises that recovery path along with the rest of the queue’s failure modes before any change ships.

The most consequential thing I found was a silent-failure class in headless LLM orchestration: the CLI could return exit code 0 while the “output” was actually API error text, which meant a naive supervisor would deliver an error message to a user as if it were a real answer. I built envelope-error detection to catch that class of failure and convert it into a legible failed job instead, and locked it in with a regression test so it cannot regress silently. Every job also carries a provenance record, SHA-256 hashes of its inputs and outputs, a prompt hash, and the model ID, so any output can be traced back to exactly what produced it.

Result

The dispatcher runs in production for the team today, driven entirely by dropping files into a folder. It is internal tooling built for a specific video team’s workflow, not a commercial product, and its value is the boring, durable infrastructure underneath a deliberately simple interface: a queue that survives crashes, isolates its workers, and refuses to hand a user a lie dressed up as an answer.