CSM: A Conversational Speech Generation Model by SesameAILabs
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
CSM (Conversational Speech Model) is an advanced speech generation model from SesameAILabs, designed to create RVQ audio codes from text and audio inputs. It leverages a Llama backbone and a smaller audio decoder for Mimi audio codes, enabling high-quality, context-aware speech synthesis. The model is now natively available in Hugging Face Transformers, making it accessible for researchers and developers.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
CSM, or Conversational Speech Model, is a cutting-edge speech generation model developed by SesameAILabs. This model specializes in generating RVQ audio codes from both text and audio inputs, making it highly versatile for various speech synthesis applications. Its architecture is built upon a robust Llama backbone, complemented by a smaller audio decoder that produces Mimi audio codes.
CSM is the technology powering the interactive voice demo showcased in Sesame's research blog post. As of version 4.52.1, CSM is natively available in Hugging Face Transformers, simplifying its integration into existing projects. For quick testing, a hosted Hugging Face Space is also available.
Installation
To get started with CSM, ensure you meet the following requirements:
- A CUDA-compatible GPU.
- The code has been tested on CUDA 12.4 and 12.6, but may work on other versions.
- Python 3.10 is recommended, though newer versions might also be compatible.
ffmpegmay be required for certain audio operations.- Access to the following Hugging Face models:
Follow these steps for setup:
git clone git@github.com:SesameAILabs/csm.git
cd csm
python3.10 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Disable lazy compilation in Mimi
export NO_TORCH_COMPILE=1
# You will need access to CSM-1B and Llama-3.2-1B
huggingface-cli login
For Windows users, please note that the triton package cannot be installed directly. Instead, use pip install triton-windows.
Examples
Quickstart
To generate a conversation between two characters using prompts, run the following script:
python run_csm.py
Generate a Sentence
This example demonstrates how to generate a single sentence using a random speaker identity, as no prompt or context is provided.
from generator import load_csm_1b
import torchaudio
import torch
if torch.backends.mps.is_available():
device = "mps"
elif torch.cuda.is_available():
device = "cuda"
else:
device = "cpu"
generator = load_csm_1b(device=device)
audio = generator.generate(
text="Hello from Sesame.",
speaker=0,
context=[],
max_audio_length_ms=10_000,
)
torchaudio.save("audio.wav", audio.unsqueeze(0).cpu(), generator.sample_rate)
Generate with Context
CSM performs optimally when provided with context. You can prompt or provide context to the model using a Segment for each speaker's utterance. The following example is instructional and assumes audio files exist.
from generator import Segment
speakers = [0, 1, 0, 0]
transcripts = [
"Hey how are you doing.",
"Pretty good, pretty good.",
"I'm great.",
"So happy to be speaking to you.",
]
audio_paths = [
"utterance_0.wav",
"utterance_1.wav",
"utterance_2.wav",
"utterance_3.wav",
]
def load_audio(audio_path):
audio_tensor, sample_rate = torchaudio.load(audio_path)
audio_tensor = torchaudio.functional.resample(
audio_tensor.squeeze(0), orig_freq=sample_rate, new_freq=generator.sample_rate
)
return audio_tensor
segments = [
Segment(text=transcript, speaker=speaker, audio=load_audio(audio_path))
for transcript, speaker, audio_path in zip(transcripts, speakers, audio_paths)
]
audio = generator.generate(
text="Me too, this is some cool stuff huh?",
speaker=1,
context=segments,
max_audio_length_ms=10_000,
)
torchaudio.save("audio.wav", audio.unsqueeze(0).cpu(), generator.sample_rate)
Why Use CSM?
CSM offers a powerful solution for high-quality conversational speech generation, making it an excellent tool for research and educational purposes. Its ability to leverage context allows for more natural and coherent speech synthesis, which is crucial for creating engaging audio experiences.
It's important to note that the open-sourced model is a base generation model. While it can produce a variety of voices, it has not been fine-tuned on any specific voice. CSM is designed as an audio generation model, not a general-purpose multimodal LLM, meaning it does not generate text. For text generation, a separate LLM is recommended. Although the model may have some capacity for non-English languages due to training data contamination, its performance in such languages is likely to be limited.
Misuse and Abuse ??
This project provides a high-quality speech generation model for research and educational purposes. While responsible and ethical use is encouraged, the following activities are explicitly prohibited:
- Impersonation or Fraud: Do not use this model to generate speech that mimics real individuals without their explicit consent.
- Misinformation or Deception: Do not use this model to create deceptive or misleading content, such as fake news or fraudulent calls.
- Illegal or Harmful Activities: Do not use this model for any illegal, harmful, or malicious purposes.
By using this model, you agree to comply with all applicable laws and ethical guidelines. We are not responsible for any misuse, and we strongly condemn unethical applications of this technology.
Links
- GitHub Repository: https://github.com/SesameAILabs/csm
- Hugging Face Transformers Documentation: https://huggingface.co/docs/transformers/main/en/model_doc/csm
- CSM-1B Model on Hugging Face: https://huggingface.co/sesame/csm-1b
- Sesame Interactive Voice Demo: https://www.sesame.com/voicedemo
- Sesame Research Blog Post: https://www.sesame.com/research/crossing_the_uncanny_valley_of_voice
- Hugging Face Space: https://huggingface.co/spaces/sesame/csm-1b
Related repositories
Similar repositories that may be relevant next.

Tau: A Minimalist Python Coding Agent for Your Terminal
September 8, 2026
Tau is a Python port of Pi's minimalist coding agent, designed to live in your terminal. It allows users to make requests like "explain this repo" or "add tests," and it can read files, edit code, and run commands. Beyond its utility, Tau also serves as a teaching project, demonstrating how coding agents are built with a small, readable codebase.

Awesome Harness Engineering: Building Reliable AI Agent Systems
September 7, 2026
Awesome Harness Engineering is a comprehensive curated list dedicated to the discipline of designing robust AI agent harnesses. It offers a wealth of resources, patterns, and templates essential for building reliable AI agent systems. Developers can explore tools, best practices, and foundational concepts across various critical areas of agent development.
Best of Agent Harnesses: A Curated List for AI Agent Development
September 7, 2026
RyanAlberts' Best of Agent Harnesses is a comprehensive, curated, and ranked list of over 100 AI agent harnesses and orchestration frameworks. It provides valuable insights for building reliable agentic systems, offering both human-readable guides and machine-readable formats for agents themselves. The repository is rescored weekly to ensure up-to-date recommendations.

Wasm Agents Blueprint: Run Python AI Agents in Your Browser with WebAssembly
September 3, 2026
Wasm Agents Blueprint is an innovative project from Mozilla AI that allows you to run Python-based AI agents directly in your web browser using WebAssembly (Wasm) and Pyodide. It bridges the gap between powerful Python AI frameworks, like the OpenAI Agents SDK, and browser-based applications. This blueprint eliminates the need for complex server setups or Docker containers, offering a streamlined way to experience AI agents.
Source repository
Open the original repository on GitHub.
22 counted GitHub visits