π΅ 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!
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.
- β 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
MusicGPT can be installed on Mac and Linux using brew:
brew install gabotechs/taps/musicgptDownload and install MusicGPT's executable file following this link.
Precompiled binaries are available for the following platforms:
Just downloading them and executing them should be enough.
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/musicgptOnce 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-exposeIf you have the Rust toolchain installed:
cargo install musicgpt --features cudaMusicGPT offers two interaction modes: UI mode and CLI mode.
Launch the premium web interface for the best experience:
musicgptThe 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
Choose models and enable GPU:
musicgpt --gpu --model melodyFor infinite streaming with melody conditioning:
musicgpt --gpu --model melody --ui-exposeTip
Use --ui-expose to access the UI from other devices on your network
docker run -it --gpus all -p 8642:8642 -v ~/.musicgpt:/root/.local/share/musicgpt gabotechs/musicgpt --ui-expose --gpu --model melodyGenerate music directly in the terminal:
musicgpt "Create a relaxing LoFi song"musicgpt "Epic orchestral music" --melody my_melody.mp3musicgpt "Ambient soundscape" --secs 0musicgpt "Jazz fusion" --secs 30 --model medium --temperature 1.5 --top-k 300musicgpt --helpAvailable 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
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.mp3Generate continuous, never-ending music:
In UI:
- Toggle the "Inf" checkbox
- Start generation for unlimited duration
In CLI:
musicgpt "Continuous ambient music" --secs 0Record melodies directly in your browser:
- Click the microphone icon
- Record your melody
- Stop recording (it auto-attaches)
- Generate music based on your recording
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
Export your compositions as:
- WAV - Lossless quality
- MP3 - Compressed for sharing
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'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
- 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 | Size | Quality | Speed | Melody |
|---|---|---|---|---|
| Small | ~1.5GB | Good | Fast | β |
| Medium | ~3GB | Better | Moderate | β |
| Large | ~6GB | Best | Slow | β |
| Melody | ~1.5GB | Good | Fast | β |
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
The code is licensed under a MIT License, but the AI model weights are licensed under CC-BY-NC-4.0 License.
Model sources:
- https://huggingface.co/facebook/musicgen-small
- https://huggingface.co/facebook/musicgen-medium
- https://huggingface.co/facebook/musicgen-large
- https://huggingface.co/facebook/musicgen-melody
Made with β€οΈ by Emmanuel Djagbley
