Open-source AI-powered audio stem separation SaaS. Separate vocals and instrumentals from any audio track using state-of-the-art machine learning models running on GPU.
- AI Stem Separation - Extract vocals and instrumentals using BS-Roformer model
- Producer Mode - Advanced settings for music producers (vocal modes, de-reverb, noise gate, de-esser)
- BPM & Key Detection - Automatic audio analysis
- Credit System - Built-in billing with Stripe integration
- Serverless GPU - RunPod serverless for cost-effective GPU processing
- Real-time Status - Live job status updates
apps/
βββ api/ # FastAPI backend (REST API, auth, job management)
βββ worker/ # Job processor (polls jobs, calls RunPod, post-processing)
βββ runpod/ # RunPod serverless handler (GPU stem separation)
βββ web/ # Next.js frontend (dashboard, auth, payments)
βββ infra/ # Docker Compose for local development
- User uploads audio file β API validates and stores in Supabase Storage
- Worker polls for pending jobs and sends audio to RunPod
- RunPod runs BS-Roformer on GPU for stem separation
- Results uploaded to Supabase Storage, user downloads stems
- Next.js 16 - React framework with App Router
- TailwindCSS - Utility-first CSS
- Radix UI - Accessible UI components
- Framer Motion - Animations
- Supabase Auth - Authentication
- FastAPI - Modern Python API framework
- Supabase - PostgreSQL database & storage
- Stripe - Payments & subscriptions
- RunPod Serverless - GPU-as-a-Service (scale to zero)
- BS-Roformer - State-of-the-art audio separation model
- audio-separator - Python library for model inference
- Railway - Deploy API, Worker, and Web services
- RunPod - Serverless GPU workers
- Supabase - Managed PostgreSQL & Storage
- Docker - Containerization
- Docker & Docker Compose
- Node.js 18+
- Python 3.11+
- Supabase account
- RunPod account
- Stripe account (for payments)
-
Clone the repository
git clone https://github.com/iamhmh/stemx.git cd stemx -
Set up environment variables
cp .env.example apps/infra/.env # Edit apps/infra/.env with your credentials -
Start services with Docker Compose
cd apps/infra docker compose up --build -
Access the app
- Frontend: http://localhost:3000
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Create apps/infra/.env with:
# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
SUPABASE_JWT_SECRET=your-jwt-secret
# RunPod
RUNPOD_API_KEY=your-runpod-api-key
RUNPOD_ENDPOINT_ID=your-endpoint-id
# Stripe
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_xxx- Create a new Railway project
- Add services from the
apps/directories:apps/apiβ FastAPI serviceapps/workerβ Python worker serviceapps/webβ Next.js frontend
- Configure environment variables for each service
- Deploy!
Each service includes nixpacks.toml for Railway auto-detection.
-
Build and push Docker image
cd apps/runpod docker build -t your-username/stemx-runpod:latest . docker push your-username/stemx-runpod:latest
-
Create RunPod Serverless Endpoint
- Go to RunPod β Serverless β Deploy
- Image:
your-username/stemx-runpod:latest - GPU: A40 (48GB) recommended
- Active Workers: 0 (scale to zero)
- Max Workers: 3
- Idle Timeout: 5 seconds
-
Configure environment variables
SUPABASE_URLSUPABASE_SERVICE_ROLE_KEY
stemx/
βββ apps/
β βββ api/ # FastAPI backend
β β βββ main.py # API endpoints
β β βββ Dockerfile
β β βββ requirements.txt
β β
β βββ worker/ # Job processor
β β βββ main.py # Job polling & orchestration
β β βββ audio_analyzer.py # BPM/Key detection
β β βββ audio_processing.py # Post-processing effects
β β βββ Dockerfile
β β
β βββ runpod/ # GPU serverless handler
β β βββ handler.py # RunPod entry point
β β βββ Dockerfile
β β
β βββ web/ # Next.js frontend
β β βββ src/
β β β βββ app/ # App Router pages
β β β βββ components/ # React components
β β β βββ lib/ # Utilities
β β βββ package.json
β β
β βββ infra/ # Docker Compose
β βββ docker-compose.yml
β
βββ .env.example # Environment template
βββ README.md
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/users/me |
Get current user |
POST |
/upload |
Upload audio for processing |
GET |
/jobs |
List user's jobs |
GET |
/jobs/{id}/download |
Get download URLs |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- BS-Roformer - Audio separation model
- audio-separator - Python inference library
- Supabase - Backend-as-a-Service
- RunPod - GPU cloud platform
- Railway - Deployment platform