Files
ai-engineering-from-scratch/phases/07-transformers-deep-dive/05-full-transformer
Rohit Ghumare 533fe6be8d feat(site): interactive lesson figures + KV-cache sizer (#265)
* feat(site): interactive lesson figures + KV-cache sizer

Adds an in-lesson interactive figure layer. Authors drop a fenced block in
docs/en.md:

    ```figure
    kv-cache
    ```

which the lesson renderer hydrates into a real widget (sliders, live output),
theme-aware via the site's CSS vars. First widget: a KV-cache sizer — drag
sequence length, batch, layers, kv-heads, head-dim, dtype and watch the cache
size cross a single GPU's memory. Wired into 07/12 (KV cache & FlashAttention).

Mechanism: `figure` fenced block -> <div class="lesson-figure" data-figure>,
mounted by lesson-figures.js after render. No deps; figures live in lessons,
not on the homepage. Validated interactivity + light/dark parity.

* feat(site): animated figures in lesson content + delegate from fenced block

The fenced ```figure``` block now mounts both interactive widgets (defined in
lesson-figures.js) and the animated SVG explainers (figures.js), via one
syntax. Embeds animated figures directly in lesson bodies:

- attention-matrix  -> 07/02 self-attention
- transformer-block -> 07/05 full transformer
- tokenizer-bpe     -> 10/01 tokenizers
- kv-cache-sizer    -> 07/12 (interactive sliders)

Animated figures render live in normal browsers and fall back to a clean
static frame under prefers-reduced-motion. Validated all four mount via the
lesson path; light/dark parity.

* docs(07/02): replace ASCII pipeline with mermaid flowchart
2026-06-07 10:58:35 +01:00
..