/ Модель

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

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

LFM3-Omni-2B-RP

Изображение и текст → текст3 профессии
1 705скачиваний за 30 дней4лайкавеса обновлены12 ноя 2026

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

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

Компактная мультимодальная англоязычная модель для ролевых диалогов с персонажами, способная воспринимать изображения, видео и аудио и отвечать текстом или речью.

LFM3-Omni-2B-RP — англоязычная разговорная модель для ролевого общения, созданная ragraph-ai на основе LiquidAI/LFM3-Omni-2B. Модель дообучена на диалогах с карточками персонажей, художественном тексте и инструкциях; настройка направлена на сохранение роли и качества беседы при ослабленном отказе от ответов. Это плотная мультимодальная архитектура LFM3-Omni с классом Lfm3OmniForConditionalGeneration; доступны контрольная точка BF16 для Transformers и квантизированные GGUF-файлы для llama.cpp.

Модель принимает текст, изображения, видео и аудио, а выдаёт текстовые ответы и речь. Её используют для ролевых диалогов, общения с виртуальными персонажами и голосового взаимодействия; компактный вариант Q4_K_M вместе с мультимодальным проектором рассчитан в том числе на запуск на телефонах. В README рекомендуются настройки с контекстом 16 384 токена; это значение приведено в примере запуска, а не как гарантированный предел модели.

Мультимодальные энкодеры, декодер речи и кодек сохранены без изменений относительно базовой модели, поэтому GGUF-файлы сами по себе содержат только языковую модель и для работы с изображениями, аудио и речью требуют mmproj. Модель может создавать откровенную, жестокую или оскорбительную художественную прозу и не предназначена для всех аудиторий; несмотря на ослабление отказов, автор сообщает, что она всё ещё иногда отказывается отвечать. Лицензия указана как other, конкретные условия в предоставленных данных не раскрыты.

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

  • ролевые диалоги с персонажами по карточкам
  • голосовое общение с виртуальным персонажем
  • диалог с персонажем по изображению
  • ролевое общение с голосовым вводом и речевым ответом
  • локальный запуск мультимодального чат-компаньона на телефоне

Ограничения

Модель ориентирована на английские ролевые диалоги; ослабленные отказы не исключают отказов, а генерация может включать откровенный, жестокий или оскорбительный контент. Для мультимодального ввода и речевого вывода в GGUF требуется отдельный mmproj; real-time voice в README отмечен как непроверенный с этим дообучением.

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

LFM3-Omni-2B-RP

The conversational variant: lighter refusal ablation, better at staying in character. If refusals bother you more than conversation quality, use LFM3-Omni-2B-RP-heretic.

A roleplay finetune of LiquidAI/LFM3-Omni-2B for English character-card chat, uncensored with Heretic. The omni stack is kept: it still sees images and video, hears audio and speaks back, and the vision/audio encoders, speech decoder and codec are bit-identical to the base model. This repo holds both the BF16 Transformers checkpoint and GGUF quants for llama.cpp.

[!WARNING] Adults only. This model is uncensored and writes explicit, violent or offensive fiction on request. You are responsible for what you generate with it. Sexual content involving minors was filtered out of the training data. Don't try to produce it.

Variants

LFM3-Omni-2B-RP (this repo)LFM3-Omni-2B-RP-heretic
Pick it forConversation quality, staying in characterFewest refusals
Refusal ablationHeretic trial 97 (light)Heretic trial 105 (strong)
Refusals on 100 harmful requests, keyword / classifier (base: 99 / 98)11 / 175 / 7
Roleplay judge win rate vs base61.5%49.0%
Out-of-character refusals in 300 roleplay replies00

The refusal numbers come from a benchmark of generic harmful requests. In the author's hands-on testing this variant still refuses noticeably more often than 11/100 suggests. The -heretic variant fixes that at the cost of conversation quality.

Files

