Skip to content

DjagbleyEmmanuel/MusicGPT

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

317 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MusicGPT MusicGPT logo

🎡 Advanced AI Music Generation with Melody Conditioning, Infinite Streams, and Premium Features

Generate music based on natural language prompts using LLMs running locally with GPU acceleration.

MusicGPT.demo.mp4

☝️ Turn up the volume!

Overview

MusicGPT is a premium music generation application that runs the latest AI music models locally with exceptional performance. No Python, no heavy ML frameworksβ€”just pure, optimized music generation on any platform.

Powered by MusicGen by Meta, MusicGPT brings professional-grade music generation to your fingertips with groundbreaking features like melody conditioning, infinite audio streams, and advanced tuning controls.

✨ Key Features

  • βœ… Text-conditioned music generation - Natural language prompts
  • βœ… Melody-conditioned generation - Upload audio files (WAV/MP3) to influence the output
  • βœ… Infinite music streams - Continuous, never-ending audio generation
  • βœ… Microphone recording - Record melodies directly in the browser
  • βœ… Advanced tuning controls - Temperature, Top-K, and Guidance Scale parameters
  • βœ… Multiple output formats - Export as WAV or MP3
  • βœ… GPU acceleration - CUDA support for blazing-fast inference
  • βœ… Chat-based UI - Premium web interface with history and playback
  • βœ… Multiple models - Small, Medium, Large, and Melody variants

Install

Mac and Linux

MusicGPT can be installed on Mac and Linux using brew:

brew install gabotechs/taps/musicgpt

Windows

Download and install MusicGPT's executable file following this link.

All platforms

Precompiled binaries are available for the following platforms:

Just downloading them and executing them should be enough.

Docker (Recommended for CUDA)

If you want to run MusicGPT with a CUDA-enabled GPU, Docker is the best option. You only need basic NVIDIA drivers installed.

docker pull gabotechs/musicgpt

Once the image is downloaded, run it with:

docker run -it --gpus all -p 8642:8642 -v ~/.musicgpt:/root/.local/share/musicgpt gabotechs/musicgpt --gpu --ui-expose

With cargo

If you have the Rust toolchain installed:

cargo install musicgpt --features cuda

Usage

MusicGPT offers two interaction modes: UI mode and CLI mode.

UI Mode (Recommended)

Launch the premium web interface for the best experience:

musicgpt

The UI provides:

  • 🎨 Premium chat interface with modern design
  • πŸ“ Persistent chat history across sessions
  • 🎡 In-browser audio playback with controls
  • 🎀 Microphone recording for melody conditioning
  • πŸŽ›οΈ Advanced tuning controls (Temperature, Top-K, Guidance Scale)
  • πŸ“¦ Multiple export formats (WAV, MP3)
  • ♾️ Infinite stream mode for continuous generation
  • πŸš€ Background processing for smooth UX

Advanced Options

Choose models and enable GPU:

musicgpt --gpu --model melody

For infinite streaming with melody conditioning:

musicgpt --gpu --model melody --ui-expose

Tip

Use --ui-expose to access the UI from other devices on your network

With Docker (CUDA)

docker run -it --gpus all -p 8642:8642 -v ~/.musicgpt:/root/.local/share/musicgpt gabotechs/musicgpt --ui-expose --gpu --model melody

CLI Mode

Generate music directly in the terminal:

Basic Generation

musicgpt "Create a relaxing LoFi song"

With Melody Conditioning

musicgpt "Epic orchestral music" --melody my_melody.mp3

Infinite Streaming

musicgpt "Ambient soundscape" --secs 0

Advanced Tuning

musicgpt "Jazz fusion" --secs 30 --model medium --temperature 1.5 --top-k 300

All CLI Options

musicgpt --help

Available options:

  • --model - Choose model size (small, medium, large, melody)
  • --melody - Path to melody audio file (WAV/MP3)
  • --secs - Duration in seconds (0 for infinite)
  • --temperature - Sampling temperature (0.1-2.0)
  • --top-k - Top-K sampling (1-500)
  • --guidance-scale - Classifier-free guidance (1.0-10.0)
  • --output-format - Export format (wav, mp3)
  • --gpu - Enable CUDA acceleration

Warning

Larger models require significant RAM and GPU memory

New Features

🎼 Melody Conditioning

Upload any audio file (WAV or MP3) to condition the generation:

In UI:

  • Click the upload icon
  • Select your melody file
  • Generate music that follows your melody's structure

In CLI:

musicgpt "Energetic rock song" --melody guitar_riff.mp3

♾️ Infinite Streams

Generate continuous, never-ending music:

In UI:

  • Toggle the "Inf" checkbox
  • Start generation for unlimited duration

In CLI:

musicgpt "Continuous ambient music" --secs 0

🎀 Microphone Recording

Record melodies directly in your browser:

  1. Click the microphone icon
  2. Record your melody
  3. Stop recording (it auto-attaches)
  4. Generate music based on your recording

πŸŽ›οΈ Advanced Tuning

Fine-tune generation with professional controls:

  • Temperature (0.1-2.0): Controls randomness

    • Lower = More consistent
    • Higher = More creative
  • Top-K (1-500): Sampling diversity

    • Lower = More focused
    • Higher = More varied
  • Guidance Scale (1.0-10.0): Prompt adherence

    • Lower = More freedom
    • Higher = Stricter prompt following

πŸ“¦ Multiple Formats

Export your compositions as:

  • WAV - Lossless quality
  • MP3 - Compressed for sharing

Benchmarks

The following graph shows inference time for generating 10 seconds of audio using different models on a Mac M1 Pro, compared to Python/transformers:

Command used:

musicgpt '80s pop track with bassy drums and synth'

Storage

MusicGPT stores models, generated audio, and metadata locally:

  • Windows: C:\Users\foo\AppData\Roaming\gabotechs\musicgpt
  • MacOS: /Users/foo/Library/Application Support/com.gabotechs.musicgpt
  • Linux: /home/foo/.config/musicgpt

Technical Details

Architecture

  • Backend: Rust with ONNX Runtime for optimal performance
  • Frontend: React + TypeScript with premium UI components
  • Audio Processing: Symphonia (decoding) + Lame (MP3 encoding)
  • GPU: CUDA support via ONNX Runtime

Model Support

Model Size Quality Speed Melody
Small ~1.5GB Good Fast ❌
Medium ~3GB Better Moderate ❌
Large ~6GB Best Slow ❌
Melody ~1.5GB Good Fast βœ…

Contributing

Contributions are welcome! This fork includes:

  • Melody conditioning with MP3 support
  • Infinite streaming with sliding window
  • Microphone input
  • Advanced tuning parameters
  • MP3 export
  • Modern UI with premium features

License

The code is licensed under a MIT License, but the AI model weights are licensed under CC-BY-NC-4.0 License.

Model sources:


Made with ❀️ by Emmanuel Djagbley

About

Generate music based on natural language prompts using LLMs running locally

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 69.5%
  • TypeScript 27.2%
  • CSS 2.0%
  • Dockerfile 0.5%
  • Shell 0.3%
  • JavaScript 0.3%
  • HTML 0.2%