LFM2.5-Audio-1.5B-JP is Liquid AI's first Japanese capable audio model and the first Japanese speech-to-speech model at this lightweight scale built from the foundations of LFM2.5-Audio-1.5B.
LFM2.5-Audio-1.5B-JP is an end-to-end multimodal speech and text language model, and as such does not require separate ASR and TTS components.
Designed with low latency and real time conversation in mind, at only 1.5 billion parameters LFM2.5-Audio-JP enables seamless Japanese conversational interaction, achieving capabilities on par with much larger models.
Our model consists of a pretrained LFM2.5 model as its multimodal backbone, along with a FastConformer based audio encoder to handle continuous audio inputs, and an RQ-transformer generating discrete tokens coupled with a lightweight audio detokenizer for audio output.
LFM2.5-Audio-JP 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.
We use GPT-4o as an LLM-as-a-judge and report the highest score assigned to each sample. Elyza and spoken_Elyza are scored on a 0–5 scale, while M-ifeval is scored on a 0–1 scale. Average performance was computed after rescaling all benchmark scores to a 0–5 scale.
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
Multi-turn, multi-modal chat
The liquid-audio library 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 soundfile as sf
3from liquid_audio import LFM2AudioModel, LFM2AudioProcessor, ChatState, LFMModality
45# Load models6HF_REPO ="LiquidAI/LFM2.5-Audio-1.5B-JP"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 = sf.read("assets/question_jp.wav", dtype="float32")20wav = torch.from_numpy(wav).unsqueeze(0)21chat.add_audio(wav, sampling_rate)22chat.end_turn()2324chat.new_turn("assistant")2526# Generate text and audio tokens.27text_out:list[torch.Tensor]=[]28audio_out:list[torch.Tensor]=[]29modality_out:list[LFMModality]=[]30for t in model.generate_interleaved(**chat, max_new_tokens=512, audio_temperature=1.0, audio_top_k=4):31if t.numel()==1:32print(processor.text.decode(t), end="", flush=True)33 text_out.append(t)34 modality_out.append(LFMModality.TEXT)35else:36 audio_out.append(t)37 modality_out.append(LFMModality.AUDIO_OUT)3839# output: こんにちは。私はリキッドリリーと申します。質問に答えたり、アドバイスを提供したりするためのAIボイスアシスタントです。リアルタイムでさまざまな言語タスクをお手伝いするよう設計されています。4041# Detokenize audio, removing the last "end-of-audio" codes42# Mimi returns audio at 24kHz43audio_codes = torch.stack(audio_out[:-1],1).unsqueeze(0)44waveform = processor.decode(audio_codes)45sf.write("answer_jp1.wav", waveform.cpu()[0],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("富士山の高さは何メートルですか。")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: 富士山の高さは約3,776メートルです。7172# Detokenize second turn audio, removing the last "end-of-audio" codes73audio_codes = torch.stack(audio_out[:-1],1).unsqueeze(0)74waveform = processor.decode(audio_codes)75sf.write("answer_jp2.wav", waveform.cpu()[0],24_000)
ASR
For ASR, we use sequential generation, with the fixed system prompt Perform ASR in japanese..
python
1import torch
2import soundfile as sf
3from liquid_audio import LFM2AudioModel, LFM2AudioProcessor, ChatState, LFMModality
45# Load models6HF_REPO ="LiquidAI/LFM2.5-Audio-1.5B-JP"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("Perform ASR in japanese.")16chat.end_turn()1718chat.new_turn("user")19wav, sampling_rate = sf.read("assets/asr_jp.wav", dtype="float32")20wav = torch.from_numpy(wav).unsqueeze(0)21chat.add_audio(wav, sampling_rate)22chat.end_turn()2324chat.new_turn("assistant")2526# Generate text27for t in model.generate_sequential(**chat, max_new_tokens=512):28if t.numel()==1:29print(processor.text.decode(t), end="", flush=True)3031# Output: この度は弊社の確認不足により多大なご迷惑をおかけしましたことを深くお詫び申し上げます。今後はこのようなことが二度と起こらないよう社内のチェック体制を徹底してまいります。
TTS
For TTS, we also use sequential generation, with the fixed system prompt Perform TTS in japanese..
python
1import torch
2import soundfile as sf
3from liquid_audio import LFM2AudioModel, LFM2AudioProcessor, ChatState, LFMModality
45# Load models6HF_REPO ="LiquidAI/LFM2.5-Audio-1.5B-JP"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("Perform TTS in japanese.")16chat.end_turn()1718chat.new_turn("user")19chat.add_text("先週ご相談いただいた新しいプロジェクトの件ですが、社内で検討した結果、ぜひ前向きに進めさせていただきたいと考えております。つきましては、具体的なスケジュールについて一度お打ち合わせの機会をいただけますでしょうか。")20chat.end_turn()2122chat.new_turn("assistant")2324# Generate text25audio_out:list[torch.Tensor]=[]26for t in model.generate_sequential(**chat, max_new_tokens=512, audio_temperature =0.8, audio_top_k=64):27if t.numel()>1:28 audio_out.append(t)2930# Detokenize audio31audio_codes = torch.stack(audio_out[:-1],1).unsqueeze(0)32waveform = processor.decode(audio_codes)33sf.write("tts_jp.wav", waveform.cpu()[0],24_000)
train a model from the preprocessed dataset with LFM2DataLoader
To finetune our Japanese model on your own data in interleaved generation mode, instantiate the LFM2AudioChatMapper class with interleaved_text_tokens=6 and interleaved_audio_tokens=9. These values reflect the predefined Japanese interleaving ratio of 6 text tokens to 9 audio tokens, based on tokenization statistics.