HUB
Sign inSign up
sleepy-presentations logo

sleepyboy/sleepy-presentations

By sleepyboy

•Updated about 16 hours ago

Talk into a mic, get a Manim video synced to your words. Learns as you use it.

Image
0

139

sleepyboy/sleepy-presentations repository overview

SleepyPresentations mascot: a sleepy kid in a nightcap at a laptop

⁠SleepyPresentations

Talk into a microphone. Get back an animated video whose visuals land exactly when you say them.
One button. No slides. And it gets better every time you use it.

Docker pulls Image size Docker build Python 3.12 Manim Claude Agent SDK

A rendered presentation: a clock and slide cards for 'how long per deck?', then bars for 4 hours, 2 hours and 5 minutes growing exactly as each number is spoken, with the spoken words highlighted underneath
Real output. The caption shows what was said; every bar grows on its number.


⁠What it does

You record a short talk in the browser (or upload audio). A few minutes later you have a Manim⁠ video, the animation engine behind 3Blue1Brown, made for your words:

  • In sync with your voice. Every word gets a timestamp, and every animation is anchored to a spoken phrase. When you say "four hours", the four-hour bar grows.
  • Shows, doesn't subtitle. Numbers become charts and counters, lists become reveals, processes become flows, comparisons become side-by-sides. It never invents data you didn't say.
  • Learns as you use it. Every technique it builds is saved to a knowledge library of tested, reusable components. The next talk reuses it instead of inventing it again, so the more you use it, the less it has to invent.
  • Checks its own work. The AI director renders preview frames and looks at them before finishing. Nothing enters the library unless it renders.
  • Wears your brand. Name, logo, fonts, colours and a video footer come from one folder, so you can dress it up for any organization.

Pipeline: Record, Transcribe (Whisper, a time per word), Direct (Claude writes the scene), Render (synced to your words), Learn (Claude keeps what's new). The knowledge library feeds Direct and is updated by Learn, only with techniques that render.

⁠Quick start (Docker)

docker run -d --name sleepy -p 5050:5050 \
  -e SLEEPY_AUTH=api_key -e ANTHROPIC_API_KEY=sk-ant-... \
  -v sleepy-data:/app/data \
  -v sleepy-library:/app/knowledge_library \
  -v sleepy-models:/home/app/.cache/huggingface \
  sleepyboy/sleepy-presentations

Open http://localhost:5050⁠, press the button, and talk. Try a script from test_monologues/⁠ for your first run. The first recording downloads the speech model (~150 MB, kept in the sleepy-models volume).

Or, from a clone of this repo:

cp .env.example .env        # pick how to connect to Claude (below)
docker compose up -d        # builds the image, keeps data, library and models in volumes

The volumes matter: /app/knowledge_library is the part that learns. Keep it in a volume and it carries over between upgrades; without one, it resets with the container.

Recording needs microphone access, which browsers only grant on localhost or HTTPS. On a remote server, put it behind HTTPS, or use upload audio instead.

⁠Connecting to Claude

The AI stages use the Claude Agent SDK⁠. There are three ways to connect it:

UseSetNotes
API keySLEEPY_AUTH=api_key · ANTHROPIC_API_KEY=sk-ant-…Pay per use (console.anthropic.com⁠). The right choice for anything other people use.
Your Claude subscription, in DockerCLAUDE_CODE_OAUTH_TOKEN=…Run claude setup-token on your own machine and paste the token. Personal use.
Your Claude subscription, running locallynothing (default SLEEPY_AUTH=login)Uses whatever account claude login signed into, e.g. your company's Claude login at work.

The home page shows which account is connected, or exactly what's missing. In login mode, a stray ANTHROPIC_API_KEY in your shell is ignored rather than silently winning.

⁠Run it locally (macOS)

brew install ffmpeg pango pkg-config cairo librsvg   # Manim's native deps (+ SVG logos in footers)
brew install --cask font-inter                       # the default video font
python3 -m venv .venv && source .venv/bin/activate   # Python 3.10+
pip install -r requirements.txt
cp .env.example .env
claude login                                         # if you use your Claude login
python app.py                                        # → http://localhost:5050

The app: a sidebar of past presentations, the SleepyPresentations wordmark and mascot, and one big record button

Using it: record, or upload audio (anything ffmpeg reads: m4a, mp3, wav, even a .mov), or drag a file onto the page. A silent visual metronome helps you pace yourself. Finished videos play in sync with your audio in the page; stitch makes a single downloadable .mp4.

⁠How it works

StageWhat happens
Transcribefaster-whisper⁠ runs locally and gives every word a start and end time.
DirectA Claude agent reads the transcript and the knowledge library, writes a beat plan and a Manim scene, renders preview frames, looks at them, and fixes what's wrong.
RenderManim renders the scene, timed to your words. Failures go back to the director for repair.
LearnA second agent compares the scene to the library: new techniques become components, variants generalize existing ones. The pipeline renders every change itself and quarantines or reverts anything broken.

The audio is the clock. Scenes never hard-code seconds; they anchor to words:

class Presentation(SyncedScene):
    def construct(self):
        chart = bar_chart(["By hand", "Template", "Sleepy"], [240, 120, 5],
                          value_texts=["4 hrs", "2 hrs", "5 min"])
        show_chart_frame(self, chart, self.t("how long"))
        reveal_bar(self, chart, 0, self.t("four hours"))      # grows as you say it
        reveal_bar(self, chart, 1, self.t("two hours"))
        reveal_bar(self, chart, 2, self.t("five minutes"), emphasize=True)
        self.finish()                                         # hold until the audio ends

The knowledge library (knowledge_library/) is plain files: one folder per technique, with a description the director reads, the code, and a standalone Example that must render. It starts with a handful of seeds (titles, bullet reveals, bar charts, counters, flows, wipes) and grows from there. Maintenance tools:

python -m tools.library stats      # coverage, usage, never-used items
python -m tools.library test       # render every component (catches rot after upgrades)
python -m tools.library dupes      # near-duplicate detection
python -m tools.library review     # Claude writes a merge / generalize / gaps report

⁠Make it yours: branding

The same app in two brands: the default dark SleepyPresentations look with the mascot, and a light 'Acme Analytics' example brand with its own logo, font and orange accent

A brand is one folder: brand.json plus a logo and fonts. It sets the app's name, logo, favicon, fonts and colour theme, light or dark, and the rendered videos: their colours, font, and an optional footer with a logo, title and date, like a company slide deck.

SLEEPY_BRAND=acme    # brands/acme/, or a path. In Docker, mount it: -v ./acme:/app/brands/acme:ro

Start from brands/_example/⁠. Full reference: docs/branding.md⁠.

⁠Configuration

Environment variables, or a .env file (.env.example⁠).

VariableDefault
SLEEPY_AUTHloginlogin or api_key, see Connecting to Claude⁠
ANTHROPIC_API_KEYused when SLEEPY_AUTH=api_key
CLAUDE_CODE_OAUTH_TOKENsubscription token from claude setup-token (Docker)
SLEEPY_BRANDdefaultbrand folder name or path
SLEEPY_WHISPER_MODELbase.ensmall.en is more accurate, slower
SLEEPY_RENDER_QUALITYml 480p15 · m 720p30 · h 1080p60 · k 4K
SLEEPY_CLAUDE_MODELaccount defaulta specific Claude model id
SLEEPY_DIRECT_MAX_TURNS / SLEEPY_LEARN_MAX_TURNS60 / 40agent budgets
HOST / PORT127.0.0.1 / 50500.0.0.0 in Docker

⁠Documentation

How every mechanism works, written for humans: docs/⁠: the pipeline⁠, sync⁠, the knowledge library⁠, agents & auth⁠, branding⁠, operations⁠, and running without AI⁠.

⁠Notes for hosting it for others

  • Use an API key (SLEEPY_AUTH=api_key). A Claude subscription is for your own use.
  • The agents write and run Python to render scenes. The container is the sandbox: run it as provided (non-root, nothing mounted read-write but the volumes).
  • It's one process with an in-process job queue and one shared library. That's fine for a person or a small team. A multi-tenant service would want a real queue, per-user data, and per-tenant brands.
Tag summary
Recent tags
Content type
Image
Digest
sha256:831dd73d2…
Size
614.5 MB
Last updated
about 16 hours ago
docker pull sleepyboy/sleepy-presentations:latest