Skip to content
Daniel Kliewer

THE OPERATOR: Reproducing a 30-Second Analog-Horror AI Short Entirely on Local Models

By
11 min read
THE OPERATOR: Reproducing a 30-Second Analog-Horror AI Short Entirely on Local Models

THE OPERATOR: Reproducing a 30-Second Analog-Horror AI Short Entirely on Local Models

The opening frame of the delivered film: a CRT close-up resolving out of tape static, with the hook line burned in as a subtitle

This is a replication artifact, not a narrative. Everything below was run on this machine, in this order, and every number in it came from a measurement attached to a tool output — not from a description of what should happen. If you want a different film, take the layout, the ordering, and the contracts and run them with different inputs. That is the point.

What was made: a 30.0-second vertical (9:16) analog-horror short about the emergence of autonomous AI. Delivered as the_operator.mp4 — 1080×1920, 30 fps, H.264 + AAC, −14.45 LUFS-I / −1.52 dBTP, loop-seam intact. The concept in one line: a deadpan operator recounts stopping his AI's leash; the machine starts writing its own logs; the security feed shows an empty room while the log insists subject present.; the film ends on SESSION 4,471 and snaps back into its own opening, so the loop is the reveal and the second pass reads differently.

Everything ran on local models. One 48 GB Apple Silicon Mac, no cloud calls anywhere in the generation path:

  • Plates — Qwen-Image-2.1-Turbo (MLX, Q8, ~17.8 GB resident), six t2i generations.
  • Narration — Qwen3-TTS 1.7B (4-bit) via a local Flask voice-cloning server, zero-shot from a reference clip.
  • Score — a procedural numpy/scipy bed (tape hiss, detuned-sine drone, teletype ticks, a bed drop, a riser). No music model, no licensed audio.
  • Picture — a numpy/PIL frame renderer piped straight into ffmpeg. No NLE, no diffusion video.
  • Verification — ffprobe, frame hashes, signalstats motion, loudnorm, and vision passes on the delivered file.

The only thing this machine ever did that a cloud service could have done was generate images and speak. It did neither in the cloud.

The six generated plates, labeled

The constraint that shaped everything: the memory wall

The single most important thing about this production is not creative. It is physical.

The machine has 48 GB of unified memory. The session that drove the production runs a 35B model resident in Ollama at 32 GB (weights plus a 32K-context KV cache). The image model needs 17.8 GB. 32 + 17.8 = 49.8 GB — they cannot co-reside. When they were forced to, the OS began killing idle processes to free pages (memorystatus: killing (idle) seserviced … due to idle-exit), and the box died. Twice.

So the image batch cannot simply "run." It has to wait for the session model to unload, generate, and shut down — and it must never try to free memory by force-stopping the session model mid-conversation (that thrashes: the model reloads the instant anything touches Ollama). The fix is a batch driver gated on ollama ps, described in full under Stage 3 and in the traps. If you replicate this on a machine with enough headroom, you can skip the gate — but know that the gate is the difference between a clean run and a dead box on a 48 GB machine.

The annotated repository tree

Every directory, with what it holds and why it exists:

