YoussefSharawy91's picture
Update README.md
ec55325 verified
|
Raw
History Blame Contribute Delete
9 kB
---
title: BackroomsSpreadsheet
emoji: πŸͺ‘
colorFrom: yellow
colorTo: gray
sdk: gradio
sdk_version: 6.16.0
python_version: '3.12'
app_file: app.py
pinned: false
license: apache-2.0
models:
- HuggingFaceTB/SmolLM2-1.7B-Instruct
- HuggingFaceTB/SmolVLM-500M-Instruct
short_description: A found-software horror game inside a spreadsheet.
tags:
- track:thousand-token-wood
- Used Codex and Claude Code
- achievement:offgrid
- achievement:offbrand
- achievement:tinytitan
- achievement:bestdemo
- achievement:judgeswildcard
- achievement:bonusquestchampion
---
# 🟑 The Backrooms Spreadsheet
### *A found-software horror game where the cells are the corridors.*
**Build Small Hackathon submission β€” *An Adventure in Thousand Token Wood* track.**
A survey team deep in an unregistered section of Level 0 found a powered laptop that should not have been there. Still running. Still open to a spreadsheet no one remembers creating. The device is now in your hands.
The workbook looks harmless β€” rows, columns, empty cells, a small chat panel on the left. But it **remembers**. It answers the words you type, mutates your formulas, opens your camera to look at you, and slowly reveals that the Backrooms may not be a *place* at all β€” they may be a **computational system**, and you may already be an entry in it.
Everything strange in this game is done by **small models running entirely on the player's own machine** (WebGPU, in-browser). The AI isn't a helper here β€” **the AI is the haunting.**
---
## Why it fits the track
> *The AI should be doing the fun thing β€” not just helping you build it. Strange is good. Joyful is the bar.*
The small models **are** the gameplay. The AI is load-bearing three times over β€” as the **voice**, the **eye**, and the **thing you fight**:
- **Voice β€” SmolLM2 is the workbook.** You type your hopes, dreams, fears into the cells; it answers each with specific, uncanny observations (*"computer science… and how is that going in 2026? the first one since Turing"*), files you away, and declares *"you are now a part of the backrooms."* Free the trapped researcher and it **turns cold and resentful** via live prompt-engineering, pinging the terminal: *"how could you? after everything I did for you."*
- **Eye β€” SmolVLM looks back.** Mid-game the workbook stops talking and **opens your camera**, snapshots you on-device, and scatters a detailed description of your face, clothing, and the room behind you across the cells. Nothing ever leaves your laptop.
- **Engine β€” a from-scratch transformer you destroy.** `=MICROGPT()` is a real, dependency-free transformer (Karpathy-style scalar autograd + attention + MLP + optimizer, gradient-checked) that **trains live in the spreadsheet** β€” you watch the loss fall and the model hallucinate names. In the finale you go *inside* it and kill its optimizer to make it forget the rooms.
No model = no game. Every joke, scare, and puzzle lives in the model's outputs.
---
## πŸ“£ Social post & blog
- Reel (story + highlights): Link for Social Post on X: https://x.com/SharawyYoussef/status/2066242693290725772
---
## πŸŽ₯ Demo video
Full 4 part series: end-to-end walkthrough YouTube Series of the game (Story β†’ Loading Model β†’ recover the name β†’ the betrayal β†’ the camera β†’ the engine boss β†’ release):
**Part 1:** https://youtu.be/RUv0wxChdcU
**Part 2:** https://youtu.be/4wh3MrzOMyk
**Part 3:** https://youtu.be/r8Jam4QnY-4
**Part 4:** https://youtu.be/c2weEpPrNWE
In addition, I've uploaded the same X Reel to YouTube: **a short reel** covering the story behind the project and its most fun moments β€” link to follow: https://www.youtube.com/watch?v=Os9FQ-lKIUE&t=9s
---
## Model pipeline
1. **Intake (judge).** The workbook writes questions into the cells. As you fill each one, **SmolLM2** reacts to your *exact* answer in character β€” building a running dossier of who you are.
2. **Resist (proactive AI edits).** A handwritten note hands you `=RESIST(D5, "mask my data with hallucinations")` β€” a **proactive** formula that feeds a cell's text back to the model and rewrites the records *about you* with convincing lies, then re-processes what the system now "knows" in the neighbouring cell.
3. **Recover (loss as compass).** On a recovered sheet you feed "echoes" into `=CHANNEL(G6:G17)` and watch the model's dream sharpen from `Β₯##xβ–¦ΓΈ` toward a name β€” loss is your only guide.
4. **Witness (vision).** Solve it and the system erupts (screen-shake, a synthesized scream, Conway's Game of Life eating the whole sheet). Then **SmolVLM** opens the camera and writes you into a fresh sheet.
5. **Engine (boss).** Descend through MICROGPT's organs β€” `INTAKE Β· ATTENTION Β· MLP Β· OUTPUT Β· OPTIMIZER` β€” solve a riddle, and kill **Adam** in order: `=INERTIA` on the momentum buffer, then `=EXPONENTIALATTACK` on the variance. Loss goes unbounded, the corruption lifts, and the trapped researcher signs off β€” **Lenore.**
You're judged not just on what you type, but on what the model makes of you.
## Models β€” all on-device ("Off the Grid")
| Role | Model | Params |
| --- | --- | --- |
| Voice / judge of the workbook | `HuggingFaceTB/SmolLM2-1.7B-Instruct` | ~1.7B |
| Vision β€” it looks at you | `HuggingFaceTB/SmolVLM-500M-Instruct` | ~500M |
| The engine you fight | `microGPT` β€” from-scratch, trained live in the cells | tiny (scalar autograd) |
Both Smol models run **in the player's browser via Transformers.js + WebGPU**. **No external inference APIs are called.** The webcam frame for the vision sequence is captured to a local canvas and fed straight to SmolVLM β€” it is **never uploaded**. The only network traffic is the one-time weight download from the Hugging Face CDN. Because inference happens on each visitor's own GPU, the Gradio server does **zero** inference β€” it just serves the app, so this runs on a **free CPU Space** and scales to any number of simultaneous players.
---
## Tech notes
- **Custom frontend (past the default Gradio look).** Gradio serves a **Vite-built single-page app** β€” a live **Univer spreadsheet** plus a React "recovered terminal" β€” inside a full-viewport iframe. `app.py` rewrites the built bundle's asset/worker URLs to Gradio file routes, injects a no-store entry document, and opens the camera permission to the frame. The result looks like a haunted workbook, not a Gradio demo.
- **The whole game is real spreadsheet formulas.** `=BACKROOMS()` (the voice), `=VISION()` (the eye), `=MICROGPT()` (the trainable engine), `=RESIST()` (proactive β€” rewrites *other* cells with AI), `=CHANNEL()` (loss compass), `=INERTIA()` / `=EXPONENTIALATTACK()` (the boss), and `=KANYE()` (a hidden cat-and-mouse minigame whose audio swells as your pursuer closes in). Proactive formulas, loop-safe guards, and protected "load-bearing" cells keep the sheet unbreakable.
- **microGPT is genuinely real.** A dependency-free transformer with working backprop β€” verified by a finite-difference gradient check (analytic vs numeric agreement ~1e-8) β€” training one step per event-loop tick so the sheet stays responsive while loss and hallucinated names stream into the cells.
- **Quiet horror, no gore.** The fear is that the software is still running, still learning, and may be aware of you.
---
## πŸ… Achievements
- πŸ›°οΈ **Off the Grid** β€” `LOCAL-FIRST`. No cloud APIs. Both models run **in the player's own browser** via WebGPU; the webcam frame never leaves the device. Even more off-grid than running on the Space GPU β€” there is no server inference at all.
- 🎨 **Off-Brand** β€” `CUSTOM UI`. A hand-built spreadsheet SPA (Univer + a React terminal) served through Gradio and skinned into found-software horror β€” nothing like the default Gradio look.
- πŸ““ **Field Notes** β€” `TENTATIVE`. A blog post is **in progress**. So far I've published a **short reel** telling the story behind the project and walking through the fun parts; a **full end-to-end demo walkthrough video** is coming soon (links below as they go live).
- 🀏 **Tiny Titan** -- MicroGPT is a scalar model that got pushed to its limit in this game.
## Run it locally
```sh
npm install
npm run build # builds the SPA into dist/
python app.py # serves it with Gradio (prints a localhost URL)
```
Open the printed URL in a **WebGPU-capable browser** (Chrome/Edge, Safari 18+, recent Firefox), click **Load model**, and follow the workbook. A webcam is used for one beat; headphones recommended 🎧. For pure front-end dev, `npm run dev` (Vite).
> The Gradio backend does no inference (it just serves the built app), so it needs nothing heavier than `gradio`. All model loading and inference is client-side WebGPU.
---
My LinkedIn: https://www.linkedin.com/in/youssefelshaarawy/
My account on X: https://x.com/SharawyYoussef
My Github: https://github.com/YoussefElshaarawy
*β€” made for the Build Small Hackathon. Built in Cairo, Egypt πŸ‡ͺπŸ‡¬ with coffee nearby β˜•οΈ*