Specifications
Text-to-Speech
Natural speech synthesis
Speech Recognition
Multilingual ASR
Voice Chat
Interleaved audio/text
Quick Start
- liquid-audio
- llama.cpp
Install:Gradio Demo:Multi-Turn Chat:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 New: LFM2.5-VL-450M — our smallest vision model is now available! Learn more →
1.5B fully interleaved audio/text model for TTS, ASR, and voice chat
| Property | Value |
|---|---|
| Parameters | 1.5B (1.2B LM + 115M audio encoder) |
| Context Length | 32K tokens |
| Audio Output | 24kHz |
| Supported Language | English |
pip install liquid-audio
pip install "liquid-audio[demo]" # optional, for demo dependencies
pip install flash-attn --no-build-isolation # optional, for flash attention 2
liquid-audio-demo
# Starts webserver on http://localhost:7860/
import torch
import torchaudio
from liquid_audio import LFM2AudioModel, LFM2AudioProcessor, ChatState
# Load models
HF_REPO = "LiquidAI/LFM2.5-Audio-1.5B"
processor = LFM2AudioProcessor.from_pretrained(HF_REPO).eval()
model = LFM2AudioModel.from_pretrained(HF_REPO).eval()
# Set up chat
chat = ChatState(processor)
chat.new_turn("system")
chat.add_text("Respond with interleaved text and audio.")
chat.end_turn()
chat.new_turn("user")
wav, sampling_rate = torchaudio.load("question.wav")
chat.add_audio(wav, sampling_rate)
chat.end_turn()
chat.new_turn("assistant")
# Generate text and audio tokens
text_out, audio_out = [], []
for t in model.generate_interleaved(**chat, max_new_tokens=512, audio_temperature=1.0, audio_top_k=4):
if t.numel() == 1:
print(processor.text.decode(t), end="", flush=True)
text_out.append(t)
else:
audio_out.append(t)
# Detokenize audio and save
audio_codes = torch.stack(audio_out[:-1], 1).unsqueeze(0)
waveform = processor.decode(audio_codes)
torchaudio.save("answer.wav", waveform.cpu(), 24_000)
export CKPT=/path/to/LFM2.5-Audio-1.5B-GGUF
export INPUT_WAV=/path/to/input.wav
export OUTPUT_WAV=/path/to/output.wav
./llama-liquid-audio-cli -m $CKPT/LFM2.5-Audio-1.5B-Q4_0.gguf \
-mm $CKPT/mmproj-LFM2.5-Audio-1.5B-Q4_0.gguf \
-mv $CKPT/vocoder-LFM2.5-Audio-1.5B-Q4_0.gguf \
--tts-speaker-file $CKPT/tokenizer-LFM2.5-Audio-1.5B-Q4_0.gguf \
-sys "Perform ASR." --audio $INPUT_WAV
./llama-liquid-audio-cli -m $CKPT/LFM2.5-Audio-1.5B-Q4_0.gguf \
-mm $CKPT/mmproj-LFM2.5-Audio-1.5B-Q4_0.gguf \
-mv $CKPT/vocoder-LFM2.5-Audio-1.5B-Q4_0.gguf \
--tts-speaker-file $CKPT/tokenizer-LFM2.5-Audio-1.5B-Q4_0.gguf \
-sys "Perform TTS." -p "Hi, how are you?" --output $OUTPUT_WAV
./llama-liquid-audio-cli -m $CKPT/LFM2.5-Audio-1.5B-Q4_0.gguf \
-mm $CKPT/mmproj-LFM2.5-Audio-1.5B-Q4_0.gguf \
-mv $CKPT/vocoder-LFM2.5-Audio-1.5B-Q4_0.gguf \
--tts-speaker-file $CKPT/tokenizer-LFM2.5-Audio-1.5B-Q4_0.gguf \
-sys "Respond with interleaved text and audio." \
--audio $INPUT_WAV --output $OUTPUT_WAV
./llama-liquid-audio-server -m $CKPT/LFM2.5-Audio-1.5B-Q4_0.gguf \
-mm $CKPT/mmproj-LFM2.5-Audio-1.5B-Q4_0.gguf \
-mv $CKPT/vocoder-LFM2.5-Audio-1.5B-Q4_0.gguf \
--tts-speaker-file $CKPT/tokenizer-LFM2.5-Audio-1.5B-Q4_0.gguf
Was this page helpful?