moshi
Library Listed
moshi, a real-time voice AI
- Downloads
- 1,859
- Dependents
- 3
- Stars
- 11,458
- Forks
- 1,065
- Contributors
- 26
- Commits
- 732
- Latest release
- 0.6.4 ·
About
Moshi: a speech-text foundation model for real time dialogue
[Read the paper] [Demo] [Hugging Face]
Moshi is a speech-text foundation model and full-duplex spoken dialogue framework. It uses Mimi, a state-of-the-art streaming neural audio codec. Talk to Moshi now in our live demo.
Organisation of the repository
There are three separate versions of the Moshi inference stack in this repo.
- PyTorch: for research and tinkering. The code is in the
moshi/directory. - MLX: for on-device inference on iPhone and Mac. The code is in the
moshi_mlx/directory. - Rust: for production. The code is in the
rust/directory. This contains in particular a Mimi implementation in Rust, with Python bindings available asrustymimi.
Finally, the code for the web UI client used in the Moshi demo is provided in the client/ directory.
If you want to fine tune Moshi, head out to kyutai-labs/moshi-finetune.
Other Kyutai models
The Moshi codebase is also used to run related models from Kyutai that use a multi-stream architecture similar to Moshi:
- Hibiki: simultaneous speech translation. Check out the Hibiki repo for more info.
- Kyutai Text-To-Speech and Speech-To-Text. Check out the Delayed Streams Modeling repo for more info.
Read the full README
Model architecture
Moshi models two streams of audio: one corresponds to Moshi speaking, and the other one to the user speaking. Along with these two audio streams, Moshi predicts text tokens corresponding to its own speech, its inner monologue, which greatly improves the quality of its generation. A small Depth Transformer models inter-codebook dependencies for a given time step, while a large, 7B-parameter Temporal Transformer models the temporal dependencies. Moshi achieves a theoretical latency of 160ms (80ms for the frame size of Mimi + 80ms of acoustic delay), with a practical overall latency as low as 200ms on an L4 GPU.

Mimi
Mimi is a neural audio codec that processes 24 kHz audio, down to a 12.5 Hz representation with a bandwidth of 1.1 kbps, in a fully streaming manner (latency of 80ms, the frame size), yet performs better than existing, non-streaming, codecs like SpeechTokenizer (50 Hz, 4kbps), or SemantiCodec (50 Hz, 1.3kbps).
Mimi builds on previous neural audio codecs such as SoundStream and EnCodec, adding a Transformer both in the encoder and decoder, and adapting the strides to match an overall frame rate of 12.5 Hz. This allows Mimi to get closer to the average frame rate of text tokens (~3-4 Hz), and limit the number of autoregressive steps in Moshi. Similarly to SpeechTokenizer, Mimi uses a distillation loss so that the first codebook tokens match a self-supervised representation from WavLM, which allows modeling semantic and acoustic information with a single model. Finally, and similarly to EBEN, Mimi uses only an adversarial training loss, along with feature matching, showing strong improvements in terms of subjective quality despite its low bitrate.

