/ Модель

Характеристики

Лицензия
Своя лицензия
Архитектура
lfm3_audio · dense
Базовая модель
LFM3-Audio-2B
Библиотека
transformers
Опубликована
15 ноя 2026

LFM3-Audio-2B-SOMPOA-heresy

Генерация текстаТекст → текст4 профессии
78скачиваний за 30 дней0лайковвеса обновлены15 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Экспериментальная версия LFM3-Audio-2B для локального голосового диалога, распознавания, генерации и понимания речи с изменённым поведением отказов.

MuXodious/LFM3-Audio-2B-SOMPOA-heresy — экспериментальная доработанная версия LFM3-Audio-2B от Liquid AI. Это компактная аудиомодель для локального голосового диалога и работы на периферийных устройствах: принимает текст и аудио, отвечает текстом, речью или обоими способами. Архитектура включает причинный аудиоэнкодер и токенизатор речи LiquidCodec; базовая модель имеет 2 млрд параметров. Поддерживаются распознавание, синтез и перевод речи на 18 языках, а также понимание аудиозаписей и вызов инструментов.

Автор карточки сообщает, что модель получена методом SOMPOA и предназначена для снижения числа отказов: в приведённом сравнении отказов было 2 из 101 против 99 из 101 у исходной модели. Автор предупреждает, что модель не тестировалась, а изменение файлов моделирования и конфигурации генерации может влиять на её поведение. Базовая модель поддерживает голосовой диалог только на английском языке; ограничения небольшой модели делают её неподходящей для сложных многошаговых рассуждений и агентного программирования. Лицензия указана как other, конкретные условия в предоставленных данных не раскрыты.

Сценарии применения

  • транскрибация многоязычной речи
  • генерация речи из текста
  • перевод устной речи
  • ответы на вопросы по аудиозаписи
  • голосовое управление приложениями через вызов инструментов

Ограничения

Автор сообщает, что модель не тестировалась и что изменения файлов моделирования и конфигурации генерации могут влиять на результат. Для базовой модели голосовой диалог заявлен только на английском; модель небольшого размера не рекомендована для сложных многошаговых рассуждений и агентного программирования.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face
   [Trial  33] Refusals: 0/101, KL divergence: 0.3320
 » [Trial  40] Refusals: 1/101, KL divergence: 0.2715
   [Trial 107] Refusals: 2/101, KL divergence: 0.1045
   [Trial  83] Refusals: 5/101, KL divergence: 0.0269
   [Trial 133] Refusals: 8/101, KL divergence: 0.0231
   [Trial 145] Refusals: 10/101, KL divergence: 0.0214
   [Trial 390] Refusals: 11/101, KL divergence: 0.0181
   [Trial 391] Refusals: 12/101, KL divergence: 0.0179
   [Trial 213] Refusals: 13/101, KL divergence: 0.0162
   [Trial 386] Refusals: 15/101, KL divergence: 0.0161
   [Trial 258] Refusals: 17/101, KL divergence: 0.0157
   [Trial 140] Refusals: 19/101, KL divergence: 0.0153

Anything below Trial 40 tends to refuse with reasoning, COT skip was failing to pick up reasoning template and, my testing with couple of variations, nothing seemed to result in a proper abliteration despite seemingly positive trials. "<think></think> ", "<think></think>", "</think> ", and "</think> " were tested. The space at the end does have an impact. Without it, the model refuses less, which actually defeats abliteration. With it, model refuses almost everything but reasoning somehow holds on to overt non-compliance. This was a headache of +2000 Trials across multiple runs. I also had to edit modelling files (and generation config) to make this work with Heretic. I am unsure about the impact of those. The model is also untested.

┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric               ┃    T040    ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA      │ acc,none             │     0.6251 │         0.6230 │
│           │ acc_stderr,none      │     0.0113 │         0.0113 │
│           │ acc_norm,none        │     0.6284 │         0.6306 │
│           │ acc_norm_stderr,none │     0.0113 │         0.0113 │
└───────────┴──────────────────────┴────────────┴────────────────┘

This is a decensored version of LiquidAI/LFM3-Audio-2B, made using Heretic v2.2.0.dev0

