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π
| Flag | What it adds | Fetch first |
|---|---|---|
(default) | Playback, DSP analysis, rule-mapped worlds | β |
ml | CLAP zero-shot moods, embedding-ranked placement, Demucs stems | scripts/fetch-clap.sh (~78 MB) |
llm | WorldRecipe generation + agent scene builder | scripts/fetch-bonsai.sh (~5.2 GB, into the shared ~/.local/share/localgpt/models/llm/) |
llm-metal | Apple-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π
| Part | License |
|---|---|
| LocalGPT Verse code | Apache License 2.0 |
| Marcellus & Hanken Grotesk fonts | SIL Open Font License 1.1 |
3D model pack & starter music (verse-assets) | CC0 1.0 (public domain) |
| Bonsai-8B LLM weights | Apache-2.0 |
| CLAP audio model weights | CC-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.