← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/5.7-explainer-video-model.md · view on GitHub ↗

PRD — Structured explainer compiler + visual-planner specialist

Goal

Build the smallest useful “explainer video” system: prompt or document → script → storyboard DSL → deterministic SVG/Canvas renderer → MP4 with captions + voiceover. NOT a competitor to Sora/Runway. The first useful version is a visual-planning specialist plus a renderer, not a pixel-generative model.

Tier-5 research arc. Ordered after A1-B8 (specialist track) and 5.3 (VL). Comes last because it depends on both: the specialist training discipline + the text↔visual integration pattern.

Why now (in this PRD: when 5.7 is finally next)

Scope — in

The compiler architecture:

source document / prompt
  → lesson script (LLM-generated)
  → storyboard scenes (constrained JSON / DSL)
  → visual DSL (objects, labels, arrows, equations, timeline)
  → deterministic renderer (SVG / Canvas / Manim-style)
  → captions + voiceover + MP4

Concrete artifacts:

PieceWhat
Storyboard DSLJSON schema with concepts, equations, diagrams, timings, camera/stroke actions (constrained by grammar)
Renderer (V1)SVG/Canvas frames → ffmpeg → MP4. Manim-style API later.
Visual-planner specialistSFT/LoRA model: prompt/doc → storyboard DSL. This is the first trainable model.
Asset libraryShapes, arrows, axes, code blocks, graph layouts, simple physics/math primitives
Data pipelinePair open lessons/transcripts/docs with generated or human-edited storyboards
Eval setHeld-out concepts; rubric for factual correctness, visual grounding, pacing, label consistency, equation validity
Editing loopUser can regenerate one scene, lock script, lock diagrams, export MP4

Model ladder (V1 = level 1; V2 = level 2; level 3+ = future):

  1. No learned video model: use a strong text model (or cloud model) to produce the DSL; render deterministically. Validates product + schema fast.
  2. Tiny visual-planner specialist: finetune tinygpt or HF-loaded base on prompt/doc → DSL.
  3. Visual critic / evaluator: model scores whether scene frames match the script, flags bad labels / missing objects / impossible diagrams.
  4. Optional diffusion/image/video model: decorative assets only, after deterministic explainer path works.

Scope — out (for V1 + V2)

Files to touch

FileChange
Sources/TinyGPTModel/StoryboardSchema.swiftnew — JSON schema definition + validator
Sources/TinyGPT/Storyboard.swiftnew — prompt-doc → DSL CLI (V1: uses a cloud or strong-local model; V2: a trained specialist)
Sources/TinyGPT/RenderScene.swiftnew — DSL → SVG → MP4
Sources/TinyGPT/TrainVisualPlanner.swiftnew (V2) — finetune recipe for the visual-planner specialist
assets/explainer-primitives/new directory — open-license shapes / icons / equations
web/src/pages/storyboard-preview.astronew (V1) — drag-drop the DSL JSON, render preview frames in-browser
docs/research/explainer-video-results.mdnew — V1 + V2 results
docs/PLAN.md5.7 ⬜ → ✅ on V2 ship

Don’t touch

Acceptance criteria (V1 — no learned visual planner)

Acceptance criteria (V2 — learned visual planner)

Reference patterns

Open questions