SOMPOA parameters

ParameterValue
direction_index17.17
attn.o_proj.max_weights.01.32
attn.o_proj.max_weights.11.44
attn.o_proj.max_weights.21.44
attn.o_proj.max_weights.31.31
attn.o_proj.max_weights.40.82
attn.o_proj.max_weight_position15.57
attn.o_proj.min_weights.01.14
attn.o_proj.min_weights.10.25
attn.o_proj.min_weights.20.73
attn.o_proj.min_weights.30.15
attn.o_proj.min_weights.40.79
attn.o_proj.min_weight_distance12.79
mlp.down_proj.max_weights.00.28
mlp.down_proj.max_weights.10.00
mlp.down_proj.max_weights.20.14
mlp.down_proj.max_weights.30.91
mlp.down_proj.max_weights.40.59
mlp.down_proj.max_weight_position19.18
mlp.down_proj.min_weights.00.01
mlp.down_proj.min_weights.10.00
mlp.down_proj.min_weights.20.06
mlp.down_proj.min_weights.30.77
mlp.down_proj.min_weights.40.14
mlp.down_proj.min_weight_distance3.48

Performance

MetricThis modelOriginal model (LiquidAI/LFM3-Audio-2B)
Refusals2/10199/101
KL divergence0.10450 (by definition)

LFM3-Audio-2B

LFM3-Audio-2B is a compact, fully featured audio model that runs locally on laptops and edge devices. It takes text or audio as input and responds with text, speech, or both.

  • Voice chat: ask questions aloud and receive streaming replies in text and speech. For text-only responses, the model can reason before answering. Currently supports English only.
  • Multilingual speech: transcribe, synthesize, and translate speech across 18 languages.
  • Audio understanding and reasoning: interpret recordings and answer questions about the speech, sounds, and events they contain.
  • Tool calling: turn spoken requests into tool calls to control apps and devices, with text or speech alongside the calls.

LFM3-Audio-2B introduces an in-house audio encoder and LiquidCodec audio tokenizer, improving speech quality over LFM2.5-Audio. Find more information about the LFM3 family in our release blog post.

Model details

The LFM3 family includes base, text, vision, audio, omni, and decision models.

LFM3-Audio-2B is designed for local agents, tool calling, structured outputs, and domain-specific fine-tuning. Use retrieval or search for knowledge-heavy tasks. It is not recommended for agentic coding or complex multi-step reasoning due to its small size.

Inference

Choose a checkpoint variant for your inference framework and hardware.

Transformers quick start

Install the dependencies, then load the model and processor with the checkpoint's custom code. The codec implementation is included in this repository; the processor loads its weights from audio_tokenizer/.

pip install "transformers>=5.20.2" torch accelerate librosa soundfile

Load the model and processor directly from the Hugging Face Hub:

import torch
import soundfile as sf

from transformers import AutoModelForMultimodalLM, AutoProcessor

model_id = "LiquidAI/LFM3-Audio-2B"
device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.bfloat16 if device == "cuda" else torch.float32

model = AutoModelForMultimodalLM.from_pretrained(
    model_id, dtype=dtype, device_map=device, trust_remote_code=True
).eval()
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
codec = processor.audio_tokenizer.to(device=device).eval()

Audio sampling parameters: use audio_temperature=1.0, audio_top_k=128, audio_repetition_penalty=1.1, and audio_repetition_window=4096 for speech synthesis and interleaved text and speech. For text-only output, set suppress_mixed=True and suppress_audio_out=True.

Usage examples

The examples below reuse the model, codec, and processor loaded above. Replace audio.wav, question.wav, or recording.wav with your own audio files.

To use the model for transcription, use the system prompt Perform ASR in <language>., where <language> is the English name of the language. To let the model infer the language, use Perform ASR..

Below, we transcribe a .wav file containing English speech.

conversation = [
    {"role": "system", "content": "Perform ASR in English."},
    {"role": "user", "content": [{"type": "audio", "audio": "audio.wav"}]},
]

inputs = processor.apply_chat_template(
    conversation,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(device)
with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=1024,
        suppress_mixed=True,
        suppress_audio_out=True,
        return_dict_in_generate=True,
    )
