llmbience · Python + PyTorch · one GPU · a browser dashboard
LLMbience
LLMbience is a local studio for continuously generated music. Give it a prompt and a model, and it generates clip after clip on the GPU while a sample-clock renderer plays them back without gaps, to the room's speakers and to any browser listening. A dashboard steers it: prompts, presets and rotations, a mixer for live inputs, rhythmic guides, a melody lane, and command tracks that turn a shell pipeline into sound.
Architecture
Everything that decides anything is in one engine: settings, presets, the generation queue, rotations and a lease on the GPU. Dashboards in any number of browsers, and the CLI, are clients of it; none holds state of its own. Model inference runs in a guarded worker process, so a crash, a stall or a thermal cutoff ends a job, not the studio, and playback is a single sample-clock renderer whose output goes both to the sound server and to browsers, so there is never a second player to drift.
- Three models, one interface. MusicGen small (a 300M music-token generator with its text encoder and audio codec) and ACE-Step 1.5 Turbo and Base, switched at runtime while the current audio keeps playing. Each keeps its own settings and drafts over one shared library.
- Warm, but bounded. At most two compatible models stay resident, and only after a measured headroom check; each process caps its allocator at half the GPU's memory.
- Exactly one GPU, never a guess. The worker sees one device, checks its architecture before allocating a tensor, and refuses rather than falling back to the CPU.
- Guarded by temperature. A junction threshold, a continuous duration and a cutoff, edited from the dashboard, plus an independent native watchdog. Inspecting health never starts generation or audio.
Generation and playback
Playback and generation are separate controls. Play plays ready audio and never starts inference; Automatic keeps a bounded queue of ready clips filled; Compose asks for one. The studio can start fully idle, with no audio and no model loaded, and a paused transport freezes the playhead without pretending the gain is zero.
Earlier, with 30-second clips, the first call took 13.1 seconds including the model load and the next two 2.7 and 1.7 seconds. These are measurements of a small window, not tail-latency guarantees, and the project says so.
Clips and continuation
Automatic composes independent whole clips with short edge fades, and if a new one is late it loops the last good clip rather than going silent. The experimental Continue action instead extends what is playing: the model hears the end of Now as an audio prefix and only the new audio is published. Keep extending makes that the automatic mode.
Dashboard and mixer
Live inputs
Pulse sources on any server, or a browser's microphone, loopback or tab audio over HTTPS, feed a captured reference. It can condition generation (ACE Base verifiably follows future guide audio), be mixed in as the original at its own level, or add an RMS-gated suffix to the prompt when the room is loud. Capture is always opt-in; one browser owns the stream and other tabs observe without asking for a device.
Rhythm and melody
A rhythm workbench lays guide voices on an editable grid: sixteenths by default, triplets and dotted notes, swing, eleven voices with their own envelope, delay and reverb. A melody lane plays a piano phrase on the same clock. Guides can be monitored without being heard by the model, or heard by it without being monitored.
Command tracks
An owner-authenticated Bash command can generate raw PCM on an interval and feed the same mixer, so a script becomes an instrument. Ordinary music permission never grants shell authority: the command-track API needs a separate owner capability, while the music controls are open to anyone who can reach the studio, by design.
Two buses
True output and Monitor output have their own faders, and the monitor can be muted while keeping its level, without changing what the model is conditioned on. A final safety ceiling keeps the mix from clipping when guides, melody and commands pile on.
Acceptance gates
The first probe wrote down its acceptance before it ran, and the studio has kept the habit: every feature has an acceptance file and a validation note. The original gates were these:
| Gate | Evidence required |
|---|---|
| AG-01 | Exactly one visible GPU, the expected architecture and PCI identity, and correct FP16 matrix multiplication |
| AG-02 | Finite, non-silent generated PCM and a playable WAV |
| AG-03 | At least one generation from the previous raw audio tail, with the context removed exactly once |
| AG-04 | Real time: each chunk adds more new audio than its generation took |
| AG-05 | A human listens for character, continuity and response to the prompt |
AG-04 is a measured gate: a run can produce audio and still fail it. AG-05 stays unverified until someone listens, because waveform statistics are not a perceptual evaluation. Long-term musical continuity, stem control and a quality ranking between the models are explicitly not claimed.