Skip to page content
SAVRN
Search Plan a project

Open-weight model · Feature extraction

continuous-mimi-onnx

by MaAI maai-kyoto/continuous-mimi-onnx

continuous-mimi-onnx is an open-weight model for feature extraction from MaAI, released under Creative Commons Attribution 4.0. Its published files total 624.8 MB.

This is a modified ONNX export of the Mimi audio codec encoder. It bypasses the Residual Vector Quantization (RVQ) to directly output continuous feature representations instead of discrete tokens.

Parameters—
Context—
Weights623.8 MB
Licensecc-by-4.0
AccessOpen weights
Monthly Downloads—

Model Card

By MaAI, published under cc-by-4.0, revision 8a73caf56759.

This is a modified ONNX export of the Mimi audio codec encoder. It bypasses the Residual Vector Quantization (RVQ) to directly output continuous feature representations instead of discrete tokens. This preserves fine-grained acoustic details, making it ideal for downstream tasks like real-time dialogue analysis or speech emotion recognition. This model is a derivative work based on the "Mimi" model. Numbers below are illustrative (desktop CPU, FP32 ONNX vs PyTorch kyutai/mimi, streaming chunk emit=1280 @ 16 kHz, inference.py --compare). Your machine, thread counts, and ORT / PyTorch builds will shift them. Speed — RTF (processing time ÷ real-time audio length per chunk) In repeated 1-second…

Read MaAI's full model card

Continuous Mimi Encoder

This is a modified ONNX export of the Mimi audio codec encoder.

It bypasses the Residual Vector Quantization (RVQ) to directly output continuous feature representations instead of discrete tokens. This preserves fine-grained acoustic details, making it ideal for downstream tasks like real-time dialogue analysis or speech emotion recognition.


Figure: Architecture showing the RVQ bypass for continuous latents. (Adapted from the Moshi technical report)

License and Attribution

This model is a derivative work based on the "Mimi" model. * Original Developer: Kyutai * License: CC BY 4.0 * Modifications: Bypassed the RVQ module to output continuous embeddings and exported to ONNX format.

Speed and accuracy (reference)

Numbers below are illustrative (desktop CPU, FP32 ONNX vs PyTorch kyutai/mimi, streaming chunk emit=1280 @ 16 kHz, inference.py --compare). Your machine, thread counts, and ORT / PyTorch builds will shift them.

Speed — RTF (processing time ÷ real-time audio length per chunk)
In repeated 1-second windows, Torch often lands around RTF ≈ 0.22–0.32 and FP32 ONNX around RTF ≈ 0.14–0.18 — i.e. ONNX is commonly ~1.5–2× less wall time than Torch for the same window. Both RTF values stay below 1 in those traces, so either path can run faster than real time for this configuration.