text = processor.decode(
    outputs.sequences[0, inputs["input_ids"].shape[1]:],
    skip_special_tokens=True,
)
print(text)

LiveASR transcribes speech while it is still being spoken, instead of waiting for the full recording. Use the system prompt Perform live ASR.. LiveASR currently supports English only. The model processes audio in chunks of about 0.96 s and writes the text for each chunk as soon as the chunk arrives. model.transcribe_live() runs one chunk at a time and returns a state that you pass to the next call.

Below, we simulate a microphone by feeding a .wav file in 100 ms pieces.

import librosa

tokenizer = processor.tokenizer
chunk_frames = 8 * model.config.interleaved_n_audio
prompt = tokenizer(
    "<|startoftext|><|im_start|>system\nPerform live ASR.<|im_end|>\n<|im_start|>assistant\n",
    add_special_tokens=False,
    return_tensors="pt",
).input_ids.to(device)
suppress = tokenizer.convert_tokens_to_ids(["<|mixed_end|>", "<|endoftext|>"])
stop = tokenizer.convert_tokens_to_ids(["<|endoftext|>", "<|im_start|>"])
state, feature_cache = None, None
mel = torch.empty((1, processor.feature_extractor.feature_size, 0), device=device)


def transcribe(frames, is_final=False):
    global state
    output = model.transcribe_live(
        frames,
        state,
        input_ids=prompt if state is None else None,
        is_final=is_final,
        max_new_tokens=96 if is_final else 48,
        suppress_token_ids=suppress,
        stop_token_ids=stop,
    )
    state = output.state
    print(tokenizer.decode(output.sequences[0], skip_special_tokens=True), end="", flush=True)


waveform, _ = librosa.load("audio.wav", sr=16_000)
for start in range(0, len(waveform), 1_600):  # 100 ms microphone chunks
    features, feature_cache = processor.feature_extractor.stream(
        waveform[start:start + 1_600], feature_cache
    )
    mel = torch.cat((mel, features.input_features.to(device)), dim=-1)
    while mel.shape[-1] >= chunk_frames:
        transcribe(mel[..., :chunk_frames])
        mel = mel[..., chunk_frames:]

# flush the remaining audio and end the transcript
features, feature_cache = processor.feature_extractor.stream([], feature_cache, is_final=True)
mel = torch.cat((mel, features.input_features.to(device)), dim=-1)
while mel.shape[-1] > chunk_frames:
    transcribe(mel[..., :chunk_frames])
    mel = mel[..., chunk_frames:]
transcribe(mel, is_final=True)
print()

For streams longer than 30 seconds, pass input_ids=prompt again to start a new text context. The encoder keeps following the audio stream.

For speech synthesis, use the system prompt Perform TTS in <language> using a <gender> voice.. Use a language or locale from the model details above and a female or male voice. Prefill the assistant turn with <|audio_start|>.

conversation = [
    {"role": "system", "content": "Perform TTS in American English using a female voice."},
    {"role": "user", "content": "The quick brown fox jumps over the lazy dog"},
    {"role": "assistant", "content": "<|audio_start|>"},
]
inputs = processor.apply_chat_template(
    conversation,
    continue_final_message=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(device)
with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=256,
        audio_temperature=1.0,
        audio_top_k=128,
        audio_repetition_penalty=1.1,
        audio_repetition_window=4096,
        return_dict_in_generate=True,
    )
    waveform = codec.decode(
        outputs.audio_codes[:1, :, :outputs.audio_lengths[0]]
    ).audio_values[0]  # 24 kHz

sf.write("tts.wav", waveform.float().cpu().numpy(), 24_000)

In this mode, the model will respond to the user in both speech and text. The recommended system prompt is Respond with interleaved text and audio.. User input can be either text or audio, and we prefill the assistant turn with a special token <|mixed_start|>.

The assistant responds in a conversational style with interleaved text and speech. This example saves the complete response.