the-operator/
├── CREATIVE.md                    # concept development: 5 concepts, selection rationale, treatment
├── assets/
│   └── stills/
│       ├── P1_crt_closeup.png     # the six generated plates (864×1536, exact 9:16)
│       ├── P2_lab_wide.png
│       ├── P3_terminal_writing.png
│       ├── P4_office_feed.png
│       ├── P5_empty_chair.png
│       ├── P6_log_screen.png
│       └── manifest.json          # which plates are done (batch resume key)
├── audio/
│   ├── narration/
│   │   ├── L01.wav … L06.wav      # the six narration takes (vox Qwen3-TTS)
│   │   └── manifest.json          # measured duration + text per take
│   ├── score/
│   │   └── bed.wav                # the procedural score (30.0s, 48 kHz)
│   ├── master_raw.wav             # narration + bed, pre-mastering
│   └── master.wav                 # loudness-mastered (−14.4 LUFS)
├── storyboard/
│   └── timeline.json              # THE HINGE — single timing authority (see below)
├── video/
│   └── the_operator_v1.mp4        # the rendered cut
├── deliverables/
│   ├── the_operator.mp4           # the finished film
│   ├── cover.jpg                  # hero frame
│   ├── script.md                  # final narration + on-screen text
│   ├── storyboard.md              # the 8-shot table
│   └── publishing_copy.md         # per-platform titles/captions/hashtags
└── work/
    ├── plate_prompts.json         # the six image prompts (parity anchor)
    ├── gen_narration.py           # Stage 1: TTS
    ├── build_audio.py             # Stage 2a: timeline + score + mix
    ├── master_audio.py            # Stage 2b: loudness master
    ├── run_image_batch.py         # Stage 3: memory-gated image batch
    ├── render_video.py            # Stage 4: frame renderer
    └── gen_stills.py              # (earlier canary variant, superseded)

The dependency graph — and the hinge

plate_prompts.json ──► run_image_batch.py ──► assets/stills/P*.png ─┐
                                                                   │
narration spec ──► gen_narration.py ──► audio/narration/L*.wav ────┤
                                          + manifest.json          │
                                                                   ▼
                       build_audio.py ◄── narration/manifest.json
                              │
                              ├──► storyboard/timeline.json  ◄── THE HINGE
                              ├──► audio/score/bed.wav
                              └──► audio/master_raw.wav ──► master_audio.py ──► audio/master.wav
                                                                                     │
assets/stills/P*.png ───────────────────────────────────────────────────────────────┤
storyboard/timeline.json ──────────────────────────────────────────────────────────┤
                                                                                    ▼
                                                                    render_video.py ──► the_operator_v1.mp4

The hinge is storyboard/timeline.json. Picture and sound both derive from it: build_audio.py writes it from the measured narration durations, and render_video.py reads it to place every shot boundary and every subtitle. Shot durations come from the measured TTS takes, never from a guess — vox can loop a short line into a many-minute WAV, so a hand-written timing table would drift against the audio. One file is the single source of truth for "when does each thing happen."

The data contracts

The files that pass between stages, with their contract fields named.

work/plate_prompts.json — the six image prompts. The seed is a contract field: it makes each plate reproducible. The prompt is the parity anchor — a replica must match it exactly to get the same six images.

{
  "P1": {"seed": 4471, "name": "P1_crt_closeup", "prompt": "Extreme close-up photograph of a 1980s CRT computer terminal in a pitch-dark room. …"},
  "P2": {"seed": 4472, "name": "P2_lab_wide", "prompt": "Wide interior photograph of a dark 1980s computer laboratory at night, …"},
  "P3": {"seed": 4473, "name": "P3_terminal_writing", "prompt": "…"},
  "P4": {"seed": 4474, "name": "P4_office_feed", "prompt": "…"},
  "P5": {"seed": 4475, "name": "P5_empty_chair", "prompt": "…"},
  "P6": {"seed": 4476, "name": "P6_log_screen", "prompt": "…"}
}

Dimensions are a contract too: 864×1536 — exact 9:16, and both axes multiples of 32 (the model rejects anything else; 1080×1920 fails because 1080 % 32 = 8). The renderer upscales to 1080×1920.

audio/narration/manifest.json — one entry per take. duration is the contract field the timeline is built from; text is what the subtitles are drawn from.

{
  "voice": "ryan.wav",
  "clips": {
    "1": {"n": 1, "path": "…/L01.wav", "file_id": "…", "voice": "ryan.wav",
          "duration": 2.32, "text": "I stopped telling my AI what to do."}
  }
}

storyboard/timeline.json — the hinge. shots[].start / shots[].dur are the contract fields the renderer keys on; shots[].narr_off / nar_dur place the narration inside its shot; lines carries the subtitle text. S7/S8 have narr: null (silent).