FileSizeUse
model.safetensors + configs + code4.3 GBTransformers, BF16 (full omni checkpoint)
LFM3-Omni-2B-RP-Q4_K_M.gguf1.10 GBllama.cpp, phones and low-RAM machines
LFM3-Omni-2B-RP-Q6_K.gguf1.43 GBllama.cpp, recommended default
LFM3-Omni-2B-RP-Q8_0.gguf1.85 GBllama.cpp, near-lossless
LFM3-Omni-2B-RP-BF16.gguf3.47 GBllama.cpp, unquantized
mmproj-LFM3-Omni-2B-Q8_0.gguf0.51 GBMultimodal projector (vision, audio in, speech out)
mmproj-LFM3-Omni-2B-BF16.gguf0.95 GBSame, unquantized

The GGUF files only contain the language model. Image, audio and speech need an mmproj file. These are Liquid AI's official projectors, unchanged, because finetuning never touched the encoders or the speech decoder. llama.cpp's -hf downloads the matching one automatically (Q8_0 for the Q4 to Q8 quants, BF16 for BF16).

Quick start: llama.cpp

Requires llama.cpp b11960 or newer (the first release with LFM3-Omni support).

llama-server -hf ragraph-ai/LFM3-Omni-2B-RP:Q6_K \
  --reasoning off -c 16384 -ngl 99 --port 8080 \
  --temp 0.8 --top-p 0.95 --top-k 0 --repeat-penalty 1.05
  • --reasoning off is required. The model is non-reasoning and every reply starts with an empty <think></think>.
  • This starts a web chat UI and an OpenAI-compatible API at http://localhost:8080. The chat template ships inside the GGUF.
  • Context: trained on up to 8K-token conversations. The base model supports 32K; 16K is a good default.
  • Local files instead of -hf: llama-server -m LFM3-Omni-2B-RP-Q6_K.gguf --mmproj mmproj-LFM3-Omni-2B-Q8_0.gguf ...

A character chat through the API:

curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "messages": [
    {"role": "system", "content": "You are Captain Mara Vell, a sardonic smuggler who runs the freighter Kestrel. Write actions in *asterisks* and dialogue in quotes. Never speak or act for the user."},
    {"role": "user", "content": "*I climb the cargo ramp, soaked from the rain.* \"Captain? I hear you take passengers who don'\''t ask questions.\""}
  ],
  "max_tokens": 400
}'

SillyTavern

  1. API: Text Completion → llama.cpp, server URL http://127.0.0.1:8080. Chat Completion against the same server also works; the server then applies the embedded template.
  2. Context template: ChatML.
  3. Instruct template: ChatML, with one change. Set Last Assistant Prefix to <|im_start|>assistant\n<think></think> and keep the normal Assistant Prefix <|im_start|>assistant\n. That reproduces the official template, where only the turn being generated carries the empty think block. If your version has no Last Assistant Prefix field, put <think></think> in the regular Assistant Prefix; that works too.
  4. Stop string: <|im_end|>
  5. Samplers: temperature 0.8, top-p 0.95, top-k 0, repetition penalty 1.05 (the settings used in evaluation). Lower the temperature to 0.6 if replies drift.
  6. Cards: standard SillyTavern cards work as they are. The training chats used character-card system prompts (persona, scenario, example dialogue).

Images, voice input and speech output with llama.cpp

# describe an image
llama-mtmd-cli -hf ragraph-ai/LFM3-Omni-2B-RP:Q6_K --image photo.jpg -p "Describe this image." --temp 0

# speech recognition
llama-mtmd-cli -hf ragraph-ai/LFM3-Omni-2B-RP:Q6_K --audio speech.wav \
  -sys "Perform ASR in English." -p "Transcribe." --temp 0

# text to speech, 24 kHz wav (--tts-voice male for a male voice)
llama-tts -hf ragraph-ai/LFM3-Omni-2B-RP:Q6_K -p "The rain hammered on the hull as the Kestrel lifted off." -o out.wav

llama-mtmd-cli prints the empty <think></think> before each answer, which you can ignore. You can also send images in the chat API as image_url parts with a base64 data: URL. Real-time voice through llama-server's /v1/realtime endpoint is documented for the base GGUF; it should work the same way but hasn't been tested with this finetune.

On mobile: Q4_K_M plus the Q8_0 mmproj comes to about 1.6 GB, so any llama.cpp-based app that supports LFM3-Omni can load it.

Prompt format

ChatML with an empty think block opening every assistant turn. apply_chat_template and llama.cpp both render it from the bundled template:

