02 / AI LEARNING LAB
A browser-based AI course where you operate a real model, not chat with one.
Real embeddings, attention weights, and gradients — computed live in your tab via transformers.js and WebLLM. 22 chapters across 6 worlds, from 'what is a vector' to inspecting a 1B model's next-token distributions. No chatbot anywhere in the learning path.
AI education tools either explain concepts through prose and static diagrams, or hand the learner a chatbot and call it interactive. Neither makes the underlying mechanics legible. The harder problem is making real model internals — attention weights, hidden states, gradient flow — directly manipulable in a browser without faking the output, and keeping the experience testable and offline-capable at the same time.
Game logic is separated from rendering by design: every level's parameters, pass criteria, and star bands live in schema-validated JSON under /data/games. Engines are pure TypeScript (no React, no DOM) that expose a standard prepare / initState / applyAction / evaluate interface — models are injected via the prepare step, never imported directly, which is why the whole test suite (732 tests) runs offline in ~1 second with no model downloads. The app injects real transformers.js wrappers (embeddings, BPE tokenization, causal LM, attention extraction, hand-rolled TinyNet/TinyRNN) into the same code path. World 6 uses WebLLM for a local 1B instruct capstone, with an optional Ollama Cloud escalation proxied server-side so the API key never reaches the browser. Zustand persisted to IndexedDB owns progress; a dual-signal sync manager (navigator.onLine + a real HEAD probe) queues activity locally and syncs on reconnect.
- Engines are pure functions — models injected via prepare(config, deps), never imported — so 732 unit tests run fully offline while the app uses real transformers.js models in the identical code path
- JSON-driven curriculum: levels, pass thresholds, and star bands in schema-validated JSON; a pre-dev validator catches malformed configs before the browser ever sees them
- A calibration script plays every pure-computation level optimally and reports unreachable thresholds — caught 4 levels that could never be won and 2 that could be gamed by degenerate strategies
- Worlds 1–5 work entirely offline after first load — model weights in Cache Storage, progress in IndexedDB, activity queued locally; the service worker caches the shell but deliberately not model weights to avoid doubling storage cost
A browser-native AI education platform where every visualization is backed by a real computation — no invented probabilities, no pre-baked answer keys. 22 chapters with 732 passing tests, full offline support for Worlds 1–5, and a curriculum validation pipeline that prevents broken levels from shipping.