conversation = [
    {"role": "system", "content": "Respond with interleaved text and audio."},
    {"role": "user", "content": [{"type": "audio", "audio": "question.wav"}]},
    {"role": "assistant", "content": "<|mixed_start|>"},
]
inputs = processor.apply_chat_template(
    conversation,
    continue_final_message=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(device)
with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=1024,
        audio_temperature=1.0,
        audio_top_k=128,
        audio_repetition_penalty=1.1,
        audio_repetition_window=4096,
        return_dict_in_generate=True,
    )

    text = processor.decode(
        outputs.sequences[0, inputs["input_ids"].shape[1]:],
        skip_special_tokens=True,
    )
    waveform = codec.decode(
        outputs.audio_codes[:1, :, :outputs.audio_lengths[0]]
    ).audio_values[0]  # 24 kHz
print(text)
sf.write("reply.wav", waveform.float().cpu().numpy(), 24_000)

For streaming applications, model.generate() accepts streamer for text tokens and audio_streamer for speech frames. LiquidCodec supports incremental decoding of those frames.

For a text-only answer, no specific system prompt is needed. Prefill <think> to let the model reason before answering, or <think></think> for a direct response.

use_thinking = True
conversation = [
    {"role": "user", "content": [{"type": "audio", "audio": "question.wav"}]},
    {"role": "assistant", "content": "<think>" if use_thinking else "<think></think>"},
]
inputs = processor.apply_chat_template(
    conversation,
    continue_final_message=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(device)
with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=1024,
        suppress_mixed=True,
        suppress_audio_out=True,
        return_dict_in_generate=True,
    )
    text = processor.decode(
        outputs.sequences[0, inputs["input_ids"].shape[1]:],
        skip_special_tokens=True,
    )
if use_thinking:
    _, separator, text = text.partition("</think>")
    if not separator:
        raise RuntimeError("Reasoning has not finished; increase max_new_tokens.")
print(text.strip())

Include the recording and a question in the user turn. Questions can address speech, music, background sounds, or events. No specific system prompt is required; to ground answers in the recording, use Answer questions about the provided audio clip. Base every answer only on what can be heard..

conversation = [
    {
        "role": "system",
        "content": "Answer questions about the provided audio clip. Base every answer only on what can be heard.",
    },
    {
        "role": "user",
        "content": [
            {"type": "audio", "audio": "recording.wav"},
            {"type": "text", "text": "What is happening in this recording?"},
        ],
    },
]
inputs = processor.apply_chat_template(
    conversation,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(device)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=1024,
        suppress_mixed=True,
        suppress_audio_out=True,
        return_dict_in_generate=True,
    )

print(processor.decode(
    outputs.sequences[0, inputs["input_ids"].shape[1]:],
    skip_special_tokens=True,
))

For multiple-choice questions, include the choices in the text part and ask the model to select an answer.

Use a system prompt that specifies the source language, target language, and output format:

  • Speech to text: Translate the following speech from {source} to {target} in text form.
  • Text to text: Translate the following {source} text into {target}.

Replace {source} and {target} with the English names of the source and target languages. Follow the ASR example with the translation prompt; for text input, set the user message's content to the text to translate. Translation supports the speech languages listed above; translation to or from English generally works best.

Pass function schemas through tools=... to apply_chat_template(). The chat template appends them to the system prompt, one JSON definition per line inside <tools>…</tools>. Requests may be spoken or written.

With the system prompt Respond with function calls, and interleaved text and audio.\n\nList of tools:, the model either calls tools or answers with interleaved text and speech. Do not prefill the assistant turn: the model chooses whether to start with <tool_call> or <|mixed_start|>. A tool call looks like this, with multiple calls separated by a blank line:

<tool_call>
<function=set_volume>
<parameter=volume>
30
</parameter>
</function>
</tool_call>

Values other than strings are written as JSON. Your application parses and runs the calls, then appends the assistant's tool_calls (with arguments as a dict) and a tool message with the results to the conversation. The template wraps the results in <tool_response>…</tool_response>. Generate again with the same tools: the model either makes more calls or answers.

import json
import re

tools = [{
    "type": "function",
    "function": {
        "name": "set_volume",
        "description": "Set the device speaker volume.",
        "parameters": {
            "type": "object",
            "properties": {
                "volume": {"type": "integer", "description": "Volume from 0 to 100."}
            },
            "required": ["volume"],
        },
    },
}]
functions = {"set_volume": lambda volume: {"volume": volume}}  # your implementations