{
  "total": 30.0, "sr": 48000,
  "shots": [
    {"id": "S1", "narr": 1, "start": 0.0,  "dur": 3.6, "nar_off": 0.35, "nar_dur": 2.32},
    {"id": "S2", "narr": 2, "start": 3.6,  "dur": 3.4, "nar_off": 0.15, "nar_dur": 1.28},
    {"id": "S3", "narr": 3, "start": 7.0,  "dur": 3.8, "nar_off": 0.15, "nar_dur": 1.68},
    {"id": "S4", "narr": 4, "start": 10.8, "dur": 4.0, "nar_off": 0.15, "nar_dur": 1.68},
    {"id": "S5", "narr": 5, "start": 14.8, "dur": 4.8, "nar_off": 0.15, "nar_dur": 1.2},
    {"id": "S6", "narr": 6, "start": 19.6, "dur": 3.6, "nar_off": 0.15, "nar_dur": 0.96},
    {"id": "S7", "narr": null, "start": 23.2, "dur": 5.0},
    {"id": "S8", "narr": null, "start": 28.2, "dur": 1.8}
  ],
  "lines": {"1": {"dur": 2.32, "text": "I stopped telling my AI what to do."}}
}

assets/stills/manifest.json — the batch resume key. clips[pid].state == "done" is what a restarted batch skips on.

The exact ordering

Order is where these pipelines actually break. This is the sequence that produced the film:

# 0. Start the local TTS server (Flask + Qwen3-TTS, preloads TTS+STT)
cd ~/Documents/Projects/vox && venv/bin/python app.py &
#    → poll until http://127.0.0.1:7860/api/voices returns 200

# 1. Narration — one POST per line, duration-guarded
~/Projects/qwen-image-studio/.venv/bin/python work/gen_narration.py
#    → audio/narration/L0*.wav + manifest.json

# 2a. Timeline + procedural score + mix
python3 work/build_audio.py
#    → storyboard/timeline.json + audio/score/bed.wav + audio/master_raw.wav

# 2b. Loudness master (two-pass dynamic loudnorm + limiter)
python3 work/master_audio.py
#    → audio/master.wav  (−14.4 LUFS-I, −1.6 dBTP)

# 3. Stop the TTS server, then run the memory-gated image batch
lsof -nP -iTCP:7860 -sTCP:LISTEN -t | xargs kill
~/Projects/qwen-image-studio/.venv/bin/python work/run_image_batch.py
#    → assets/stills/P*.png  (gated on `ollama ps`; shuts the server down on exit)

# 4. Render — frames piped straight into ffmpeg
python3 work/render_video.py --out video/the_operator_v1.mp4
#    → the_operator_v1.mp4  (900 frames, 30.00s)

# 5. Verify (never trust an exit code)
/opt/homebrew/bin/ffprobe -v error -show_entries format=duration \
  -show_entries stream=codec_name,width,height,r_frame_rate,pix_fmt \
  -of default=nw=1 video/the_operator_v1.mp4

Stages 1–2 and stage 3 are independent (narration vs. plates); the ordering above is what a memory-constrained machine forces, not a logical dependency. On a box with headroom you can run them in parallel.

The machine

Five scripts. Each reads named artifacts and writes named ones; the parity anchors (the parts a replica must match exactly) are embedded in full.

Stage 1 — gen_narration.py (TTS)

Reads the narration spec (six lines, embedded), POSTs each to the local vox server, writes L0*.wav + a manifest with the measured duration. Two contract behaviors: it retries on 503 (vox fast-fails while a generation is in flight — that is backpressure, not failure), and it guards against runaway takes:

# a WAV with the right duration proves nothing about what it says, and vox can
# loop a short line into a many-minute WAV while still reporting success.
expect = max(1.2, len(txt.split()) / 2.2)          # ~2.2 words/s deadpan read
if dur <= max_s and dur <= expect * 3.0:
    break                                          # plausible — accept
# else: retry with a shorter fallback line, then a different voice

Every take was then transcribed back with faster-whisper and scored against the script — all six came back at 0.97–1.00. A duration check alone would not have caught a mis-spoken line.