Models
We release three models:
- Moshi fine-tuned on a male synthetic voice (Moshiko),
- Moshi fine-tuned on a female synthetic voice (Moshika),
- Mimi, our speech codec.
Depending on the backend, the file format and quantization available will vary. Here is the list of the HuggingFace repo with each model. Mimi is bundled in each of those, and always use the same checkpoint format.
- Moshika for PyTorch (bf16, int8): kyutai/moshika-pytorch-bf16, kyutai/moshika-pytorch-q8 (experimental).
- Moshiko for PyTorch (bf16, int8): kyutai/moshiko-pytorch-bf16, kyutai/moshiko-pytorch-q8 (experimental).
- Moshika for MLX (int4, int8, bf16): kyutai/moshika-mlx-q4, kyutai/moshika-mlx-q8, kyutai/moshika-mlx-bf16.
- Moshiko for MLX (int4, int8, bf16): kyutai/moshiko-mlx-q4, kyutai/moshiko-mlx-q8, kyutai/moshiko-mlx-bf16.
- Moshika for Rust/Candle (int8, bf16): kyutai/moshika-candle-q8, kyutai/moshika-mlx-bf16.
- Moshiko for Rust/Candle (int8, bf16): kyutai/moshiko-candle-q8, kyutai/moshiko-mlx-bf16.
All models are released under the CC-BY 4.0 license.
Requirements
You will need at least Python 3.10, with 3.12 recommended. For specific requirements, please check the individual backends directories. You can install the PyTorch and MLX clients with the following:
pip install -U moshi # moshi PyTorch, from PyPI
pip install -U moshi_mlx # moshi MLX, from PyPI, best with Python 3.12.
# Or the bleeding edge versions for Moshi and Moshi-MLX.
pip install -U -e "git+https://git@github.com/kyutai-labs/moshi.git#egg=moshi&subdirectory=moshi"
pip install -U -e "git+https://git@github.com/kyutai-labs/moshi.git#egg=moshi_mlx&subdirectory=moshi_mlx"
pip install rustymimi # mimi, rust implementation with Python bindings from PyPI
If you are not using Python 3.12, you might get an error when installing
moshi_mlx or rustymimi (which moshi_mlx depends on). Then, you will need to install the Rust toolchain, or switch to Python 3.12.
While we hope that the present codebase will work on Windows, we do not provide official support for it. We have tested the MLX version on a MacBook Pro M3. At the moment, we do not support quantization for the PyTorch version, so you will need a GPU with a significant amount of memory (24GB).
For using the Rust backend, you will need a recent version of the Rust toolchain.
To compile GPU support, you will also need the CUDA properly installed for your GPU, in particular with nvcc.
PyTorch implementation
The PyTorch based API can be found in the moshi directory. It provides a streaming
version of the audio tokenizer (mimi) and the language model (moshi).
In order to run in interactive mode, you need to start a server which will run the model, you can then use either the web UI or a command line client.
Start the server with:
python -m moshi.server [--gradio-tunnel] [--hf-repo kyutai/moshika-pytorch-bf16]
And then access the web UI on localhost:8998. If your GPU is on a distant machine this will not work because for security reasons, websites using HTTP are not allowed to use the microphone. There are two ways to get around this:
- Forward the remote 8998 port to your localhost using ssh
-Lflag. Then connects to localhost:8998 as mentioned previously. - Use the
--gradio-tunnelargument, setting up a tunnel with a URL accessible from anywhere. Keep in mind that this tunnel goes through the US and can add significant latency (up to 500ms from Europe). You can use--gradio-tunnel-tokento set a fixed secret token and reuse the same address over time.
You can use --hf-repo to select a different pretrained model, by setting the proper Hugging Face repository.
Accessing a server that is not localhost via http may cause issues with using the microphone in the web UI (in some browsers this is only allowed using https).
A command-line client is also available, as
python -m moshi.client [--url URL_TO_GRADIO]
However note that, unlike the web browser, this client is barebones: it does not perform any echo cancellation, nor does it try to compensate for a growing lag by skipping frames.
For more information, in particular on how to use the API directly, please checkout moshi/README.md.
MLX implementation for local inference on macOS
Once you have installed moshi_mlx, you can run
python -m moshi_mlx.local -q 4 # weights quantized to 4 bits
python -m moshi_mlx.local -q 8 # weights quantized to 8 bits
# And using a different pretrained model:
python -m moshi_mlx.local -q 4 --hf-repo kyutai/moshika-mlx-q4
python -m moshi_mlx.local -q 8 --hf-repo kyutai/moshika-mlx-q8
# be careful to always match the `-q` and `--hf-repo` flag.
This command line interface is also barebone. It does not perform any echo cancellation, nor does it try to compensate for a growing lag by skipping frames.
Alternatively you can run python -m moshi_mlx.local_web to use
the web UI, the connection is via http and will be at localhost:8998.
Rust implementation
In order to run the Rust inference server, use the following command from within
the rust directory:
cargo run --features cuda --bin moshi-backend -r -- --config moshi-backend/config.json standalone
When using macOS, you can replace --features cuda with --features metal.
Alternatively you can use config-q8.json rather than config.json to use the
quantized q8 model. You can select a different pretrained model, e.g. Moshika,
by changing the "hf_repo" key in either file.
Once the server has printed 'standalone worker listening', you can use the web UI. By default the Rust server uses https so it will be at localhost:8998.
You will get warnings about the site being unsafe. When using chrome you can bypass these by selecting "Details" or "Advanced", then "Visit this unsafe site" or "Proceed to localhost (unsafe)".
Clients
We recommend using the web UI as it provides additional echo cancellation that helps the overall model quality. Note that most commands will directly serve this UI in the provided URL, and there is in general nothing more to do.
Alternatively, we provide command line interfaces for the Rust and Python versions, the protocol is the same as with the web UI so there is nothing to change on the server side.
For reference, here is the list of clients for Moshi.
Web UI
The web UI can be built from this repo via the
following steps (these will require npm being installed).
cd client
npm install
npm run build
The web UI can then be found in the client/dist directory.
Rust Command Line
From within the rust directory, run the following:
cargo run --bin moshi-cli -r -- tui --host localhost
Python with PyTorch
python -m moshi.client
Gradio Demo
You can launch a Gradio demo locally with the following command:
python -m moshi.client_gradio --url <moshi-server-url>
Prior to running the Gradio demo, please install gradio-webrtc>=0.0.18.
Docker Compose (CUDA only)
docker compose up
- Requires NVIDIA Container Toolkit
Development
If you wish to install from a clone of this repository, maybe to further develop Moshi, you can do the following:
# From the root of the clone of the repo
pip install -e 'moshi[dev]'
pip install -e 'moshi_mlx[dev]'
pre-commit install
If you wish to build locally rustymimi (assuming you have Rust properly installed):
pip install maturin
maturin dev -r -m rust/mimi-pyo3/Cargo.toml
FAQ
Checkout the Frequently Asked Questions section before opening an issue.
License
The present code is provided under the MIT license for the Python parts, and Apache license for the Rust backend. The web client code is provided under the MIT license. Note that parts of this code is based on AudioCraft, released under the MIT license.
The weights for the models are released under the CC-BY 4.0 license.
Citation
If you use either Mimi or Moshi, please cite the following paper,
@techreport{kyutai2024moshi,
title={Moshi: a speech-text foundation model for real-time dialogue},
author={Alexandre D\'efossez and Laurent Mazar\'e and Manu Orsini and
Am\'elie Royer and Patrick P\'erez and Herv\'e J\'egou and Edouard Grave and Neil Zeghidour},
year={2024},
eprint={2410.00037},
archivePrefix={arXiv},
primaryClass={eess.AS},
url={https://arxiv.org/abs/2410.00037},
}
Compatibility
- Runs on
- CUDA, Metal
What shows it
- CUDA: moshi feature cuda, moshi-backend feature cuda, moshi-cli feature cuda, moshi-server feature cuda
- Metal: moshi feature metal, moshi-backend feature metal, moshi-cli feature metal, moshi-server feature metal
- Native code
- Required
- Binds native code: alsa-sys, openssl-sys, opusic-sys, sentencepiece-sys
- Python bindings
- Has Python bindings
- mimi-pyo3 needs Python
- moshi-server needs Python
- License
- Apache-2.0 OR MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
moshi, a real-time voice AI Python bindings |
1,859 downloads over 30 days | 3 | 11,458 | 0.6.4 | CUDA, Metal | Binds native code: alsa-sys, openssl-sys, opusic-sys, sentencepiece-sys | Apache-2.0 OR MIT |
|
earshot Featured
Ridiculously fast & accurate voice activity detection in pure Rust |
164,695 downloads over 30 days | 14 | 242 | 1.2.2 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
Rust interface for the WebRTC Voice-Activity-Detction Module |
60,022 downloads over 30 days | 7 | 31 | 0.4.0 | GPU support unknown | Build uses a native toolchain: cc | MIT |
|
Voice Activity Detector using the Silero VAD model. |
36,149 downloads over 30 days | 11 | 64 | 0.2.1 | GPU support unknown | Binds native code: ort-sys | MIT |
|
Open-source, local-first Granola/Otter alternative that Claude Code, Codex, Cursor, and any MCP client can query. Meetings, calls, and voice memos transcribed on-device into markdown you own. |
3,152 binary downloads per release | Not applicable | 1,595 | 0.32.1 | CUDA, Metal, Vulkan | Binds native code: alsa-sys, libsqlite3-sys, knf-rs-sys (feature diarize), ort-sys (feature diarize), whisper-rs-sys (feature coreml) | MIT |
|
voxr New
Audio and speech on boostr: compressed-audio decode, resampling, DSP and grapheme to phoneme, with speech synthesis (Kokoro, VITS), voice cloning (VoxCPM2), transcription with word timings (Whisper), voice activity (Silero) and audio-text scoring (CLAP), on CPU or CUDA. |
642 downloads over 30 days | 2 | 2 | 0.9.1 | CUDA | No native code found | Apache-2.0 |
|
flowcat New
Self-hosted native-Rust real-time voice-agent runtime — one binary, no Python or softswitch: transports, serializers, codec, and a speech-to-speech (Gemini Live) pipeline. |
46 downloads over 30 days | 0 | 127 | 0.1.0 | GPU support unknown | Binds native code: audiopus_sys (feature local), ort-sys (feature vad-ort), whisper-rs-sys (feature stt-whisper-local) | Apache-2.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 1 active dependents and 1 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 11,458 stars, 1,065 forks and 26 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 16 May 2026, 177 days ago. The rules expect an update within 450 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.6.4 base 450: E = 450 daysdormancy: last activity 2026-05-16, 177 days ago, E = 450: activefeatured: not featured: active_users 1 < 11 and new_adopters 1 < 9 and repository route stars 11458 (needs 4539), forks 1065 (needs 434), contributors 26 (needs 79)listed: listed: no archive, new or featured rule applies
Crates5 crates
- moshi Primary
- mimi-pyo3
- moshi-backend
- moshi-cli
- moshi-server
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption1 active dependents, 1 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 1 | crates.io database dump | Yes | |
| New dependents (365 days) | 1 | crates.io database dump | Yes | |
| Peak active dependents | 2 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 5 months ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-05-16 | GitHub repository | Yes | |
| Latest release | 2025-10-01 | crates.io database dump | Yes | |
| First release | 2024-09-13 | crates.io database dump | Yes | |
| Latest version | 0.6.4 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 550 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 7 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution14 releases, 1,859 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 14 | crates.io database dump | Yes | |
| Downloads over 30 days | 1859 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository11,458 stars, 1,065 forks, 26 contributors, 732 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 11458 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 1065 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 26 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 732 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 OR MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | CUDA, Metal | crates.io database dump | No | |
| What shows each backend | CUDA: moshi feature cuda, moshi-backend feature cuda, moshi-cli feature cuda, moshi-server feature cuda; Metal: moshi feature metal, moshi-backend feature metal, moshi-cli feature metal, moshi-server feature metal | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | Binds native code: alsa-sys, openssl-sys, opusic-sys, sentencepiece-sys | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | Has Python bindings: mimi-pyo3 needs Python, moshi-server needs Python | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 3 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.