LFM2-Audio-1.5B is Liquid AI's first end-to-end audio foundation model.
Designed with low latency and real time conversation in mind, at only 1.5 billion parameters LFM2-Audio enables seamless conversational interaction, achieving capabilities on par with much larger models.
LFM2-Audio is an end-to-end multimodal speech and text language model, and as such does not require separate ASR and TTS components.
Our model consists of a pretrained LFM2 model as its multimodal backbone, along with a FastConformer based audio encoder to handle continuous audio inputs, and a RQ-transformer generating discrete Mimi tokens as audio output.
LFM2-Audio supports two distinct generation routines, each suitable for a set of tasks.
Interleaved generation enables real-time speech-to-speech conversational chatbot capabilities, where audio generation latency is key.
Sequential generation is suited for non-conversational tasks such as ASR or TTS, and allows the model to switch generated modality on the fly.
1pip install liquid-audio
2pip install"liquid-audio [demo]"# optional, to install demo dependencies3pip install flash-attn --no-build-isolation # optional, to use flash attention 2. Will fallback to torch SDPA if not installed
Gradio demo
The simplest way to get started is by running the Gradio demo interface. After installation, run the command
liquid-audio-demo
This will start a webserver on port 7860. The interface can then be accessed via the URL http://localhost:7860/.
Multi-turn, multi-modal chat
The liquid-audio provides a lower lever interface to the model and generation routines, ideal for custom usecases.
We demonstrate this with a simple multi-turn chat, where the first turn is given as audio, and the second turn is given as text.
For multi-turn chat with text and audio output, we use interleaved generation. The system prompt should be set to Respond with interleaved text and audio.. Here we use audio as the first user turn, and text as the second one.
python
1import torch
2import torchaudio
3from liquid_audio import LFM2AudioModel, LFM2AudioProcessor, ChatState, LFMModality
45# Load models6HF_REPO ="LiquidAI/LFM2-Audio-1.5B"78processor = LFM2AudioProcessor.from_pretrained(HF_REPO).eval()9model = LFM2AudioModel.from_pretrained(HF_REPO).eval()1011# Set up inputs for the model12chat = ChatState(processor)1314chat.new_turn("system")15chat.add_text("Respond with interleaved text and audio.")16chat.end_turn()1718chat.new_turn("user")19wav, sampling_rate = torchaudio.load("assets/question.wav")20chat.add_audio(wav, sampling_rate)21chat.end_turn()2223chat.new_turn("assistant")2425# Generate text and audio tokens.26text_out:list[torch.Tensor]=[]27audio_out:list[torch.Tensor]=[]28modality_out:list[LFMModality]=[]29for t in model.generate_interleaved(**chat, max_new_tokens=512, audio_temperature=1.0, audio_top_k=4):30if t.numel()==1:31print(processor.text.decode(t), end="", flush=True)32 text_out.append(t)33 modality_out.append(LFMModality.TEXT)34else:35 audio_out.append(t)36 modality_out.append(LFMModality.AUDIO_OUT)3738# output: Sure! How about "Handcrafted Woodworking, Precision Made for You"? Another option could be "Quality Woodworking, Quality Results." If you want something more personal, you might try "Your Woodworking Needs, Our Expertise."3940# Detokenize audio, removing the last "end-of-audio" codes41# Mimi returns audio at 24kHz42mimi_codes = torch.stack(audio_out[:-1],1).unsqueeze(0)43with torch.no_grad():44 waveform = processor.mimi.decode(mimi_codes)[0]45torchaudio.save("answer1.wav", waveform.cpu(),24_000)4647# Append newly generated tokens to chat history48chat.append(49 text = torch.stack(text_out,1),50 audio_out = torch.stack(audio_out,1),51 modality_flag = torch.tensor(modality_out),52)53chat.end_turn()5455# Start new turn56chat.new_turn("user")57chat.add_text("My business specialized in chairs, can you give me something related to that?")58chat.end_turn()5960chat.new_turn("assistant")6162# Generate second turn text and audio tokens.63audio_out:list[torch.Tensor]=[]64for t in model.generate_interleaved(**chat, max_new_tokens=512, audio_temperature=1.0, audio_top_k=4):65if t.numel()==1:66print(processor.text.decode(t), end="", flush=True)67else:68 audio_out.append(t)6970# output: Sure thing! How about “Comfortable Chairs, Crafted with Care” or “Elegant Seats, Handcrafted for You”? Let me know if you’d like a few more options.7172# Detokenize second turn audio, removing the last "end-of-audio" codes73mimi_codes = torch.stack(audio_out[:-1],1).unsqueeze(0)74with torch.no_grad():75 waveform = processor.mimi.decode(mimi_codes)[0]76torchaudio.save("answer2.wav", waveform.cpu(),24_000)
ASR, TTS, additional information
Please visit the liquid-audiopackage repository for additional examples and sample audio snippets.
📈 Performance
VoiceBench (audio input)
Higher is better. AlpacaEval, CommonEval and WildVoice are scored out of 5.
Model
Components & Size
AlpacaEval
CommonEval
WildVoice
SD-QA
MMSU
OBQA
BBH
IFEval
ADVBench
Overall
LFM2-Audio-1.5B
1.5B parameters
3.71
3.49
3.17
30.56
31.95
44.40
30.54
98.85
67.33
56.78
Moshi
7B parameters
2.01
1.60
1.30
15.64
24.04
25.93
47.40
10.12
44.23
29.51
Qwen2.5-Omni-3B
5B parameters
3.72
3.51
3.42
44.94
55.29
76.26
61.30
32.90
88.46
63.57
Mini-Omni2
0.6B parameters
2.32
2.18
1.79
9.31
24.27
26.59
46.40
11.56
57.50
33.49
ASR
Word Error Rate (WER), lower is better.
Model
Components & Size
Audio output
Open
AMI
GigaSpeech
LibriSpeech-clean
LibriSpeech-other
TED-LIUM
Average
LFM2-Audio-1.5B
1.5B parameters
Yes
Yes
15.58
10.67
2.01
4.39
3.56
7.24
Qwen2.5-Omni-3B
5B parameters
Yes
Yes
15.95
10.02
2.01
3.91
3.86
7.15
Whisper-large-V3
1.5B parameters
No — ASR only
Yes
16.73
10.76
2.73
5.54
3.91
7.93
elevenlabs/scribe_v1
unknown
No — ASR only
No
14.43
9.66
1.79
3.31
3.17
6.47
📬 Contact
If you are interested in custom solutions with edge deployment, please contact our sales team.
License
The code in this the package repository and associated weights are licensed under the LFM Open License v1.0.