All Lab projects

AI-Assisted Presentation Pipeline

Pythonpython-pptxmatplotlibLocal LLM

Problem

An earlier attempt at model-generated presentations failed for a structural reason, not a content one: the model was doing rendering engineering live, inside the same run that was supposed to produce a deck. A single equation layout problem turned into a five-hour debug loop with no checkpoint to fall back to, and the run never finished. The fix wasn't a better prompt -- it was separating "what goes on the slide" from "how a slide gets rendered" into two things that never touch each other in the same run.

Architecture

The renderer is built once and frozen -- the model never edits it. Instead the model reads a curriculum spec, maps each slide to one of 31 reusable layouts from a fixed design system, and writes a single JSON "deck plan" against a strict schema. A separate, already-tested Python pipeline validates that plan and turns it into a real .pptx, slide by slide, checkpointing after every single one so a crash or a bad slide never costs the whole run.

Technical depth

The harder problem was equations: Google Slides has no native math engine at all, and silently drops PowerPoint's real equation format on import. I built a tiered equation system -- editable native PowerPoint equations (via a hand-rolled LaTeX-to-OMML converter covering algebra through multivariable calculus) for people who will edit the deck in PowerPoint, and matplotlib-rendered images with the source LaTeX kept alongside for anything that has to look correct in Google Slides. Tables are native PPTX table objects rather than positioned text boxes, so they import as real, editable tables. A structural validator rejects unknown layouts, out-of-bounds content, and malformed regions before anything renders, and every build produces PNG contact sheets so a human reviewer can check a full deck visually in one pass instead of opening it slide by slide.

Outcome

Validated end-to-end on a real curriculum module, both hand-authored and model-authored, with the model's plan checked structurally against a hand-built reference before build. The equation set is covered by a dedicated regression test, and the design produces a deck that is correct in Google Slides on the first render, not after manual cleanup.

Takeaways

Constraining what the model is allowed to touch produced a more reliable result than trusting it with more freedom. Once the model's job shrank to "write one JSON file against a schema," failures became small, visible, and cheap to fix -- exactly the property the first attempt was missing.