--- base_model: inworld/voice-isolator base_model_relation: quantized license: apache-2.0 pipeline_tag: audio-to-audio library_name: mlx tags: - mlx - moonbox - mlx - inworld - voice-isolation - speech-enhancement - denoising - noise-suppression - 48khz - full-band --- # Inworld Voice Isolator MLX MLX builds of [Inworld Voice Isolator](https://huggingface.co/inworld/voice-isolator), made by Moonbox for Apple Silicon Macs. Each precision is a folder; keep a folder's files together. Only the parts listed below are converted: the rest of the pipeline comes from the original repository unless the section below says otherwise. ## Files The last column is how far each build is from the original PyTorch model on the same inputs (see the section below for what was measured). | Precision | File | Size | sha256 | Checked against the original | |---|---|---|---|---| | bf16 | [`bf16/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/bf16/config.json) | 1.0 kB | `87631df984bb` | PESQ 3.226, STOI 0.9485, SI-SDR 20.38 dB (original 3.207 / 0.9486 / 20.38); output 55.9 dB from the original's (worst file 48.2), no file below it by more than 0.03 dB | | bf16 | [`bf16/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/bf16/mlx_model.py) | 23.2 kB | `c4e15497cb17` | PESQ 3.226, STOI 0.9485, SI-SDR 20.38 dB (original 3.207 / 0.9486 / 20.38); output 55.9 dB from the original's (worst file 48.2), no file below it by more than 0.03 dB | | bf16 | [`bf16/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/bf16/model.safetensors) | 128.9 MB | `bc877deaadcb` | PESQ 3.226, STOI 0.9485, SI-SDR 20.38 dB (original 3.207 / 0.9486 / 20.38); output 55.9 dB from the original's (worst file 48.2), no file below it by more than 0.03 dB | | fp16 | [`fp16/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/fp16/config.json) | 1.0 kB | `b7054e152997` | fp16 storage, fp32 math (fp16 math overflows): PESQ 3.207, STOI 0.9486, SI-SDR 20.38 dB; 84.0 dB from the original's (worst 79.3), no file below it by more than 0.00 dB | | fp16 | [`fp16/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/fp16/mlx_model.py) | 23.2 kB | `c4e15497cb17` | fp16 storage, fp32 math (fp16 math overflows): PESQ 3.207, STOI 0.9486, SI-SDR 20.38 dB; 84.0 dB from the original's (worst 79.3), no file below it by more than 0.00 dB | | fp16 | [`fp16/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/fp16/model.safetensors) | 129.1 MB | `21a63d98f2c7` | fp16 storage, fp32 math (fp16 math overflows): PESQ 3.207, STOI 0.9486, SI-SDR 20.38 dB; 84.0 dB from the original's (worst 79.3), no file below it by more than 0.00 dB | | 8bit | [`8bit/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/8bit/config.json) | 16.5 kB | `fbe2a0cc4de5` | PESQ 3.227, STOI 0.9487, SI-SDR 20.38 dB; 52.2 dB from the original's (worst 39.9), no file below it by more than 0.12 dB | | 8bit | [`8bit/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/8bit/mlx_model.py) | 23.2 kB | `c4e15497cb17` | PESQ 3.227, STOI 0.9487, SI-SDR 20.38 dB; 52.2 dB from the original's (worst 39.9), no file below it by more than 0.12 dB | | 8bit | [`8bit/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/8bit/model.safetensors) | 70.7 MB | `4deeb8f09612` | PESQ 3.227, STOI 0.9487, SI-SDR 20.38 dB; 52.2 dB from the original's (worst 39.9), no file below it by more than 0.12 dB | | 6bit | [`6bit/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/6bit/config.json) | 16.5 kB | `913c687b00ab` | PESQ 3.235, STOI 0.9488, SI-SDR 20.36 dB; 46.3 dB from the original's (worst 41.0), no file below it by more than 0.08 dB | | 6bit | [`6bit/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/6bit/mlx_model.py) | 23.2 kB | `c4e15497cb17` | PESQ 3.235, STOI 0.9488, SI-SDR 20.36 dB; 46.3 dB from the original's (worst 41.0), no file below it by more than 0.08 dB | | 6bit | [`6bit/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/6bit/model.safetensors) | 55.2 MB | `86d7f947ccec` | PESQ 3.235, STOI 0.9488, SI-SDR 20.36 dB; 46.3 dB from the original's (worst 41.0), no file below it by more than 0.08 dB | | 4bit | [`4bit/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/4bit/config.json) | 16.6 kB | `a35f9f13211d` | decoder heads and time-axis Mamba at 8 bits: PESQ 3.228, STOI 0.9483, SI-SDR 20.37 dB; 44.5 dB from the original's (worst 30.8), no file below it by more than 0.23 dB | | 4bit | [`4bit/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/4bit/mlx_model.py) | 23.2 kB | `c4e15497cb17` | decoder heads and time-axis Mamba at 8 bits: PESQ 3.228, STOI 0.9483, SI-SDR 20.37 dB; 44.5 dB from the original's (worst 30.8), no file below it by more than 0.23 dB | | 4bit | [`4bit/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-MLX/blob/main/4bit/model.safetensors) | 52.4 MB | `10264d0816b1` | decoder heads and time-axis Mamba at 8 bits: PESQ 3.228, STOI 0.9483, SI-SDR 20.37 dB; 44.5 dB from the original's (worst 30.8), no file below it by more than 0.23 dB | ## How to run Inworld Voice Isolator (offline, 64M parameters): removes noise, music and other voices from speech at 48 kHz, full band, keeping the speaker's timbre. Each folder is the whole pipeline for `mlx_model.py`, the one-file MLX runtime in the folder (mlx and numpy; no PyTorch): `model.safetensors`, `config.json`, `mlx_model.py`. ```bash pip install mlx numpy soundfile hf download moonbox-dev/voice-isolator-MLX --include "8bit/*" --local-dir voice-isolator ``` ```python import sys, soundfile as sf sys.path.insert(0, "voice-isolator/8bit") from mlx_model import VoiceIsolator iso = VoiceIsolator("voice-isolator/8bit") noisy, sr = sf.read("noisy.wav", dtype="float32") # mono, 48 kHz sf.write("clean.wav", iso.isolate(noisy), 48000) ``` Clips longer than 8 s run in 8 s windows overlapping by 2 s, as the original does. `mlx_model.py` sets `MLX_ENABLE_TF32=0` before importing mlx, because the M5's reduced-precision float32 matrix products move the output by tens of dB. If your process has already used MLX, set that variable yourself before the first MLX call. The runtime follows Inworld's code (inworld-voice-isolation @c73b3fa, Apache-2.0) operation for operation; the Mamba layers' selective scan is the original's own Metal kernel. The STFT, norms, scan and complex correction run in float32 in every build. `fp16/` stores the weights in float16 and computes in float32 (float16 arithmetic overflows); `bf16/` computes the matrix products in bfloat16. `8bit/`, `6bit/` and `4bit/` MLX-quantize Linear layers (affine, group size 64); the band encoders, the decoder's condition layer and the Mamba `dt_proj` layers stay float, and `4bit/` keeps the decoder heads and the time-axis Mamba layers at 8 bits (all-4-bit failed the check below). **How they were checked.** VoiceBank-DEMAND test (every 4th file, 206 of 824, 48 kHz) through the original PyTorch model (fp32, CPU) and every build: PESQ (wide-band), STOI and SI-SDR against the clean speech, and each output's distance from the original's output. Pass: no file more than 0.5 dB SI-SDR below the original's. The float32 port is 130 dB from the original on average. | Precision | Size | PESQ | STOI | SI-SDR | From the original's output, mean / worst | Worst file vs the original | |---|---|---|---|---|---|---| | original (PyTorch fp32) | 256 MB | 3.207 | 0.9486 | 20.38 dB | - | - | | `bf16/` | 129 MB | 3.226 | 0.9485 | 20.38 dB | 55.9 / 48.2 dB | -0.03 dB | | `fp16/` | 129 MB | 3.207 | 0.9486 | 20.38 dB | 84.0 / 79.3 dB | -0.00 dB | | `8bit/` | 71 MB | 3.227 | 0.9487 | 20.38 dB | 52.2 / 39.9 dB | -0.12 dB | | `6bit/` | 55 MB | 3.235 | 0.9488 | 20.36 dB | 46.3 / 41.0 dB | -0.08 dB | | `4bit/` | 52 MB | 3.228 | 0.9483 | 20.37 dB | 44.5 / 30.8 dB | -0.23 dB | (The noisy input scores PESQ 1.99, STOI 0.909, SI-SDR 8.0 dB.) On an Apple M5, `bf16/` processes audio about 3 times faster than real time. Licence: Apache-2.0, as Inworld's original. ## How these were made From [Inworld Voice Isolator](https://huggingface.co/inworld/voice-isolator) at revision `9b0285b3fe`: the original weights loaded in MLX and stored as bf16 or fp16, or quantized with MLX's affine quantization (`8bit`, `6bit`, `4bit`, group size 64; layers MLX can't quantize, such as convolutions and norms, stay bf16). Every build was checked against the original before upload; the `sha256` column above is what the files must hash to. ## License Apache-2.0. These files are a derivative of the original model and carry its license: it is copied in this repository, and it governs your use of these files. The original model card follows unchanged. --- # Original model card
Open-license (Apache-2.0) 48 kHz voice isolation for noisy speech recordings and live audio.
--- ## TL;DR Inworld Voice Isolator v1 ships as two models that share one architecture: | | `voice-isolator-v1` | `voice-isolator-v1-realtime` | |---|---|---| | made for | recorded audio and anything not latency-sensitive, at the best quality | live audio, as a stream in your pipeline or production | | how it runs | offline: every frame sees its whole 8 s chunk | a causal stream with 20 ms of look-ahead | | parameters | 64M | 58M | **Use them for** cleaning recordings before playback or publication, curating speech datasets and voice pipelines where the speaker's identity must survive. With the realtime model, use them for live calls and streams. Subtract the isolated voice from the input to extract background noise or a backing-track residual for vocals/music separation. **They are not** a speaker selector or a restoration model. Restoration is planned for version 2 (see [Plans](https://github.com/inworld-ai/voice-isolator#plans)). ## Quick start Using a coding agent? Point it at the [setup section of AGENTS.md](https://github.com/inworld-ai/voice-isolator/blob/main/AGENTS.md#setting-up-the-voice-isolator-for-a-user): it installs the package, checks the machine with `voice-isolate-doctor` and cleans a first file. ```bash pip install inworld-voice-isolation # or from a clone: git clone https://github.com/inworld-ai/voice-isolator && cd voice-isolator && pip install -e . # a noisy example; a clone also has it at demo/examples/sample_14.wav curl -LO https://raw.githubusercontent.com/inworld-ai/voice-isolator/main/demo/examples/sample_14.wav # offline isolation (downloads the offline model on first use): # the voice goes to sample_14_clean.wav and the removed background # to sample_14_clean_background.wav, beside it voice-isolate sample_14.wav sample_14_clean.wav ``` Both are float32 WAVs at 48 kHz, with their original levels preserved; together they reconstruct the aligned mono input. Use `--output-sr 0` to keep the input rate, `--background noise.wav` to choose the background path for one file, or `--no-background` to save only the voice. ```python from inworld import voice_isolation # isolate a recording offline offline = voice_isolation.VoiceIsolator("inworld/voice-isolator") wav, sample_rate = voice_isolation.load_audio("sample_14.wav") voice = offline.isolate(wav, sample_rate) voice_isolation.save_audio("sample_14_clean.wav", voice, sample_rate, subtype="FLOAT") voice_isolation.save_audio("sample_14_clean_background.wav", wav - voice, sample_rate, subtype="FLOAT") # what was removed ``` ### Streaming The realtime model isolates the voice as the audio arrives, with 20 ms of look-ahead: ```python import torch from inworld import voice_isolation live = voice_isolation.VoiceIsolator("inworld/voice-isolator", mode="streaming", lookahead_frames=2) session = live.stream() # takes 48 kHz mono, in pieces of any size wav, sample_rate = voice_isolation.load_audio("sample_14.wav") # 48 kHz mono, standing in for a live source voice = [] for start in range(0, len(wav), 960): # 20 ms at a time, as a microphone delivers it voice.append(session.push(wav[start:start + 960])) # the samples that are final: play or send them voice.append(session.flush()) # the rest, once the source ends voice_isolation.save_audio("sample_14_streamed.wav", torch.cat(voice), sample_rate) ``` The streaming CLI writes only the isolated voice, after the whole file has gone through: ```bash voice-isolate sample_14.wav sample_14_streamed.wav --mode streaming --lookahead 2 ``` The weights download on first use, and their checksums are verified. The mode picks the checkpoint: `voice-isolator-v1` offline, `voice-isolator-v1-realtime` for streaming. CUDA is used when available, Apple's Metal backend (`mps`) on an Apple-silicon Mac with PyTorch 2.6 or later, and the CPU otherwise; `--device` picks one. The code, the [interactive demo](https://github.com/inworld-ai/voice-isolator/blob/main/demo/README.md) and the [benchmark](https://github.com/inworld-ai/voice-isolator/blob/main/bench/README.md) are on GitHub: [inworld-ai/voice-isolator](https://github.com/inworld-ai/voice-isolator). The demo loads both models at startup: **Offline** processes files and samples into voice and background audio; **Online** streams the microphone for up to 60 seconds with updating waveforms and spectrograms, pausing capture before playback. ## Hardware Tested on NVIDIA Ampere, Hopper and Blackwell GPUs (A100, H100, B200 and B300) and on CPU. Smaller GPUs are not tested yet (see [Plans](https://github.com/inworld-ai/voice-isolator#plans)). ## The VIBE benchmark
Built for people with ❤️ by Inworld.