Skip to main content

🎵 Sound & Music

MusicGen

MusicGen is Meta's open-source AI model that turns text descriptions into music, released in 2023 and now able to generate stereo audio. It runs on your own machine or in the browser, which makes it a favorite playground for researchers, hobbyists and game developers who want royalty-free generated music.

Quick Facts

Developer Meta AI (FAIR)
First released June 2023
Latest version MusicGen 1.5 (2025)
Language Python with PyTorch
License Code is MIT; model weights are CC-BY-NC 4.0
Pricing Free and open source

What is MusicGen?

MusicGen is a generative model from Meta's AI research lab that creates original music from text prompts. You type something like 'upbeat electronic dance track with a driving bassline' and the model produces a coherent piece of audio that matches the description. It was announced in June 2023 alongside the AudioCraft toolkit, which also includes AudioGen for sound effects and EnCodec for compression.

The model works by compressing audio into discrete tokens with a neural codec, then predicting those tokens with a transformer, the same family of architectures behind modern language models. It was trained on a huge dataset of licensed and public music, which is why the output actually sounds musical rather than like random noise.

MusicGen 1.5, released in 2025, added stereo generation with controllable outputs, including the option to specify the left and right channels separately. Because the code is open source, you can run it locally, fine-tune it, and build tools on top of it without paying anything.

Key Features

  • Text-to-music generation from natural language prompts
  • Multiple model sizes, from small and fast to large and detailed
  • Stereo generation with channel-specific prompts in MusicGen 1.5
  • Melody conditioning: hum or play a melody and generate around it
  • Runs locally on GPU, with CPU and browser demos available
  • Part of the AudioCraft toolkit with AudioGen and EnCodec
  • Hugging Face integration for easy downloads and demos

How to get started

The fastest way to try MusicGen is the Hugging Face demo space, where you type a prompt, pick a model size and wait a minute for audio. No installation needed, and you can download the result right away.

For local use, install the audiocraft package from the GitHub repository, then generate with a few lines of Python. You will want a GPU for the larger models; the small model can run on CPU, just slowly. Check the model cards on Hugging Face for the exact installation steps and hardware requirements.

  • Try the MusicGen demo on Hugging Face Spaces
  • Install the audiocraft package with pip
  • Write a prompt and generate your first track in Python
  • Experiment with model sizes: small, medium, large, stereo
  • Use the melody conditioning feature to build on your own tune

Use cases

  • Royalty-free music for game jams and indie game prototypes
  • Background music for videos, streams and podcasts
  • Research and experimentation in AI music generation
  • Songwriting inspiration: sketch ideas before recording
  • Education: learning how generative audio models work

Pricing and licensing

MusicGen is completely free to use and the code is MIT licensed, so you can modify and build commercial tools with the code itself. The model weights, however, are released under CC-BY-NC 4.0, which means non-commercial use only.

That non-commercial clause matters: you can use MusicGen to generate music for personal projects and research, but selling tracks generated with the official weights requires a commercial license from Meta. If you want guaranteed royalty-free commercial music, services like Mubert or Suno offer paid tiers, or you can train or fine-tune your own model on licensed data.

Pros and cons

MusicGen is one of the best open-source music models available, with genuinely musical output, melody conditioning and now stereo. Being open source means total control: run it offline, tune the prompts, fine-tune the weights, and build it into your own pipeline for free.

The main catches are hardware and licensing. Good results need a decent GPU and patience, generation can be slow on consumer machines, and the CC-BY-NC weights block commercial use. Output quality also varies with prompt skill: vague prompts give vague music.

Alternatives

  • Stable Audio: commercial AI music from Stability AI with a free tier
  • Suno: full songs with vocals, hosted in the browser
  • Mubert: endless royalty-free generative streams and API
  • Riffusion: steerable browser-based music generation
  • AIVA: AI composition aimed at soundtracks and scores

Resources

What is New?

By continuing to use the site, you agree to the use of cookies.