Audio & music generation
The whole AudioCraft stack, running on a single 24GB card
MusicGen, AudioGen, MAGNeT, JASCO, EnCodec, MultiBand Diffusion and AudioSeal all ship from one repo. Installing it is harder than running it — VRAM is not your bottleneck.
AudioCraft · self-hosted
AudioCraft is Meta FAIR's open audio-generation research library: MIT code, CC-BY-NC 4.0 weights. What ships is not one model but a whole chain. EnCodec compresses 32kHz waveforms into 4 codebooks of discrete tokens at 50 frames per second. MusicGen is a single-stage autoregressive Transformer that predicts those tokens directly. MultiBand Diffusion can replace the EnCodec decoder to reconstruct cleaner audio from the same tokens. AudioSeal stamps a sample-level watermark on the result. Add the non-autoregressive MAGNeT, text-to-sound AudioGen, and chord- and drum-conditioned JASCO, and one repository covers compression, generation, decoding and provenance end to end.
The VRAM numbers first, because that is what most people actually came for. AudioCraft's loaders.py contains a hard rule: if the device is cpu use float32, otherwise use float16. Put it on a GPU and the language model runs in fp16, period. musicgen-small's state_dict.bin is 840MB, musicgen-medium is 3.68GB, musicgen-large is 6.51GB, and every size shares the same 236MB compression_state_dict.bin holding the EnCodec weights. The docs give a single blanket figure — at least 16GB of GPU memory for inference with the 1.5B medium models — which is deliberately conservative, assuming full 30-second stereo plus batch headroom. A single 30-second mono generation will not OOM medium on a 12GB card, and large has plenty of room on 24GB.
What actually stops people is the dependency wall. requirements.txt pins torch==2.1.0, torchvision==0.16.0, torchtext==0.16.0, xformers<0.0.23, numpy<2.0.0, av==11.0.0 and spacy==3.7.6. The official torch 2.1.0 wheels top out at CUDA 12.1 and only compile up to sm_90, while torchtext was archived by PyTorch in September 2025 with a final 0.18 release that supports Python 3.11 at most. So: Python must be 3.9–3.11, and your GPU must be Ampere, Ada, Hopper or older, because Blackwell's sm_120 simply has no kernels under these pins. That is not bad engineering — the last commit landed in March 2025 and the dependency world kept moving without it. Every recommendation below is shaped by that fact.
01 —
What is actually inside AudioCraft
Main is 1.4.0a2; the PyPI stable release is still 1.3.0. All weights live under the facebook org on Hugging Face
| Version | Parameters | VRAM | Context | Notes |
|---|---|---|---|---|
| MusicGen small / medium / large (plus stereo variants) | 300M / 1.5B / 3.3B | fp16 weights 0.84GB / 3.68GB / 6.51GB; plan for 8GB / 16GB / 24GB in practice | 30 seconds (1503 tokens; EnCodec 32kHz, 4 codebooks @ 50Hz) | The workhorse text-to-music model. Stereo checkpoints were fine-tuned 200k steps from the mono ones, interleaving two token streams with the delay pattern — double the token budget, so slower and hungrier for the same duration. Meta names medium as the best quality-versus-compute trade-off. |
| MusicGen-melody / melody-large | 1.5B / 3.3B | fp16 weights 3.68GB / 6.51GB, plus 2–3GB headroom for Demucs | 30 seconds, extendable via extend_stride windowing | Takes a reference melody as chroma conditioning through generate_with_chroma(). Note that it invokes Demucs for source separation before extracting chroma — an extra memory and latency cost that most VRAM budgets forget to include. |
| MusicGen-Style | 1.5B (medium only) | roughly 3.7GB of fp16 weights; budget 16GB per the docs | 30-second output, style excerpt of 1.5–4.5 seconds | Uses a short audio clip as a style prompt. The knobs that matter are eval_q (1–6, how tightly it clings to the reference audio) and double classifier-free guidance via cfg_coef_beta (1–9, how far the text description overrides the style). This is the one for 'give me something in the vibe of this'. |
| MAGNeT / audio-magnet | 300M / 1.5B, each with 10s and 30s checkpoints | comparable to MusicGen at the same size; docs say 16GB for the 1.5B tier | Fixed 10s or 30s; audio-magnet runs at 16kHz | Non-autoregressive masked generation — it does not emit one token at a time, so its latency profile is nothing like MusicGen's. Reach for it when you want interactive, low-latency drafts. The catch: duration is baked into the checkpoint, with no sliding-window continuation. |
| AudioGen-medium | 1.5B (medium is the only release) | about 3.5GB in fp16; docs say 16GB | 16kHz EnCodec, 4 codebooks @ 50Hz, 5 seconds by default and configurable | Text-to-sound rather than text-to-music: dog barking, emergency sirens, footsteps in a corridor. Meta states plainly that the released architecture differs from the AudioGen paper, traded for faster generation. This is the one for game and film sound-effect libraries. |
| JASCO chords-drums / chords-drums-melody | 400M / 1B | roughly 0.8GB / 2GB in fp16 by parameter count; a 12GB card is enough | Fixed 10 seconds | The temporally-conditioned model added in 1.4.0a2, taking text plus a chord progression plus a drum track plus optional melody at once. The price is building chord_extractor from source, and Deepsalience on top for melody conditioning — by far the most painful install path in the repo. |
02 —
Which GPU to rent
Check architecture before VRAM: the cu121 wheels for torch 2.1.0 only compile up to sm_90, so pick around that line
Prompt iteration and bulk drafting on musicgen-small and MAGNeT-small
RTX 3090 24GB$0.193/GPU-hr
sm_86 is natively covered by the cu121 wheels, a 300M model will never fill 24GB, and this is the cheapest VRAM per dollar on the list — ideal for the high-frequency, low-intensity work of grinding through prompts.
Final renders on musicgen-large 3.3B, 30-second stereo, several in parallel
RTX 4090 24GB$0.540/GPU-hr
6.51GB of fp16 weights plus the doubled stereo KV cache fits in 24GB with room to spare, and sm_89 is the last consumer generation cu121 supports — while still being the fastest single-card autoregressive decoder at this price.
Adding the MultiBand Diffusion decoder for quality, or fine-tuning small/medium
RTX A6000 48GB$0.817/GPU-hr
MBD keeps four diffusion models resident alongside MusicGen and runs multi-step denoising, so it costs both memory and time on top. 48GB means you never have to choose between enabling MBD and raising batch size.
Full fine-tuning of musicgen-medium, or multi-GPU Dora training grids
A100 SXM4 80GB$1.088/GPU-hr
Full AdamW on 1.5B costs roughly 18GB in optimizer state and fp32 master weights before activations and EnCodec, which makes 48GB tight. A100's sm_80 is a first-class citizen on torch 2.1.0, and a node here takes up to 14 GPUs for distributed Dora runs.
03 —
From bare instance to first audio file
Four steps — the one that breaks people is the version pinning in step one
- 01
Spin up an instance on a Python 3.9–3.11 PyTorch image
Launch an RTX 4090 24GB at console.nexgpu.net and pick a base PyTorch image from the 2,000+ prebuilt ones. The critical move is dropping torch back to the pinned 2.1.0 on cu121: torchtext 0.16.0 pairs only with torch 2.1.0, and torchtext itself was archived in September 2025 with a final 0.18 release capped at Python 3.11. Installing this stack on Python 3.12 cannot work — that failure is not your fault.
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121 - 02
Install AudioCraft itself, and FFmpeg
The PyPI stable release stops at 1.3.0 from June 2024, which has MAGNeT and MusicGen-Style but no JASCO — for JASCO you need main at 1.4.0a2. Pin numpy below 2.0 first or spacy 3.7.6 and av 11.0.0 will fail in a cascade. FFmpeg replaced torchaudio for audio I/O back in 1.1.0, so without it even saving a wav will fail.
apt-get install -y ffmpeg && pip install "numpy<2.0.0" && pip install -U git+https://github.com/facebookresearch/audiocraft#egg=audiocraft - 03
Pull the weights, render your first 30 seconds
get_pretrained() fetches state_dict.bin and compression_state_dict.bin from Hugging Face — about 6.75GB total for the large tier. Set AUDIOCRAFT_CACHE_DIR to a data volume rather than the system disk so you are not re-downloading after every restart. audio_write with strategy='loudness' normalises levels and hands you a usable master straight away.
python -c "from audiocraft.models import MusicGen; from audiocraft.data.audio import audio_write; m=MusicGen.get_pretrained('facebook/musicgen-large'); m.set_generation_params(duration=30); w=m.generate(['lo-fi hip hop, warm rhodes, vinyl crackle, 82 bpm']); audio_write('out', w[0].cpu(), m.sample_rate, strategy='loudness')" - 04
On newer GPUs, take the transformers route instead
If you rented something Blackwell like the RTX 5090 32GB, sm_120 has no kernels in the cu121 wheels for torch 2.1.0 and the official pins are a dead end. Switch to MusicgenForConditionalGeneration in Hugging Face transformers, which runs on any modern torch. The trade-off: no melody, style, MAGNeT or JASCO — just the base MusicGen tiers, still under the same 1503-token (30-second) ceiling.
pip install torch --index-url https://download.pytorch.org/whl/cu128 && pip install -U transformers scipy
What a batch of demos actually costs
Real arithmetic: 100 clips of 30-second stereo from musicgen-large. Rent an RTX 4090 24GB at $0.540/GPU-hr. Spend the first hour installing dependencies, pulling the 6.51GB state_dict.bin plus the 236MB compression_state_dict.bin, and rendering the first clip; then run four hours of batch generation. That is 5 hours x $0.540 = $2.70. Budget 30GB of storage for weights, conda environment and outputs — at the $0.414/GB-month median, keeping it three days costs 30 x 0.414 x 3 / 30 = $1.24. Each 30-second 32kHz 16-bit stereo WAV is 32000 x 2 x 2 x 30, about 3.84MB, so 100 of them is roughly 384MB; at the $0.0081/GB median egress rate that is 0.375 x 0.0081, about $0.003. Total: $3.94. To go cheaper, swap in a Tesla V100 32GB at $0.188/GPU-hr and the same five hours costs $0.94 — it is sm_70 with real FP16 tensor cores, natively supported on torch 2.1.0, and 32GB swallows 6.51GB of weights easily, though it has no bf16 and no modern attention kernels, so raw decode is slower than a 4090. For full fine-tuning of musicgen-medium, an A100 SXM4 80GB at $1.088/GPU-hr for 10 hours is $10.88. Everything meters per second and prices per hour, compute billing stops the moment the instance stops, and there is no minimum, no setup fee and no quota request — just remember that storage keeps billing until you destroy the volume.
04 —
Frequently asked questions
How much VRAM does MusicGen really need? Is the official 16GB figure accurate?
Why does pip install audiocraft keep throwing dependency conflicts?
Can I use MusicGen output commercially?
Why is MusicGen capped at 30 seconds, and can I generate longer tracks?
Can an RTX 5090 run AudioCraft?
Is AudioCraft still maintained? Is it still worth using?
Start building on NexGPU
Enterprise R&D team or solo developer — either way, your first job can be running in minutes.
Sign up to browse live network pricing. No payment method required.