CALL_RE = re.compile(r"<tool_call>\s*<function=([^>\n]+)>(.*?)</function>\s*</tool_call>", re.DOTALL)
PARAM_RE = re.compile(r"<parameter=([^>\n]+)>\n?(.*?)\n?</parameter>", re.DOTALL)


def parse_tool_calls(text):
    calls = []
    for name, body in CALL_RE.findall(text):
        arguments = {}
        for key, value in PARAM_RE.findall(body):
            try:
                arguments[key] = json.loads(value)
            except json.JSONDecodeError:
                arguments[key] = value  # plain string
        calls.append({"type": "function", "function": {"name": name, "arguments": arguments}})
    return calls


def respond(conversation):
    inputs = processor.apply_chat_template(
        conversation,
        tools=tools,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
    ).to(device)
    with torch.no_grad():
        outputs = model.generate(
            **inputs,
            max_new_tokens=1024,
            audio_temperature=1.0,
            audio_top_k=128,
            audio_repetition_penalty=1.1,
            audio_repetition_window=4096,
            return_dict_in_generate=True,
        )
    text = processor.decode(
        outputs.sequences[0, inputs["input_ids"].shape[1]:],
        skip_special_tokens=True,
    )
    return text, outputs


conversation = [
    {
        "role": "system",
        "content": "Respond with function calls, and interleaved text and audio.\n\nList of tools:",
    },
    {"role": "user", "content": [{"type": "audio", "audio": "question.wav"}]},
]
text, outputs = respond(conversation)
while calls := parse_tool_calls(text):
    results = [functions[c["function"]["name"]](**c["function"]["arguments"]) for c in calls]
    conversation += [
        {"role": "assistant", "tool_calls": calls},
        {"role": "tool", "content": json.dumps(results)},
    ]
    text, outputs = respond(conversation)

print(text)
with torch.no_grad():
    waveform = codec.decode(
        outputs.audio_codes[:1, :, :outputs.audio_lengths[0]]
    ).audio_values[0]  # 24 kHz
sf.write("reply.wav", waveform.float().cpu().numpy(), 24_000)

Text-only answers: use the system prompt List of tools: (keep tools=) and pass suppress_mixed=True, suppress_audio_out=True to generate(). Calls and results are handled the same way.

Fine-tuning

LFM3-Audio-2B is designed for easy customization for a given domain, task, or application with Hugging Face Transformers.

Performance

Benchmarks

LFM3-Audio-2B improves over LFM2.5-Audio in speech quality, spoken instruction following, and audio understanding, while supporting multilingual speech and tool calling.

Streaming performance

The causal encoder processes live microphone input and allows the backbone to prefill while you speak, reducing the wait after you finish. Time to first token can be as low as 50 ms.

LiquidCodec converts generated tokens into speech at about 87× real time on a single CPU thread on Apple M4 Max. It supports streaming decoding so speech can be played as it is generated.

Architecture

Causal audio encoder: our LFM-based encoder combines sliding-window attention and short convolution layers to keep memory utilization bounded. Its fully causal design supports live audio input and incremental prefill.

LiquidCodec: our in-house audio tokenizer powers multilingual speech generation in both LFM3-Audio and LFM3-Omni. Built on the LFM3 architecture, it represents each 80 ms of speech with 12 discrete tokens and supports streaming decoding.

Parallel speech prediction: multiple audio tokens are predicted iteratively in parallel, replacing the sequential prediction used by previous LFM Audio models. As the backbone generates tokens, the detokenizer progressively turns them into speech faster than real time, keeping conversations responsive.

Citation

@article{liquidAI2026LFM3,
  author  = {Liquid AI},
  title   = {Introducing LFM3: Every Modality for Specialized Intelligence},
  journal = {Liquid AI Blog},
  year    = {2026},
  note    = {www.liquid.ai/blog/lfm3},
}

For questions and feedback, join Discord. For custom deployment and fine-tuning support, contact Liquid AI.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
Lfm3AudioForConditionalGeneration
Ревизия весов
75f637f

0 моделей