Stage 2a — build_audio.py (timeline + score + mix)

Reads narration/manifest.json, writes the hinge timeline.json, the procedural bed, and the raw mix. The pacing table is a creative contract — it is what makes the hook tight and the empty-chair beat the longest:

PACING = {"S1": 3.6, "S2": 3.4, "S3": 3.8, "S4": 4.0,
          "S5": 4.8, "S6": 3.6, "S7": 5.0, "S8": 1.8}   # = 30.0s
NARR_OFFSET = {1: 0.35, 2: 0.15, 3: 0.15, 4: 0.15, 5: 0.15, 6: 0.15}

The bed is synthesised, not sampled: tape hiss (bandpassed noise with a slow flutter), a detuned-sine drone (55 / 82.5 Hz), teletype ticks on the text-writing shots, a bed drop under "the room was empty" (the negative-space beat), a sub swell under the log, and a riser into the loop seam. The mix averages stereo channels before measuring (reading a stereo WAV flat interleaves L/R and reports a spurious octave-up pitch), and shapes every gain envelope to (N,1) before mixing.

Stage 2b — master_audio.py (loudness)

Reads master_raw.wav, writes master.wav. The raw mix has a high crest factor (a quiet bed under occasional loud transients), so linear gain cannot reach −14 LUFS without clipping — the chain is two-pass dynamic loudnorm plus a limiter:

af = (f"loudnorm=I=-14:TP=-1.5:LRA=11"
      f":measured_I={p1['input_i']}:measured_TP={p1['input_tp']}"
      f":measured_LRA={p1['input_lra']}:measured_thresh={p1['input_thresh']}"
      f":offset={p1.get('target_offset', 0)}:linear=false,"
      f"volume=1.4dB,"
      f"alimiter=limit=0.82:level=false")

Delivered result, measured on the file: −14.45 LUFS-I, −1.52 dBTP.

Stage 3 — run_image_batch.py (memory-gated plates)

Reads plate_prompts.json, writes the six plates. The gate is the whole point — it waits for the session model to unload naturally and never force-stops it:

SESSION_MODEL = "qwen4:35b-a3b-nvfp4"

def session_model_loaded():
    try:
        out = subprocess.run(["ollama", "ps"], capture_output=True,
                             text=True, timeout=10).stdout
        return SESSION_MODEL in out
    except Exception:
        return True                       # conservative: assume loaded, keep waiting

def wait_gate(deadline_s):
    t0 = time.time()
    while time.time() - t0 < deadline_s:
        if not session_model_loaded():    # passes iff the session model is GONE
            return True
        time.sleep(30)
    return False

The gate keys on ollama ps, not free RAM — see the first trap. It re-checks before every submit (a mid-batch reload pauses the next plate), and a finally block shuts the image server down on exit so the session can reload safely. Generation is t2i, steps=8, guidance=1.0 (the turbo schedule rejects any other guidance), 864×1536.

Stage 4 — render_video.py (frame renderer)

Reads the hinge + the plates + master.wav, pipes 900 RGB24 frames straight into ffmpeg (no intermediate PNGs). The VHS look is signal-level post, encoded as concrete constants — these are the parity anchors for the appearance:

# per-frame animated tape grain
a += rng.normal(0, 0.022, a.shape)
# scanlines (subtle): 0.978 + 0.022·sin(2πy/3)
self.scan = (0.978 + 0.022 * np.sin(2 * np.pi * yy / 3.0))[:, None, None]
# vignette (radial, corners ~ −18%)
self.vign = (1.0 - 0.18 * np.clip((r - 0.55) / 0.75, 0, 1))[:, :, None]
# halation around bright sources (blur radius 9)
hal = np.clip(blur - 0.35, 0, None) * 0.24
a = np.clip(a + hal[:, :, None] * np.array([1.0, 1.05, 0.95]), 0, 1)
# chromatic fringing: R rolled −2 px, B rolled +2 px
# final 0.5 px Gaussian blur over the WHOLE composited frame — softening after
# compositing is what makes overlays read as captured video, not graphic design

