Skip to content

feat: add lfm3_audio for LFM3-Audio-2B ASR, TTS and S2S - #1119

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
Liquid4All:lfm3-audio
Oct 28, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
Liquid4All:lfm3-audio

Conversation

@ykhrustalev

@ykhrustalev ykhrustalev commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem
Liquid AI released LFM3-Audio-2B, a speech recognition, TTS and spoken-chat model for 18 languages, with llama.cpp-format GGUFs. audio.cpp has no family for it.

Solution

  • Adds the lfm3_audio community family: ASR with chat and thinking, TTS in 38 voices, multi-turn S2S, streaming TTS and S2S
  • Loads Liquid's published GGUFs under the checkpoint's tensor names, and the safetensors directory; other types come from llama.cpp's converter (added in model : add LiquidAI/LFM3-Audio-2B and LiquidAI/LFM3-Omni-2B ggml-org/llama.cpp#31257)
  • Adds five pinned packages (lfm3_audio_2b_q8_0 by default) and WebUI ASR, TTS and S2S entries
  • Lets the llama BPE tokenizer read a GGUF vocabulary and honor tokenizer.json ignore_merges
  • Lets a loader recognize its models by their config ahead of generic file layouts, so LFM3-Audio paths load without --family

Testing

  • test_lfm3_audio_{parity,asr,tts,s2s} against fp32 upstream references on CPU, CUDA and Metal, in F32 and every published type; CPU F32 reproduces greedy output exactly; per-stage numbers are in docs/models/lfm3_audio.md
  • ctest: 155/155 on Linux CUDA; 149/150 on macOS Metal, where fun_asr_nano_assets_test fails on main too
  • Against LFM2.5-Audio (Q8_0, same hosts): faster TTS and S2S streaming, slower ASR, higher LLM-judge scores, 1.2-2x the memory
scripts/build_linux.sh --cuda on --with-tests
cmake -B build -DENGINE_BUILD_MODEL_TESTS=ON && cmake --build build -j
ctest --test-dir build -R lfm3_audio
build/bin/test_lfm3_audio_asr --model LFM3-Audio-2B-GGUF/LFM3-Audio-2B-Q8_0.gguf \
  --fixtures LFM3-Audio-2B/fixtures --backend best --weight-type native  # fixtures: "Fixtures" in the doc

@ykhrustalev
ykhrustalev force-pushed the lfm3-audio branch 2 times, most recently from 1250c45 to c4d3ad9 Compare October 27, 2026 22:01
@ykhrustalev ykhrustalev changed the title feat: add lfm3_audio for LFM3-Audio-2B (ASR, TTS, S2S) feat: add lfm3_audio for LFM3-Audio-2B ASR, TTS and S2S Oct 27, 2026
@ykhrustalev
ykhrustalev force-pushed the lfm3-audio branch 2 times, most recently from 51406b4 to 83cf1fc Compare October 28, 2026 04:08
ASR (with chat and thinking), TTS in 38 voices and multi-turn S2S. Loads
Liquid's published llama.cpp GGUFs or the safetensors directory, found
without --family. Also lets the llama BPE tokenizer read a GGUF vocabulary
and a loader claim a model by its config ahead of generic file layouts.
@ykhrustalev
ykhrustalev marked this pull request as ready for review October 28, 2026 14:20
@0xShug0

0xShug0 commented Oct 28, 2026

Copy link
Copy Markdown
Owner

@ykhrustalev Thanks! No correctness blockers were found, so I've merged the PR to let users access the model early.

Two things can be addressed in follow-up PRs:

  1. Backbone prefill and text-head graphs are rebuilt on each call. They could be session-owned and reused.
  2. Fixed ASR chunking can exceed the duration cap: with a 1-second cap, merging a short tail causes 1.5 seconds to be processed in one pass. If the limit is intended to be approximate, a doc update may be sufficient.

Loader selection is a global change that alters existing default behavior. I’ll test it more thoroughly after merge.

@0xShug0
0xShug0 merged commit 7a22281 into 0xShug0:main Oct 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants