build-small-hackathon/tutori
βοΈ Tutori β your whiteboard tutor
π¬ Demo
<video src="https://huggingface.co/spaces/build-small-hackathon/tutori/resolve/main/tutori_demo.mp4" controls width="100%"></video>
([demo video file](./tutori_demo.mp4) β narrated by Tutori's own voice; music synthesized from scratch.)
Speak a question. Tutori researches it, then teaches you out loud while sketching the idea on a whiteboard β in real time, stroke by stroke, in sync with its voice.
Built for the HF Build Small Hackathon: every model runs on this Space itself via ZeroGPU. No cloud APIs, no keys.
Why Backyard AI π‘
I built Tutori for my parents. They're quite behind on today's technology β especially AI β and the firehose of new models and jargon is impenetrable from the outside. With Tutori they can just ask: "what is Gemma?", "what happened in AI this month?" β and get a patient, spoken explanation, drawn out on a whiteboard, at their pace, with the research done for them. They've actually been using it, and they find it genuinely useful for finally keeping up.
The stack (Ξ£ 16.9B params β well under the 32B cap)
Gemma teaches. MiniCPM plans and coaches. Every turn, MiniCPM5 1B decides whether the question needs fresh facts and writes the search queries β the agentic step that turns a chatbot into a researcher. Gemma 4 then teaches from what was found, Higgs speaks it, Whisper listens. And after every lesson, MiniCPM comes back as the study coach: it updates the learner's profile and writes three personalized follow-up questions that land on the sticky notes under the chat β tap one and the lesson continues where your curiosity points.
Engineering notes (the honest kind)
- We tried to ship Nemotron ASR as the ears β three separate times. NeMo in the main process crashes ZeroGPU's forked workers ("GPU task aborted"); lazy-loading inside the worker costs a fresh worker its whole turn (we re-measured on June 12 with a dedicated probe Space: 57.1 s just to restore the 0.6B streaming model, against a 59 s turn budget, paid every turn because workers are disposable); and a CPU sidecar measured RTF β 24. So Whisper turbo keeps the ears β it preloads with everything else and transcribes in about a second.
- Higgs Audio v3 TTS ships only for the SGLang-Omni serving stack (needs a persistent GPU), so we use v2 β same family, natively in transformers.
- The live whiteboard now has a deterministic diagram specialist between Gemma and the renderer. When the lesson lands on a known teaching family (rockets to orbit, gradient descent, Pythagorean theorem, neural networks, photosynthesis, supply/demand, binary search, recursion, rainbows, water cycle), Tutori compiles the board from hand-authored diagram ops instead of asking a language model to freehand coordinates. Unknown topics still use the model's drawing, then pass through the same no-overlap layout engine.
- We LoRA-fine-tuned two dedicated whiteboard artists on a purpose-built dataset (tutori-whiteboard-lessons: 7,109 gold lesson steps, 8 diagram families, 78 topics, every one validated to render with zero overlapping elements). Both are integrated behind a
TUTORI_BOARD_MODELflag β and the flag is off. The honest scorecard: - **Nemotron 3 Nano 4B artist** (eval loss 0.021): can't run here β Nemotron-H's Mamba-2 layers need the fused
mamba-ssmTriton kernels, which ZeroGPU's fresh-per-turn workers can't JIT inside the 59 s turn budget (the pure-PyTorch fallback OOMs at prefill instead). The same constraint broke Nemotron's earlier role as research planner β which is how MiniCPM5 1B got the job, and it turned out to be excellent at it. - **Gemma 4 12B artist** (eval loss 0.024, rides the already-loaded teacher as a LoRA): this one DID run live on ZeroGPU, and drew textbook diagrams on eval topics β correct loss-curve axes, properly labelled hypotenuses. But in real use it lost to the boring pipeline: the artist never sees the researched facts (only the topic and narration), so current-events lessons got improvised geometry, and sharing one model for narration + rendering serialized the turn past the GPU window. We kept the better teacher. On a persistent GPU (
TUTORI_REAL=1locally) both artists work β flip the flag and they draw. ZeroGPU giveth, ZeroGPU taketh away.
How a turn works
- You talk (or type). Whisper turbo transcribes you on-device.
- MiniCPM plans. MiniCPM5 1B decides whether the question needs fresh facts; if so it writes the search queries and Tutori pulls snippets + page text from the web (DuckDuckGo, keyless). Timeless topics skip straight to teaching.
- It teaches in steps. Gemma 4 emits a JSON lesson script β each step is a sentence to say plus whiteboard ops to draw (boxes, arrows, curves, axes, highlights in a 100Γ75 coordinate space). A semantic board layer upgrades high-confidence topics into deterministic textbook diagrams before the layout pass.
- Steps stream. The moment the first step's JSON closes, Higgs Audio voices it and ships it to your browser β Tutori starts talking while the rest of the lesson is still being generated.
- The board draws itself in sync. A hand-drawn canvas renderer animates each stroke across exactly the duration of that step's audio β and when a lesson is drawing-heavy, the agent expands the whiteboard to take over the page, nudging the rest of the UI aside until the next lesson.
- The coach debriefs. MiniCPM5 updates your learner profile and swaps the sticky notes for three follow-up questions tailored to what you just learned.
The smart context system
- Learner profile β Tutori keeps gentle notes (level, goals, what clicked, what confused you) that it updates every turn and folds into the next lesson. Stored only in your browser (
BrowserState), fully inspectable and erasable in the UI. - Pace dial β 1 (total beginner, tiny steps, analogies) β 5 (expert, dense). Injected straight into the teaching prompt.
- It can see your drawings β sketch on the board with the pen tools and hit βπ Ask Tutori about the boardβ: Gemma 4βs vision reads your strokes.
Running it
- On Spaces (the real thing): select ZeroGPU hardware. All four models load at startup and get packed by ZeroGPU; each turn runs in a single
@spaces.GPU(duration=59)generator call, sized so even logged-out visitors (120s/day ZeroGPU quota) get a full lesson. Sign in to Hugging Face for much more daily GPU time. - Locally (no GPU needed):
pip install gradio soundfile numpy && python app.pyruns a mock engine so you can play with the whiteboard, voice flow, and UI. SetTUTORI_REAL=1on a CUDA machine to use the real models.
Submission
- Space: you're looking at it π
- Demo: the video at the top of this card (file)
- Social Media Post: https://x.com/SSHTheDev/status/2065159474671653005
Merit badges claimed
- π Off the Grid β zero cloud model APIs; the only network egress is optional keyless web search, and you can switch that off too.
- π¨ Off-Brand β a full "teacher's studio" design system over Gradio: chalkboard scene, hand-chalked header, paper cards with washi tape, sticky-note suggestion chips, marker-cap toolbar, self-hosted fonts (zero external requests) β plus the custom hand-drawn whiteboard renderer (vanilla canvas, ~600 lines of sketchy-stroke drawing) and an agent-controlled expanding board.
- π€ Sharing is Caring β verbatim agent traces from live sessions are published in `traces/`: the Nemotron planner's search queries, every spoken sentence, and every whiteboard op with coordinates, timestamped.
- π Field Notes β a full write-up of what we built and learned, published on the hackathon org blog: Building Tutori, a Whiteboard Tutor That Draws While It Talks (source: docs/field-notes.md).
- π― Well-Tuned β we LoRA-fine-tuned TWO whiteboard artists (Nemotron 3 Nano 4B and Gemma 4 12B) on a purpose-built, programmatically validated dataset (tutori-whiteboard-lessons) and published all three. Both run flag-gated (
TUTORI_BOARD_MODEL=nemotron|gemma); the Gemma artist was A/B-tested live on this very Space and honestly retired β full scorecard in the engineering notes above.