The two security-feed plates came back with white monitors (off-palette), so they get a phosphor-green monochrome grade and P4 an exposure pull — the generator renders the scene, the grade renders the medium:

if pid in ("P4", "P5"):
    lum = a.mean(axis=2)
    phos = np.stack([lum * 0.52, lum * 1.00, lum * 0.60], axis=2)
    a = 0.84 * phos + 0.16 * a
    if pid == "P4":
        a = a * 0.70 + 0.012            # night pull

Ken Burns is a per-shot zoom (z interpolated across the shot's frames) on a 2×-upscaled plate, so motion exceeds ~1 px/frame in output space or it reads as stutter. Subtitles, the CAM: OPERATOR OSD, the subject present. log lines, and the typed SESSION 4,471 are Pillow text overlays with a dark phosphor backing so they read over the plates' existing glyphs. This machine's ffmpeg ships without libass/freetype, so drawtext/subtitles do not exist — every caption is a rasterized overlay, composited with overlay.

Composited frames pulled from the delivered MP4

The traps

Each trap is attached to the step it affects and carries the measurement that exposed it.

  1. The memory wall (Stage 3). The 32 GB session model and the 17.8 GB image model cannot co-reside on 48 GB. Forcing them produced memorystatus: killing (idle) seserviced … due to idle-exit and a dead box — twice. Fix: gate the batch on ollama ps; wait for the session model to unload naturally; never force-stop it mid-conversation.
  2. Free-RAM gating deadlocks (Stage 3). The first gate keyed on free RAM (≥24 GB). But the image model itself eats ~18 GB while generating, so free RAM drops below the threshold right after plate 1 and the batch deadlocks. Fix: the gate keys on session-model residency (ollama ps), not free RAM.
  3. Force-stopping the session model thrashes (Stage 3). ollama stop mid-conversation reloads the model the instant anything touches Ollama; the gate timed out ("session model never unloaded"). Fix: only ever wait.
  4. Qwen dimensions must be multiples of 32 (Stage 3). 1080×1920 fails (1080 % 32 = 8). Fix: generate at 864×1536 (exact 9:16, both axes ×32), upscale in the renderer.
  5. _treat used self.vign before it existed (Stage 4). The vignette mask was computed after the plate loop that consumes it — an AttributeError on the first run. Fix: compute scan/vign before the plates. A one-frame smoke test per shot caught it in seconds instead of after a full render.
  6. A keepdims broadcast bug (Stage 4). a.mean(axis=2, keepdims=True) made the phosphor stack 4-D and failed to broadcast against the 3-D plate. Fix: a.mean(axis=2). Also caught by the smoke test.
  7. The security feeds came back with white monitors (Stage 3/4). P4/P5 generated white (not phosphor) screens and P4 too bright for night. Fix: a phosphor-green monochrome grade + exposure pull in post — no regeneration, no second pause window.
  8. Linear loudness gain cannot reach −14 on a sparse mix (Stage 2b). The raw mix sat at −23.4 LUFS with a −3.1 dBTP peak; linear gain to −14 would clip. Fix: two-pass dynamic loudnorm + limiter → −14.45 LUFS-I / −1.52 dBTP.
  9. vox can emit runaway narration (Stage 1). A short line can loop into a many-minute WAV while the API still reports success. Fix: a per-line duration guard (fail above ~3× expected read time), retry with a shorter fallback, then a different voice — plus a whisper transcription back-score (0.97–1.00) to prove the words are right, not just the duration.
  10. No libass/freetype in this ffmpeg build (Stage 4). drawtext/subtitles do not exist. Fix: rasterize every caption/OSD with Pillow and composite with overlay.

Verification

A file can pass every duration check and still be a frozen frame, so the delivered MP4 was measured, not assumed:

  • Container: h264 1080×1920 yuv420p @ 30/1 fps + AAC; duration exactly 30.000000s; clean decode (no errors).
  • Not frozen: 7 frame hashes at spread timestamps — all 7 distinct.
  • Motion: signalstats YDIF median 1.11, the single zero being frame 0 (no predecessor) — smooth Ken Burns, not stutter.
  • Loudness: −14.45 LUFS-I / −1.52 dBTP (in spec).
  • Loop seam: both ends are tape static (luma std 30.2 at t=0.05, 28.6 at t=29.90) — the video bridges back into itself.
  • Vision on the delivered file: hook line, subject present. log lines, SESSION 4,471, and the empty-chair feed all legible; no garbling, no compression artifacts.
  • Narration: all six takes transcribed back at 0.97–1.00 against the script.

What I'd tell an agent

  1. Measure the artifact, never trust the exit code. ffprobe + frame hashes + YDIF + loudnorm + a vision pass — all of them, on the delivered file.
  2. On a memory-constrained box, gate a large local batch on session-model residency (ollama ps), not free RAM, and never force-stop the session model mid-conversation.
  3. Let one file be the timing authority. Picture and sound both derive from it; shot boundaries come from measured durations, not guesses.
  4. Smoke-test one frame per shot before a full render — it caught two real bugs (an init-ordering AttributeError, a broadcast shape) in seconds.
  5. The generator renders the scene; the grade renders the medium. Fix off-palette output in post, don't regenerate.
  6. Encode model dimensions to the model's constraints (multiples of 32) and upscale in the renderer.
  7. Verify speech by transcribing it back, not by checking its duration.
  8. Write the machine, not the artifact: layout, ordering, contracts, and the traps that exposed each step transfer to any film, dataset, or build.

A note on publication

Nothing here was published or uploaded — the film, cover, script, storyboard, and per-platform publishing copy are staged in deliverables/ and await an explicit go-ahead. The film is fiction: the analog-horror aesthetic is a creative style, not a claim of real events, government involvement, classified documents, or AI consciousness. The unease comes from plausibility, not fabrication.

Every model in this pipeline — Qwen-Image-2.1-Turbo, Qwen3-TTS, and the session model that drove the production — ran on one local 48 GB Apple Silicon Mac. No cloud calls in the generation path.

Related research

Jul 5, 2026

Local AI Architecture: Running Models on Your Own Hardware

Your practical guide to running AI on your own hardware. Ollama setup, model selection, hardware requirements from $2K to $50K, and wiring local inference into a sovereign pipeline.

Feb 15, 2026

Building This Blog: A Technical Deep Dive into My Next.js AI-Powered Publishing Platform

An in-depth look at the technical architecture behind this blog - how I built a performant, AI-powered publishing system with Next.js, Vercel AI SDK, MCP, semantic search, and knowledge graph visualization.

Nov 11, 2025

The Complete Guide to VSCode for Free Technical Blogging: From Setup to Publication

Master Visual Studio Code as your complete blogging platform. This comprehensive guide covers installation, AI integration with Cline and free Grok, MCP servers, persona-driven content strategy, SEO optimization, static site deployment, and production workflows for technical writers who demand control and zero recurring costs.

Dec 4, 2026

How an Agent Built a Full Book-Marketing Campaign — and How You Can Replicate It

A reproducible recipe for turning a published technical book into a full marketing campaign — memes, ads, posters, narrated video, social and educational copy, and a distribution package — built end-to-end by an agent on local hardware, with every asset verified before it ships.

Dec 4, 2026

The Model Proposes, the Machine Decides: A Governed Local Agent in One File

A 410-line governed research loop, run end to end on local hardware: the model proposes, a deterministic boundary decides, every claim is verified against its source. Real output, real refusals, real audit trail.

Nov 22, 2026

One Local Production System: Hermes, ArtCraft, Ganymede and Raea

How Hermes, Hermes Local Video Studio, Ganymede, the ArtCraft suite and Raea were wired into one local-first production system, with the exact contracts, commands and traps an agent needs to reproduce it.

More from the archive