← TinyGPT · docs · devlog · roadmap · speedup
source: docs/gallery_v2_plan.md · view on GitHub ↗

Gallery v1.5 and v2 — build plan

The browser playground ships v1 of the gallery: four bundled .bin checkpoints (Shakespeare, TinyStories, Python, Q&A chat) served from browser/public/gallery/. This doc lays out the next two iterations: v1.5 (more diverse-data models, same hosting) and v2 (R2-backed, larger catalog).

Roadmap context: levers 17 (gallery) and 18 (diverse data structures).

v1.5 — “show what the architecture actually learns”

The four v1 models all train on English prose or English-adjacent text. The point of the architecture is that the same network can learn any local + long-range pattern — but the gallery doesn’t make that visible. v1.5 adds three models that demonstrate structure beyond natural language.

Models to add

#ModelCorpusOutput proves
5Sheet musicABC-notation folk tunes (~5-10 MB)the model learns musical phrase structure
6CSV / tabularSynthetic structured data (1.5 MB)column rhythm, header repetition, value ranges
7Chord sheetsLyric + chord lines (~1 MB)the chord-above-lyric vertical convention

Each entry follows the v1 template:

Why these three

What v1.5 explicitly does NOT add

Prompt prefills per model

manifest.json already supports a prompt field used by loadGalleryCard in main.ts to pre-fill the prompt input. Suggested defaults:

sheetmusic    "T:"                       # ABC tune-title header
csv           "id,name,value\n1,"        # invites a row continuation
chords        "[Verse 1]\n"              # invites verse generation

Hosting decision for v1.5

Stay bundled in browser/public/gallery/. Adding three models at ~18MB each = ~54MB extra. With v1’s 4 models (~70MB total), v1.5 brings the public directory to ~125MB. Cloudflare Pages’s bundle limit is 25MB per file but no project-wide cap (verified). Caching works via the .bin-extension rename trick documented in README.md. Defer R2 until v2.

v2 — R2-backed, expandable catalog

v1.5 hits the bundled ceiling. v2 moves to Cloudflare R2 with the same manifest pattern but the models live behind a CDN.

What changes

Catalog targets for v2

Open the gallery to ~10-15 models without bloating the bundle:

The community flow is the structural feature that makes v2 worth doing — v1.5 you can ship by hand-running three more train_gallery_one.mjs invocations. v2 lets the gallery grow without your wall time.

Implementation sketch

browser/
├── public/gallery/manifest.json        # has v1 + v1.5 entries with `url` to R2
├── src/main.ts                         # loadGalleryCard fetches `url` if present
├── src/storage.ts                      # already caches by id, unchanged
└── community_corpora/                  # PR-able corpus directory
    ├── README.md                       # corpus format + submission rules
    └── <yourname>.txt                  # submitted corpus

.github/workflows/
└── train_community_corpus.yml          # runs train_gallery_one.mjs on
                                        # PR-added corpora, uploads .bin
                                        # to R2, opens a manifest-update PR

What v2 explicitly does NOT do

Mac app crossover

If the parked Mac app work reopens (see docs/parked/app-polish.md and the historical mac_app_plan.md), the same artifact manifest can power its gallery dialog. Browser and Mac app both pull identical .tinygpt files from the chosen artifact store; the local OPFS cache (browser) and ~/Library/Caches/TinyGPT/ (Mac) keep cold-fetches rare.

No file-format change needed — .tinygpt is already the shared contract. The manifest’s url field is just as resolvable from Swift’s URLSession as from fetch.

Sequencing

Don’t ship v1.5 and v2 together.

  1. v1.5 first. Three more training runs, manifest update, ship. ~2-3 days of wall time (mostly training) but maybe 4 hours of human work. Validates the “show the architecture, not just English” pitch.
  2. R2 setup separately. Create the bucket, upload v1’s existing .bin files, manually update the manifest’s url fields, verify cold-load + cache hit. ~half a day. This is the v2 plumbing without the community flow.
  3. Community submission flow last. This is a real feature with real engineering — GitHub Actions, corpus validation, R2 upload credentials, manifest PR automation. ~1 week. Worth doing only if v1 and v1.5 get measurable usage; otherwise it’s infrastructure for nobody.

Open questions for you to answer