Imagine a text-to-speech model so fast and modern, it starts generating high-quality audio as soon as you feed it the first few words, means, it doesn’t wait for the full sentence unlike other models. That’s exactly what Kyutai TTS delivers. Built for streaming TTS, Kyutai TTS is a very new model that combines low-latency generation with remarkable voice quality. It uses a powerful hierarchical Transformer architecture with over 1.6 billion parameters and leverages Moshi’s multistream framework to align and predict audio tokens efficiently. The model supports voice conditioning via pre-computed embeddings, enabling realistic character dialog, emotion-rich narration, and real-time applications. With native support for English and French, and a throughput of up to 75x real-time, Kyutai TTS is ideal for both research and production use cases. Plus, it’s completely open source under a permissive CC-BY 4.0 license, making it an attractive alternative to commercial black-box solutions.
If you’re building a real-time voice assistant, generating character dialogue for a game, or simply exploring TTS systems, installing & running Kyutai TTS locally or on cloud is something you might be looking for, and that’s what we’re going to cover in this tutorial.
Prerequisites
The minimum system requirements for running this model are:
- GPU: 1x RTX 4090 or 1x RTX A6000
- Storage: 20 GB (preferable)
- VRAM: at least 16 GB
- Anaconda installed
Step-by-step process to install and run Kyutai TTS
For the purpose of this tutorial, we’ll use a GPU-powered Virtual Machine by NodeShift since it provides high compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. Also, it offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider of your choice and follow the same steps for the rest of the tutorial.
Step 1: Setting up a NodeShift Account
Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.
If you already have an account, login straight to your dashboard.
Step 2: Create a GPU Node
After accessing your account, you should see a dashboard (see image), now:
- Navigate to the menu on the left side.
- Click on the GPU Nodes option.
- Click on Start to start creating your very first GPU node.
These GPU nodes are GPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations for GPUs ranging from H100s to A100s, CPUs, RAM, and storage, according to your needs.
Step 3: Selecting configuration for GPU (model, region, storage)
- For this tutorial, we’ll be using 1x RTX A6000 GPU, however, you can choose any GPU as per the prerequisites.
- Similarly, we’ll opt for 200GB storage by sliding the bar. You can also select the region where you want your GPU to reside from the available ones.
Step 4: Choose GPU Configuration and Authentication method
- After selecting your required configuration options, you’ll see the available GPU nodes in your region and according to (or very close to) your configuration. In our case, we’ll choose a 1x RTX A6000 48GB GPU node with 64vCPUs/63GB RAM/200GB SSD.
2. Next, you’ll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.
Step 5: Choose an Image
The final step is to choose an image for the VM, which in our case is Nvidia Cuda.
That’s it! You are now ready to deploy the node. Finalize the configuration summary, and if it looks good, click Create to deploy the node.
Step 6: Connect to active Compute Node using SSH
- As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!
- Once your GPU shows this status, navigate to the three dots on the right, click on Connect with SSH, and copy the SSH details that appear.
As you copy the details, follow the below steps to connect to the running GPU VM via SSH:
- Open your terminal, paste the SSH command, and run it.
2. In some cases, your terminal may take your consent before connecting. Enter ‘yes’.
3. A prompt will request a password. Type the SSH password, and you should be connected.
Output:
Next, If you want to check the GPU details, run the following command in the terminal:
!nvidia-smi
Step 7: Set up the project environment with dependencies
- Create a virtual environment using Anaconda.
conda create -n tts python=3.11 -y && conda activate tts
Output:
2. Once you’re inside the environment, install necessary dependencies to run the model.
pip install torch==2.2.2+cu121 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install einops timm pillow
pip install git+https://github.com/huggingface/transformers
pip install huggingface_hub
pip install sentencepiece bitsandbytes protobuf decord
pip install 'sphn<0.2'
pip install "moshi==0.2.7"
pip install "numpy<2"
Output:
3. Install and run jupyter notebook.
conda install -c conda-forge --override-channels notebook -y
conda install -c conda-forge --override-channels ipywidgets -y
jupyter notebook --allow-root
5. If you’re on a remote machine (e.g., NodeShift GPU), you’ll need to do SSH port forwarding in order to access the jupyter notebook session on your local browser.
Run the following command in your local terminal after replacing:
<YOUR_SERVER_PORT>
with the PORT allotted to your remote server (For the NodeShift server – you can find it in the deployed GPU details on the dashboard).
<PATH_TO_SSH_KEY>
with the path to the location where your SSH key is stored.
<YOUR_SERVER_IP>
with the IP address of your remote server.
ssh -L 8888:localhost:8888 -p <YOUR_SERVER_PORT> -i <PATH_TO_SSH_KEY> root@<YOUR_SERVER_IP>
Output:
After this copy the URL you received in your remote server:
And paste this on your local browser to access the Jupyter Notebook session.
Step 8: Download and Run the model
- Open a Python notebook inside Jupyter.
2. Download the model checkpoints, load it to GPU and configure prompt and voice.
import argparse
import sys
import numpy as np
import torch
from moshi.models.loaders import CheckpointInfo
from moshi.models.tts import DEFAULT_DSM_TTS_REPO, DEFAULT_DSM_TTS_VOICE_REPO, TTSModel
from IPython.display import display, Audio
# Configuration
text = "Hey how're you all? You know what happened today? I went to the post office to collect my letter and found a mystery box!! Do you guys wanna see it??"
voice = "expresso/ex03-ex01_happy_001_channel1_334s.wav"
print(f"See https://huggingface.co/{DEFAULT_DSM_TTS_VOICE_REPO} for available voices.")
# Set everything up
checkpoint_info = CheckpointInfo.from_hf_repo(DEFAULT_DSM_TTS_REPO)
tts_model = TTSModel.from_checkpoint_info(
checkpoint_info, n_q=32, temp=0.6, device=torch.device("cuda"), dtype=torch.half
)
# If you want to make a dialog, you can pass more than one turn [text_speaker_1, text_speaker_2, text_2_speaker_1, ...]
entries = tts_model.prepare_script([text], padding_between=1)
voice_path = tts_model.get_voice_path(voice)
# CFG coef goes here because the model was trained with CFG distillation,
# so it's not _actually_ doing CFG at inference time.
# Also, if you are generating a dialog, you should have two voices in the list.
condition_attributes = tts_model.make_condition_attributes(
[voice_path], cfg_coef=2.0
)
Output:
3. Run the model to generate audio from the above text.
print("Generating audio...")
pcms = []
def _on_frame(frame):
print("Step", len(pcms), end="\r")
if (frame != -1).all():
pcm = tts_model.mimi.decode(frame[:, 1:, :]).cpu().numpy()
pcms.append(np.clip(pcm[0, 0], -1, 1))
# You could also generate multiple audios at once by extending the following lists.
all_entries = [entries]
all_condition_attributes = [condition_attributes]
with tts_model.mimi.streaming(len(all_entries)):
result = tts_model.generate(all_entries, all_condition_attributes, on_frame=_on_frame)
print("Done generating.")
audio = np.concatenate(pcms, axis=-1)
4. Display the audio output.
display(
Audio(audio, rate=tts_model.mimi.sample_rate, autoplay=True)
)
Output:
Troubleshooting Errors
While generating the audio during inference, you may encounter an error like this (for e.g., if you using a CUDA powered machine):
BackendCompilerFailed: backend='inductor' raised:
AssertionError: libcuda.so cannot found!
Possible files are located at ['/lib/x86_64-linux-gnu/libcuda.so.1'].Please create a symlink of libcuda.so to any of the file.
Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
You can suppress this exception and fall back to eager by setting:
import torch._dynamo
torch._dynamo.config.suppress_errors = True
Simply run these commands to link the libcuda.so
path with libcuda.so.1
and it should fix the error:
sudo find / -name "libcuda.so.1"
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so
If you get a different pathname from the first command, simply replace the path in second command with your pathname.
Conclusion
In this tutorial, we explored the impressive capabilities of Kyutai TTS, a cutting-edge streaming text-to-speech model that delivers ultra-low-latency, high-quality audio generation with support for voice conditioning and real-time applications. To make deployment even easier, we also demonstrated how to install and run it seamlessly with NodeShift, which offers a fast, GPU-powered environment to test and scale TTS models without worrying about infrastructure setup. Whether you’re prototyping locally or deploying at scale, NodeShift ensures innovative and powerful models like Kyutai runs at peak performance with minimal hassle.