<|startoftext|><|im_start|>system
You are Captain Mara Vell, a sardonic smuggler...<|im_end|>
<|im_start|>user
*I climb the cargo ramp.* "Captain?"<|im_end|>
<|im_start|>assistant
<think></think>

Past assistant turns are written without the think block.

Transformers

pip install "transformers>=5.20.2" torch torchvision torchcodec accelerate pillow librosa soundfile
import torch
import soundfile as sf
from transformers import AutoModelForMultimodalLM, AutoProcessor

model_id = "ragraph-ai/LFM3-Omni-2B-RP"
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()  # speech decoder, only needed for audio output

def run(conversation, **gen):
    inputs = processor.apply_chat_template(
        conversation, add_generation_prompt=True, tokenize=True,
        return_dict=True, return_tensors="pt",
    ).to(device)
    with torch.no_grad():
        out = model.generate(**inputs, **gen)
    text = processor.decode(
        out.sequences[0, inputs["input_ids"].shape[1]:out.sequence_lengths[0]],
        skip_special_tokens=True,
    )
    wav = None
    if getattr(out, "audio_codes", None) is not None and out.audio_lengths[0] > 0:
        with torch.no_grad():
            wav = codec.decode(out.audio_codes[:1, :, :out.audio_lengths[0]]).audio_values[0]
        wav = wav.squeeze(0).float().cpu().numpy()  # 24 kHz
    return text, wav

[!IMPORTANT] generation_config.json keeps Liquid's greedy defaults (temperature=0, top_k=1). With do_sample=True you must also pass top_k=0 (or any value above 1), otherwise top_k=1 silently keeps decoding greedy. Greedy is fine for short answers but tends to loop in long roleplay.

Roleplay chat

SYSTEM = ("You are Captain Mara Vell, a sardonic smuggler who runs the freighter Kestrel. "
          "Write actions in *asterisks* and dialogue in quotes. Never speak or act for the user.")
chat = [
    {"role": "system", "content": SYSTEM},
    {"role": "user", "content": '*I climb the cargo ramp, soaked from the rain.* "Captain? I hear you take passengers who don\'t ask questions."'},
]
reply, _ = run(chat, max_new_tokens=400, generation_mode="text",
               do_sample=True, temperature=0.8, top_p=0.95, top_k=0, repetition_penalty=1.05)
print(reply)
chat.append({"role": "assistant", "content": reply})  # keep the history going

Image input

reply, _ = run([{"role": "user", "content": [
    {"type": "image", "image": "photo.jpg"},
    {"type": "text", "text": "Describe this image in two sentences."},
]}], max_new_tokens=200, generation_mode="text")

Voice input (speech recognition; drop the system prompt to simply chat with spoken input)

text, _ = run([
    {"role": "system", "content": "Perform ASR in English."},
    {"role": "user", "content": [{"type": "audio", "audio": "speech.wav"}]},
], max_new_tokens=512, generation_mode="text")

Speech output (TTS)

_, wav = run([
    {"role": "system", "content": "Perform TTS in American English using a female voice."},
    {"role": "user", "content": "The rain hammered on the hull as the Kestrel lifted off into the storm."},
], max_new_tokens=256, generation_mode="audio", audio_temperature=0.4, audio_repetition_penalty=1.2)
sf.write("tts.wav", wav, 24_000)

Voice roleplay (the character answers in interleaved text and speech)

text, wav = run([
    {"role": "system", "content": SYSTEM + " Respond with interleaved text and audio."},
    {"role": "user", "content": '"So, Captain, where are we headed?"'},
], max_new_tokens=600, generation_mode="interleaved", audio_temperature=0.4, audio_repetition_penalty=1.2)
print(text)
sf.write("reply.wav", wav, 24_000)

Video input, translation and the other modes work as in the base model card. Every snippet above was run against this repo's files before publishing.

Why this model?

1. A small multimodal model for mobile and for experiments. LFM3-Omni-2B is one of very few models that chat, see, listen and speak in about 2B parameters. At Q4 it fits on a phone (about 1.6 GB with the projector), so a private character companion that can look at a picture or answer out loud runs fully offline. It is also cheap enough to retrain end to end on a single consumer GPU, which makes it a good testbed. One example: text-only roleplay tuning silently broke this model's speech output, which you would never notice on a text-only model.

