Self-hosted karaoke / music player. Single user, runs on your own machine.
htdemucs) for vocal removal, ffmpeg for transcode, mutagen for tagsapi, worker, redis, webdocker run -d --name tempo \
-p 80:80 -v /srv/tempo-data:/data \
--restart unless-stopped \
awkto/tempo:latest
That's the whole stack — nginx + FastAPI + worker + redis — in one image.
Mount any host directory at /data to persist the SQLite DB, generated
karaoke stems, uploads, and cover art.
git clone https://github.com/awkto/musicmod.git
cd musicmod
cp .env.example .env
docker compose up --build
docker-compose.yml runs the four services (api, worker, redis, web)
separately so the Vite dev server can hot-reload frontend edits and the
API can be iterated without rebuilding the all-in-one image.
When everything is up:
| Service | URL |
|---|---|
| API | http://localhost:8000 |
| API docs | http://localhost:8000/docs |
| Web | http://localhost:5173 |
The data/ directory is bind-mounted and holds the SQLite DB, generated stems, uploads, download cache, and cover art. Back this directory up to keep your library + karaoke versions.
On first start the API auto-creates a demo local source named Local Music pointing at /data/tracks (i.e. ./data/tracks on the host). Drop audio files there and trigger a scan.
Drop files under ./data/tracks/ and trigger a scan:
curl -X POST http://localhost:8000/sources/1/scan
To wire up additional folders:
curl -X POST http://localhost:8000/sources \
-H 'Content-Type: application/json' \
-d '{"type":"local","name":"My Library","config":{"root_path":"/data/extra"}}'
(Mount the host path into both api and worker services first.)
Use the upload dropzone on the Sources page, or call the API:
curl -X POST http://localhost:8000/sources \
-H 'Content-Type: application/json' \
-d '{"type":"upload","name":"Drops","config":{}}'
# returns id=N
curl -X POST http://localhost:8000/sources/N/upload -F [email protected]
curl -X POST http://localhost:8000/sources/N/scan
Files land under ./data/uploads/{source_id}/.
http://localhost:8000/sources/gdrive/callback as an authorised redirect URI.client_secret.json to ./data/gdrive/client_secret.json.curl -X POST http://localhost:8000/sources \
-H 'Content-Type: application/json' \
-d '{"type":"gdrive","name":"Drive","config":{"folder_id":"OPTIONAL"}}'
http://localhost:8000/sources/{id}/gdrive/authorize, follow the URL it returns, complete OAuth.POST /sources/{id}/scan.Drive files are downloaded and cached under ./data/cache/{source_id}/ on first play.
curl -X POST http://localhost:8000/tracks/42/karaoke
# returns { id: <job_id>, status: "queued", ... }
curl http://localhost:8000/jobs/<job_id> # poll for progress
The worker runs Demucs (htdemucs, two-stem split) on the track and writes data/stems/{track_id}/karaoke.mp3 (320 kbps). Once done, GET /tracks/{id}/stream/karaoke returns the karaoke audio, and the in-app A/B toggle crossfades between original ↔ karaoke without a seek.
Demucs runs on CPU by default — fine, just slower (~30 s for a 4-min track on a modern CPU vs ~3 s on an RTX-class GPU).
To use a CUDA GPU on the same box as the rest of the stack, switch to the CUDA all-in-one image:
docker run -d --gpus all --name tempo \
-p 80:80 -v /srv/tempo-data:/data \
--restart unless-stopped \
awkto/tempo:latest-cuda
Requires the NVIDIA Container Toolkit on the host. The image auto-detects
CUDA at startup (TEMPO_DEMUCS_DEVICE=cuda is baked in).
If you want the UI to live on a small always-on host and the heavy Demucs workload on a LAN box that has a GPU, run the worker-only image pointed at the main container's Redis:
On the main (API) host, expose Redis with a password. Start the all-in-one container with:
docker run -d --name tempo \
-p 80:80 -p 6379:6379 -v /srv/tempo-data:/data \
-e TEMPO_REDIS_BIND=0.0.0.0:6379 \
-e TEMPO_REDIS_PASSWORD=choose-a-long-random-string \
awkto/tempo:latest
The container refuses to start if TEMPO_REDIS_BIND is non-loopback without
a password. Always firewall the port or run this over WireGuard/VPN.
On the GPU host, run the CUDA worker and share the data directory via NFS/SMB/whatever:
docker run -d --gpus all --name tempo-worker \
-e TEMPO_REDIS_URL=redis://:[email protected]:6379/0 \
-v /mnt/tempo-data:/data \
awkto/tempo-worker:latest-cuda
Verify the remote worker registered:
curl http://tempo.lan/api/workers
Multiple workers (mix of CPU + GPU) can register against the same Redis; ARQ picks whichever is free for the next job.
The only stateful directory is ./data/. To back up:
docker compose stop # quiesce writes
tar czf tempo-$(date +%F).tar.gz ./data
docker compose start
Restoring is the inverse — replace ./data/ and start the stack.
There is none. Tempo is a single-user, self-hosted app meant to live on a private network or behind a VPN. If you need multi-user later, the natural slot is a FastAPI dependency on the routers in backend/app/routers/.
See CONTRIBUTING.md for the sources adapter contract and how to add a new source type.
Pushing a v*.*.* tag triggers .github/workflows/docker-publish.yml, which:
awkto/tempo:{VERSION}[-cuda] and awkto/tempo-worker:{VERSION}[-cuda], plus :latest[-cuda] (:latest* skipped for prereleases — tags containing -).To cut a release:
git tag v0.2.0
git push origin v0.2.0
Required repo secrets: DOCKER_USERNAME, DOCKER_PASSWORD (Docker Hub access token).
http://localhost:8000/docs for the live OpenAPI explorer. Highlights:
| Method | Path | Notes |
|---|---|---|
| GET | /health | liveness |
| GET | /tracks | q, artist, album, sort, order, limit, offset |
| GET | /tracks/{id} | merged metadata (overrides over file tags) |
| PATCH | /tracks/{id}/metadata | stage overrides; pass null to clear |
| POST | /tracks/{id}/metadata/commit | write overrides into the file |
| POST | /tracks/{id}/metadata/lookup | MusicBrainz candidates |
| GET | /tracks/{id}/stream/original | HTTP range, scrub-friendly |
| GET | /tracks/{id}/stream/karaoke | 404 until generated |
| GET | /tracks/{id}/cover | extracted cover art |
| POST | /tracks/{id}/karaoke | enqueue Demucs job |
| GET | /jobs, /jobs/{id} | worker status (poll) |
| POST | /tracks/rehash | admin backfill of content_hash |
* | /playlists, /playlists/{id}/tracks, /playlists/{id}/reorder | full CRUD + ordering |
* | /sources | local, upload, gdrive |
| GET | /workers | live workers (heartbeat within 30 s) |
docker pull awkto/tempo-worker:latest