Development

DevelopmentπŸ”—

Build, test, and package LocalGPT Verse β€” plus the map of what’s inside.

Repository layoutπŸ”—

localgpt-verse/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs           app wiring, schedules, states
β”‚   β”œβ”€β”€ theme.rs          design tokens + the world-mood registry
β”‚   β”œβ”€β”€ hud.rs            now-playing, progress, hints, three-state fade
β”‚   β”œβ”€β”€ overlays/         onboarding, pause, queue, settings, credits, library
β”‚   β”œβ”€β”€ playback.rs       transport signals, the ownership ladder
β”‚   β”œβ”€β”€ audio.rs          kira playback, live tap, pause/end-of-track
β”‚   β”œβ”€β”€ analysis.rs       symphonia β†’ realfft: tempo, grid, sections, mood
β”‚   β”œβ”€β”€ world.rs          procedural backdrop, cameras, time-dilation
β”‚   β”œβ”€β”€ world_assets.rs   manifest pack, placement, LOD, embeddings
β”‚   β”œβ”€β”€ ml.rs             CLAP zero-shot mood + embeddings  (feature: ml)
β”‚   β”œβ”€β”€ demucs.rs         stem separation + curves          (feature: ml)
β”‚   β”œβ”€β”€ llm.rs            WorldRecipe generation            (feature: llm)
β”‚   └── agent.rs          tool-calling scene builder        (feature: llm)
β”œβ”€β”€ assets/               fonts, models (synced), ml/, llm/
β”œβ”€β”€ scripts/              fetch-*.sh model fetchers, bundle.sh
└── website/              verse.localgpt.app, the landing page

Threading is channels-and-atomics only across boundaries (the single shared-state exception is a microsecond Mutex around the audio manager). No unsafe, no GPL dependencies.

Feature flagsπŸ”—

FlagWhat it addsFetch first
(default)Playback, DSP analysis, rule-mapped worldsβ€”
mlCLAP zero-shot moods, embedding-ranked placement, Demucs stemsscripts/fetch-clap.sh (~78 MB)
llmWorldRecipe generation + agent scene builderscripts/fetch-bonsai.sh (~5.2 GB, into the shared ~/.local/share/localgpt/models/llm/)
llm-metalApple-Silicon GPU inference for the LLM tiers (macOS only)same as llm

CI compiles both optional tiers so they can’t rot, and every tier falls back to the rule-derived world when its model is absent.

Smoke testπŸ”—

Boots through every screen, then exits β€” the fastest way to catch a broken overlay:

VERSE_SMOKE=1 cargo run                    # walk every screen, then quit
VERSE_SMOKE=1 VERSE_SHOT=/tmp cargo run  # + save verse-hud.png / verse-overlays.png

:::note

Screenshot readback can intermittently return black frames on some machines (that’s why Photo mode retries). A consistent black frame is a scene bug, not the flake β€” check the logs.

:::

Perf stress testπŸ”—

VERSE_STRESS=5000 cargo run --release   # 5000 extra props, fps log, exit after 30s
VERSE_STRESS=0 cargo run --release      # control run: report only

Runs uncapped so the numbers show true frame cost. On the dev machine (2026-07): baseline world ~60 fps, ~1k props β‰ˆ 14 fps, 5k β‰ˆ 9 fps β€” CPU-side entity overhead dominates, so ~70–90 props is the comfortable ceiling until real instancing lands. Treat dense-pack budgets as measured, not promised.

PackagingπŸ”—

scripts/bundle.sh   # assembles dist/: release binary + fonts + models from verse-assets

The 171-model CC0 pack lives in the separate verse-assets repository; fetch_polyhaven.py downloads it and writes the manifest (with a semantic kind per asset β€” 19 kinds), normalize.py packs each model to a single uncompressed .glb (bevy_gltf supports neither quantized nor meshopt-compressed geometry) and syncs the manifest-referenced set into assets/models/.

Architecture at a glanceπŸ”—

                 Bevy main thread                        other threads
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ UI (hud.rs, overlays/)                   β”‚   β”‚ kira audio thread (cpal)  β”‚
β”‚   reads: Playback, Beat, Theme, Comfort  β”‚   β”‚   StreamingSound decode   β”‚
β”‚   writes: intent resources (Paused, …)   β”‚   β”‚   TapEffect: energy/onset β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚   β†’ AtomicU32 (lock-free) β”‚
β”‚ Transport (audio.rs systems)             │◄───                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Signals (playback.rs advance_playback)   β”‚   β”‚ import scan thread        β”‚
β”‚   ladder: simulation β†’ live tap β†’ grid   │◄───   walkdir+lofty β†’ mpsc    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ World (world.rs, world_assets.rs)        β”‚   β”‚ analysis worker thread    β”‚
│   procedural ambient + manifest props    │   │   symphonia→realfft→tempo │
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   /sections/energy/mood   β”‚
                                               β”‚   β†’ mpsc, JSON sidecars   β”‚
                                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The full review β€” load-bearing decisions, findings, and the LLM tier details β€” lives in ARCHITECTURE.md; milestone status in PLAN.md.

LicensesπŸ”—

PartLicense
LocalGPT Verse codeApache License 2.0
Marcellus & Hanken Grotesk fontsSIL Open Font License 1.1
3D model pack & starter music (verse-assets)CC0 1.0 (public domain)
Bonsai-8B LLM weightsApache-2.0
CLAP audio model weightsCC-BY-NC-4.0 β€” non-commercial only

The optional model downloads (scripts/fetch-*.sh) carry their own licenses; the asset manifest records every model’s source, author, and license, and the in-app Credits & Licenses screen renders it.