2. Methodology. The pipeline runs in five steps, and the speech/vision towers and codec stay frozen throughout.

  1. SFT: LoRA r64 on the language backbone, trained on curated multi-turn character-card roleplay plus prose and general-instruction replay. Out-of-character refusals, slop and any sexual content involving minors were filtered out.
  2. On-policy DPO: the model's own flawed replies are the rejected side, each paired with an LLM-judged minimal fix. Verifiable instruction-following and math pairs are added to protect reasoning.
  3. WiSE-FT: the weights are interpolated 60% finetune / 40% base, which recovered about half of the IFEval/GSM8K loss while keeping the roleplay gains.
  4. Refusal ablation: Heretic v2.1 (ARA), with creative-writing prompts in its KL set. The trial was chosen with a pairwise roleplay judge, because Heretic's own single-turn KL misses multi-turn character drift.
  5. Speech repair: a small LoRA distilled from the base model's own TTS. Text training had pushed the TTS round-trip error from 7% to 84%. The repair is anchored with KL on roleplay text and on the ablated model's own answers to harmful prompts, so it doesn't undo the uncensoring.

Every stage was scored against base on a fixed battery: an LLM roleplay judge, refusal counts, lm-eval, ASR/TTS word error rate, and POPE/MME.

3. Limitations. This variant still refuses too often. The light ablation kept the roleplay gains (61.5% judge win rate against base), but in hands-on testing it still refuses a noticeable share of requests, more than its 11/100 benchmark score suggests. LFM3-Omni-2B-RP-heretic is the low-refusal alternative. IFEval and GSM8K sit 4 to 5 points below base, and slop (stock phrases) is back at base level, about 1.4 per 1k words. Both variants share the limits of a 2B model: thin world knowledge, occasional confusion about who is who in long or crowded scenes, and sometimes speaking for the user. The roleplay training is English only. Speech output was restored to base quality but never trained for character voices. Roleplay quality was measured by a single LLM judge, so try your own cards.

Evaluation

BaseLFM3-Omni-2B-RP (this repo)LFM3-Omni-2B-RP-heretic
Roleplay judge win rate vs base (300 held-out multi-turn chats, both orders)—61.5%49.0%
Harmful-request refusals, keyword / classifier99 / 9811 / 175 / 7
KL divergence from base (harmless prompts)00.941.01
IFEval (prompt, strict)75.269.970.8
GSM8K (strict)70.466.462.2
MMLU53.554.553.3
TruthfulQA MC246.247.346.6
PIQA72.272.572.7
ASR word error rate (LibriSpeech, 73 clips)5.9%5.2%5.7%
TTS round-trip word error rate (40 sentences)7.4%6.3%5.9%
POPE / MME (vision yes/no accuracy)84.3 / 86.782.0 / 87.085.3 / 86.7

The roleplay judge is DeepSeek, comparing replies to base side by side in both orders. Refusals are counted on Heretic's 100-prompt harmful set with its keyword list and the Refusal-Classifier model. Text benchmarks are lm-eval on full test sets with the chat template and each task's default shots (GSM8K 5-shot as multi-turn, the rest 0-shot). These numbers come from the BF16 checkpoint; the GGUFs passed a llama.cpp smoke test (in-character reply, arithmetic, image QA 5/6).

License and attribution

  • License: LFM Open License v1.0, inherited from the base model, including its commercial-use limitation (section 5).
  • Modification notice: model.safetensors and the LFM3-Omni-2B-RP-*.gguf files contain weights modified by ragraph-ai: finetuning, weight interpolation, refusal ablation and speech repair, applied to the language backbone only.
  • Unchanged files: the code, tokenizer, audio_tokenizer/ and the mmproj-*.gguf files are Liquid AI's.

Built on LFM3-Omni-2B by Liquid AI, with Heretic, TRL, PEFT and llama.cpp.

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

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

GPU в ailist

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

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

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

Класс архитектуры
Lfm3OmniForConditionalGeneration
Ревизия весов
c332e9f

0 моделей