Accuracy — Torch vs FP32 ONNX embeddings
With identical windows fed to both backends over a long stream (400 steps = 32 s, well past the 10 s point where the transformer's KV ring buffer wraps), the worst per-step max_abs is ≤ 1.3e−6 for both the 1-frame and 2-frame exports, with cosine similarity ≈ 1.0 throughout. The published FP32 ONNX pair is the intended match to Torch; INT8 trades more numerical error for CPU throughput.

Changelog

2026-10 — fix for drift after 10 s of streaming. Earlier exports diverged from Torch once the encoder transformer's KV cache (250 steps = 10 s) wrapped around: the attention mask assumed the ring buffer was in chronological order, so after the wrap a query could attend to a key one step in its future, and the buffer was one slot too small for a 2-step call. Differences grew from ~1e−7 to ~1e−3 … 5e−2 (cosine down to ~0.97) and stayed there. The mask is now built from the absolute position stored in each slot, and the cache holds sliding_window + steps_per_call − 1 slots (max_past_len 251 for the 1-frame files, 253 for _2f). The _2f files are also re-exported from the original kyutai/mimi weights (the previous _2f upload used fine-tuned weights by mistake). No code change is needed: runtimes read max_past_len from the .json. The previous files remain available in this repository's history.

Getting Started

Requirements

Use Python 3.10+ and install the following (versions should match your CUDA/CPU setup for PyTorch).

Recommended: transformers==5.5.3 (streaming Mimi + cache behaviour used by the ONNX export and inference.py are validated against this release).

Scope Packages
Always torch, transformers (5.5.3 recommended; Mimi / Kyutai support), einops, numpy, huggingface_hub
ONNX path onnxruntime or onnxruntime-gpu (GPU builds use the CUDA execution provider when --device cuda)
Microphone (--mic) pyaudio (optional; platform-specific wheels may be required on Windows)

Example install for CPU ONNX + Torch:

pip install "torch" "transformers==5.5.3" einops numpy huggingface_hub onnxruntime

For GPU ONNX, replace onnxruntime with onnxruntime-gpu and install a matching torch build. For live microphone streaming, add pyaudio when your platform supports it.

The Torch encoder path downloads kyutai/mimi weights via Hugging Face on first use. The ONNX path, if you do not pass local paths, downloads continuous_mimi_fp32.onnx / .json (or INT8 counterparts) from this Hugging Face repository using huggingface_hub.

inference.py

inference.py provides a small CLI around the streaming Mimi encoder: PyTorch (kyutai/mimi) or ONNX, optional 16 kHz microphone streaming, and an optional Torch–ONNX comparison mode. Run it with python inference.py ... after installing the packages above.

Quick checks

# One synthetic streaming step; PyTorch Mimi encoder (HF weights)
python inference.py --backend torch

# Same, but ONNX runtime (FP32 bundle from this Hub, cached locally after first run)
python inference.py --backend onnx --onnx-precision fp32

# Use ONNX files you already downloaded next to the script
python inference.py --backend onnx --onnx-model ./continuous_mimi_fp32.onnx --onnx-meta ./continuous_mimi_fp32.json

# INT8 ONNX is intended for CPU in this script (do not pair INT8 with CUDA here)
python inference.py --backend onnx --onnx-precision int8 --device cpu

Microphone (16 kHz, mono float32)

Requires pyaudio. Prints RTF (processing time ÷ real-time audio duration) and per-chunk timing on a fixed wall-clock interval (default 1 s).

python inference.py --mic --backend onnx
python inference.py --mic --backend onnx --mic-device-index 1 --max-steps 500 --mic-report-interval 1.0

Torch vs ONNX comparison

Initializes both backends and feeds identical streaming windows; reports numeric differences and per-backend timing / RTF.

# Synthetic multi-step stream (default 10 steps; override with --compare-steps)
python inference.py --compare --compare-steps 20

# Same comparison using live microphone chunks
python inference.py --compare --mic

Example (--compare on CPU, 400 synthetic steps = 32 s)

Each line reports embedding agreement (max_abs, mean_abs, cos) for one streaming step, plus inference time and RTF for Torch and ONNX separately. Step 125 is where the transformer's KV cache first wraps around.

$ python inference.py --compare --compare-steps 400
Froze EncoderMimi!
Froze EncoderMimiOnnx!
Compare mode: 400 streaming steps, emit=1280, overlap=320, device=cpu
step    0  max_abs=1.713634e-07  mean_abs=4.131152e-08  cos=1.00000000  |  torch=82.48ms RTF=1.031  onnx=13.33ms RTF=0.167
step    1  max_abs=2.235174e-07  mean_abs=5.715674e-08  cos=1.00000012  |  torch=16.68ms RTF=0.208  onnx=12.29ms RTF=0.154
...
step  124  max_abs=2.682209e-07  mean_abs=5.849643e-08  cos=1.00000000  |  torch=15.41ms RTF=0.193  onnx=10.16ms RTF=0.127
step  125  max_abs=2.533197e-07  mean_abs=5.629795e-08  cos=1.00000000  |  torch=14.61ms RTF=0.183  onnx=8.92ms RTF=0.112
step  126  max_abs=3.278255e-07  mean_abs=6.289383e-08  cos=1.00000012  |  torch=14.26ms RTF=0.178  onnx=9.13ms RTF=0.114
...
step  399  max_abs=2.533197e-07  mean_abs=6.198024e-08  cos=0.99999994  |  torch=15.76ms RTF=0.197  onnx=10.84ms RTF=0.136
Done. worst max_abs_diff=4.470348e-07 at step 141  |  avg torch=15.21ms RTF=0.190  avg onnx=9.75ms RTF=0.122

--compare --mic prints the same statistics aggregated per wall-clock second ([1s] lines) from live microphone audio.

When --compare is set, --backend is ignored (both paths run). With --compare and without --mic, --compare-steps sets how many synthetic chunks to run.

Other useful flags

Flag Role
--device cpu, cuda, cuda:0, …
--frame-hz Output frame rate alignment for the frame-rate conv (default 12.5)
--hf-cache-dir Hugging Face Hub cache directory override
--force-download Force re-fetch of Hub ONNX artifacts
--onnx-cpu-intra-threads / --onnx-cpu-inter-threads ORT session thread counts on CPU EP

Identity and Version

Repository
maai-kyoto/continuous-mimi-onnx
Publisher
MaAI
Task
Feature extraction
Modality
Text
Library
Not stated by the source
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
8a73caf567595506e9d154dd9c75c53493d06a63
First published
2026-04-14
Last updated
2026-10-16

Files and Weights

12 files, 624.8 MB in total. The weights are 4 files totalling 623.8 MB in onnx.

Weights4 files · 623.8 MB
Configuration5 files · 112.5 KB
Documentation1 file · 8.1 KB
Other1 file · 888.6 KB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
continuous_mimi_fp32.onnxWeights155.9 MB c86171a48e1b
continuous_mimi_fp32_2f.onnxWeights155.9 MB 55e783c658c2
continuous_mimi_int8.onnxWeights156.0 MB e7e0e9eca212
continuous_mimi_int8_2f.onnxWeights156.0 MB eb51ab4ba79f
continuous_mimi_fp32.jsonConfiguration7.4 KB —
continuous_mimi_fp32_2f.jsonConfiguration7.4 KB —
continuous_mimi_int8.jsonConfiguration7.5 KB —
continuous_mimi_int8_2f.jsonConfiguration7.5 KB —
inference.pyConfiguration82.7 KB —
README.mdDocumentation8.1 KB —
vis/continues_mimi.pngOther888.6 KB 15ad78857648
.gitattributesRepository1.6 KB —

License and Download

License
cc-by-4.0
Access
Open weights, no gate
Download size
623.8 MB
Download from MaAI

Released by MaAI through its official repository on Hugging Face. Read the license.

Memory Requirements

PrecisionWeights in memory
As published623.8 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About continuous-mimi-onnx

Can I use continuous-mimi-onnx commercially?

Yes. continuous-mimi-onnx is released under Creative Commons Attribution 4.0. CC BY 4.0 permits sharing and adapting the work, including commercially, provided the creator is credited and changes are indicated.

Similar Models

Model · Feature extraction

all-MiniLM-L6-v2

Joshua

https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings like this: You can convert this Tensor to a nested JavaScript array using.tolist(): Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights apache-2.0 512 tokens transformers.js

Model · Feature extraction

bge-base-en-v1.5

Joshua

https://huggingface.co/BAAI/bge-base-en-v1.5 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings, as follows: You can also use the model for retrieval. For example: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights mit 512 tokens transformers.js

For more details please refer to our Github: FlagEmbedding. If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 1/30/2024: Release BGE-M3, a new member to BGE model series! M3 stands for Multi-linguality (100+ languages), Multi-granularities (input length up to 8192), Multi-Functionality (unification of dense, lexical, multi-vec/colbert retrieval). It is the first embedding model which supports all three retrieval methods, achieving new SOTA on multi-lingual (MIRACL) and cross-lingual (MKQA) benchmarks. Technical…

Open weights mit 512 tokens sentence-transformers

Model · Feature extraction

wavlm-large

Microsoft

The large model pretrained on 16kHz sampled speech audio. When using the model, make sure that your speech input is also sampled at 16kHz. Note: This model does not have a tokenizer as it was pretrained on audio alone. In order to use this model speech recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out this blog for more in-detail explanation of how to fine-tune the model. - 60,000 hours of Libri-Light - 10,000 hours of GigaSpeech - 24,000 hours of VoxPopuli Authors: Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen, Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin…

Open weights transformers

Model · Feature extraction

clap-htsat-unfused

LAION eV

The abstract of the paper states that: You can use this model for zero shot audio classification or extracting audio and/or textual features. You can also get the audio and text embeddings using ClapModel If you are using this model for your work, please consider citing the original paper

Open weights apache-2.0 514 tokens transformers