--- 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 - streaming - realtime - causal --- # Inworld Voice Isolator (realtime) MLX MLX builds of [Inworld Voice Isolator (realtime)](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-realtime-MLX/blob/main/bf16/config.json) | 1.0 kB | `11fe29f8eee4` | PESQ 2.929, STOI 0.9329, SI-SDR 19.89 dB (original 2.909 / 0.9318 / 19.90); output 54.6 dB from the original's (worst file 34.8), no file below it by more than 0.45 dB | | bf16 | [`bf16/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/bf16/mlx_model.py) | 46.9 kB | `3c66bae844df` | PESQ 2.929, STOI 0.9329, SI-SDR 19.89 dB (original 2.909 / 0.9318 / 19.90); output 54.6 dB from the original's (worst file 34.8), no file below it by more than 0.45 dB | | bf16 | [`bf16/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/bf16/model.safetensors) | 117.0 MB | `8f5db061ae37` | PESQ 2.929, STOI 0.9329, SI-SDR 19.89 dB (original 2.909 / 0.9318 / 19.90); output 54.6 dB from the original's (worst file 34.8), no file below it by more than 0.45 dB | | fp16 | [`fp16/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/fp16/config.json) | 1.0 kB | `33c6b513eb6c` | fp16 storage, fp32 math (fp16 math overflows): PESQ 2.909, STOI 0.9318, SI-SDR 19.90 dB; 85.1 dB from the original's (worst 74.0), no file below it by more than 0.00 dB | | fp16 | [`fp16/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/fp16/mlx_model.py) | 46.9 kB | `3c66bae844df` | fp16 storage, fp32 math (fp16 math overflows): PESQ 2.909, STOI 0.9318, SI-SDR 19.90 dB; 85.1 dB from the original's (worst 74.0), no file below it by more than 0.00 dB | | fp16 | [`fp16/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/fp16/model.safetensors) | 117.2 MB | `7fa2aa852a41` | fp16 storage, fp32 math (fp16 math overflows): PESQ 2.909, STOI 0.9318, SI-SDR 19.90 dB; 85.1 dB from the original's (worst 74.0), no file below it by more than 0.00 dB | | 8bit | [`8bit/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/8bit/config.json) | 15.6 kB | `f021eeac7feb` | PESQ 2.934, STOI 0.9329, SI-SDR 19.89 dB; 51.2 dB from the original's (worst 42.9), no file below it by more than 0.06 dB; through push() in 20 ms pieces 51.4 dB (worst 43.0), -0.05 dB | | 8bit | [`8bit/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/8bit/mlx_model.py) | 46.9 kB | `3c66bae844df` | PESQ 2.934, STOI 0.9329, SI-SDR 19.89 dB; 51.2 dB from the original's (worst 42.9), no file below it by more than 0.06 dB; through push() in 20 ms pieces 51.4 dB (worst 43.0), -0.05 dB | | 8bit | [`8bit/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/8bit/model.safetensors) | 64.2 MB | `025c1a014d6c` | PESQ 2.934, STOI 0.9329, SI-SDR 19.89 dB; 51.2 dB from the original's (worst 42.9), no file below it by more than 0.06 dB; through push() in 20 ms pieces 51.4 dB (worst 43.0), -0.05 dB | | 6bit | [`6bit/config.json`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/6bit/config.json) | 15.6 kB | `fed5ed979589` | PESQ 2.951, STOI 0.9333, SI-SDR 19.88 dB; 43.8 dB from the original's (worst 30.1), no file below it by more than 0.10 dB | | 6bit | [`6bit/mlx_model.py`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/6bit/mlx_model.py) | 46.9 kB | `3c66bae844df` | PESQ 2.951, STOI 0.9333, SI-SDR 19.88 dB; 43.8 dB from the original's (worst 30.1), no file below it by more than 0.10 dB | | 6bit | [`6bit/model.safetensors`](https://huggingface.co/moonbox-dev/voice-isolator-realtime-MLX/blob/main/6bit/model.safetensors) | 50.1 MB | `00d1cb2eb04f` | PESQ 2.951, STOI 0.9333, SI-SDR 19.88 dB; 43.8 dB from the original's (worst 30.1), no file below it by more than 0.10 dB | ## How to run Inworld Voice Isolator v1, the realtime model (58M parameters, causal: keeps the voice and removes noise, music and reverb from 48 kHz mono audio as it arrives), for Apple silicon with MLX. Each folder is the whole streaming 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-realtime-MLX --include "bf16/*" --local-dir voice-isolator-realtime ``` ```python import sys, soundfile as sf sys.path.insert(0, "voice-isolator-realtime/bf16") from mlx_model import VoiceIsolator iso = VoiceIsolator("voice-isolator-realtime/bf16") # look-ahead 2 frames (20 ms); 0 and 4 also trained noisy, sr = sf.read("noisy.wav", dtype="float32") # mono, 48 kHz sf.write("clean.wav", iso.isolate(noisy), 48000) # a whole file, streamed through the model stream = iso.stream(block_frames=4) # live audio: push pieces of any size for piece in pieces: # e.g. 1920 samples (40 ms) at a time out = stream.push(piece) # the samples that became final out = stream.flush() ``` The output runs 63 ms behind the input (the 2048-sample analysis window plus the 20 ms look-ahead). As in the original, the time attention works in 6 s windows: a second lane starts 2 s before each boundary and the two are crossfaded, so a session can run indefinitely. Each frame sees only the past and the look-ahead, so a file processed whole and the same audio pushed in pieces give the same output, the original's own streaming output. `mlx_model.py` sets `MLX_ENABLE_TF32=0` before importing mlx, because 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, including its streaming session; the Mamba layers' selective scan is the original's own Metal kernel. The analysis, synthesis, 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, attention and attention cache in bfloat16; `8bit/` and `6bit/` MLX-quantize the Linear layers (affine, group size 64; the band encoders, the decoder's condition layer and the Mamba `dt_proj` layers stay float) and compute in bfloat16. **How they were checked.** VoiceBank-DEMAND test (every 4th file, 206 of 824, 48 kHz) through the original PyTorch model in streaming mode (look-ahead 2 frames, fp32, on Apple's GPU via MPS; 129 dB from its CPU output) 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 126 dB from the original on average (worst file 97 dB), and pushing the audio in 20 ms pieces gives the same scores as whole files. | Precision | Size | PESQ | STOI | SI-SDR | From the original's output, mean / worst | Worst file vs the original | |---|---|---|---|---|---|---| | original (PyTorch fp32) | 233 MB | 2.909 | 0.9318 | 19.90 dB | - | - | | `bf16/` | 117 MB | 2.929 | 0.9329 | 19.89 dB | 54.6 / 34.8 dB | -0.45 dB | | `fp16/` | 117 MB | 2.909 | 0.9318 | 19.90 dB | 85.1 / 74.0 dB | -0.00 dB | | `8bit/` | 64 MB | 2.934 | 0.9329 | 19.89 dB | 51.2 / 42.9 dB | -0.06 dB | | `6bit/` | 50 MB | 2.951 | 0.9333 | 19.88 dB | 43.8 / 30.1 dB | -0.10 dB | (The noisy input scores PESQ 1.99, STOI 0.909, SI-SDR 8.0 dB.) 4-bit builds were measured and are not published: with the decoder heads and time-axis Mamba kept at 8 bits (46 MB) 4 of the 206 files were more than 0.5 dB below the original's (worst 1.24 dB); every-layer 4-bit (36 MB), 14 files. **Speed.** Time per push on an Apple M5 MacBook Air (24 GB) with other heavy jobs running on it (load average 10-16), 33 s of audio: | | 20 ms pushes: mean / p95 | 40 ms pushes: mean / p95 | Whole file | |---|---|---|---| | `bf16/` | 19.0 / 41.9 ms | 20.5 / 41.1 ms | 0.25 x real time | | `8bit/` | 21.2 / 43.0 ms | 26.0 / 46.9 ms | 0.72 x real time | | `6bit/` | 21.1 / 39.1 ms | 32.4 / 60.5 ms | 0.70 x real time | | `fp16/` | 30.5 / 57.6 ms | 41.0 / 70.1 ms | 0.87 x real time | Under that load 40 ms pushes (`stream(block_frames=4)`) keep up with `bf16/` and `8bit/`; 20 ms pushes only just with `bf16/`. The offline model (whole 8 s windows, PESQ 3.2 on the same files) is in [moonbox-dev/voice-isolator-MLX](https://huggingface.co/moonbox-dev/voice-isolator-MLX). Licence: Apache-2.0, as Inworld's original. ## How these were made From [Inworld Voice Isolator (realtime)](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.