Project Breakdown

Stem Splitter

Build a web application that lets users upload audio files and automatically split them into separate stems using the Demucs AI model.

Role
Software Engineer
Tools
PythonFlaskDemucsNext.jsTypeScriptWaveSurfer.jsAWS S3Google Cloud PlatformVercel Blob Storage

Overview

Stem Splitter is a web application that allows users to upload .mp3 or .wav files and automatically split them into two or four separate audio stems using the Demucs AI model. The processed stems are delivered as downloadable links hosted on AWS S3.

System Architecture

  1. Audio files upload to Vercel Blob Storage, then download to a local VM for processing.
  2. Python and CLI commands trigger the Demucs model in 2-stem or 4-stem configuration.
  3. Generated stems upload to AWS S3; resulting links return to the frontend.
  4. Users upload files via UI; files store temporarily on Vercel Blob Storage with 24-hour auto-deletion.
  5. Frontend sends the file URL and stem mode selection to the backend via POST request.
  6. Within 2–3 minutes, users receive processed stem links.
  7. Playback is enabled with interactive waveforms powered by WaveSurfer.js.

Key Challenges

Running ML Models on a Budget

The Demucs model requires a minimum of 8GB RAM, which eliminated AWS Lambda (capped at 6GB). Google Cloud Functions was selected for its higher memory support and serverless operation — no always-on virtual machines to maintain.

Handling Large File Uploads and Long Processing Times

Vercel's default 4MB upload limit proved insufficient for audio files. Vercel Blob Storage enabled larger uploads, but processing timeouts remained an issue. Deploying the frontend on Google Cloud resolved this by supporting extended request durations.