Skip to main content

gamemlx

Pure MLX inference for GAME (Guided Automatic Music Extraction) — vocal → MIDI, running on Apple Silicon GPU. Numerically aligned with the torch reference; fp32 output is bit-comparable on the test set (20/20 files, all onset/offset/pitch diffs 0.0000) and ~9.4× faster than torch CPU.

Install

uv tool install gamemlx   # or: pip install gamemlx

Quick start

# download weights (HF: baicai1145/GAME-MLX-medium, ModelScope fallback) and extract
gamemlx extract vocals.wav -m medium --language zh

# local model dir, fp16, custom decoding params
gamemlx extract song/ -m ./weights/GAME-1.0-medium-mlx \
    --precision fp16 --language zh --tempo 120 \
    --seg-threshold 0.2 --seg-radius 0.02 --est-threshold 0.2 \
    --t0 0 --nsteps 8 --output-dir out/

Python API:

from gamemlx import load_model, extract

model, lang_map = load_model("medium", precision="fp32")
mids = extract(model, "vocals.wav", language="zh", rng_seed=42)

Models

alias HuggingFace files
small / medium / large baicai1145/GAME-MLX-{small,medium,large} config.yaml, lang_map.json, weights(.fp16).safetensors

Weights convert 1:1 from official GAME checkpoints (torch state_dict keys kept verbatim). First use downloads to ~/.cache/gamemlx; ModelScope mirrors are used automatically when HF is unreachable.

Alignment & performance (vs GAME torch CPU, 20-file set)

precision sequence match max pitch diff max onset/offset diff
fp32 20/20 identical 0.0000 0.0000 s
fp16 19/20 (one borderline d3pm flip, analyzed) 0.0011 0.0000 s
engine total inference (20 files) avg / file peak RSS
torch CPU (32-true) 32.19 s 1.609 s 971 MB
gamemlx fp32 3.44 s 0.172 s (9.4×) 616 MB
gamemlx fp16 4.76 s 0.238 s 441 MB

Details: docs/ALIGNMENT.md, docs/BENCH.md.

Notes

  • d3pm sampling randomness is injectable (rng_matrices / --rng-seed) for reproducible comparisons against torch.
  • fp32 recommended for exact parity; fp16 saves memory (~111MB wired) with sub-0.002 pitch deviation.

Metadata

Release files for gamemlx 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gamemlx 0.2.0
File Size Uploaded Provenance
gamemlx-0.2.0.tar.gz 34.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gamemlx 0.2.0
File Interpreter ABI Platform
gamemlx-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.4 kB

Release files / gamemlx-0.2.0.tar.gz

Download URL gamemlx-0.2.0.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a1941647a8d0363963e3c9c32fc77592fd229e87d90b3e1a990a869d6f1f776e
BLAKE2b-256 checksum
How to use checksums
00fdacb44cccdef2f966f0ff8619afa11d92487f69bf33b80208a45b17980291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / gamemlx-0.2.0-py3-none-any.whl

Download URL gamemlx-0.2.0-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ddeaa9b1225b04256d855c5180f19f049dceb902f529b792fdbc2c87ec88346
BLAKE2b-256 checksum
How to use checksums
0bd7ae584b7f834d4a1bf66b11b0152f8d81b92dde72f763fb2fef31316aed4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for gamemlx 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page