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 for | Conversation quality, staying in character | Fewest refusals |
| Refusal ablation | Heretic trial 97 (light) | Heretic trial 105 (strong) |
| Refusals on 100 harmful requests, keyword / classifier (base: 99 / 98) | 11 / 17 | 5 / 7 |
| Roleplay judge win rate vs base | 61.5% | 49.0% |
| Out-of-character refusals in 300 roleplay replies | 0 | 0 |
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
| File | Size | Use |
|---|---|---|
model.safetensors + configs + code | 4.3 GB | Transformers, BF16 (full omni checkpoint) |
LFM3-Omni-2B-RP-Q4_K_M.gguf | 1.10 GB | llama.cpp, phones and low-RAM machines |
LFM3-Omni-2B-RP-Q6_K.gguf | 1.43 GB | llama.cpp, recommended default |
LFM3-Omni-2B-RP-Q8_0.gguf | 1.85 GB | llama.cpp, near-lossless |
LFM3-Omni-2B-RP-BF16.gguf | 3.47 GB | llama.cpp, unquantized |
mmproj-LFM3-Omni-2B-Q8_0.gguf | 0.51 GB | Multimodal projector (vision, audio in, speech out) |
mmproj-LFM3-Omni-2B-BF16.gguf | 0.95 GB | Same, 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 offis 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
- 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. - Context template: ChatML.
- 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. - Stop string:
<|im_end|> - 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.
- 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.jsonkeeps Liquid's greedy defaults (temperature=0,top_k=1). Withdo_sample=Trueyou must also passtop_k=0(or any value above 1), otherwisetop_k=1silently 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.
- 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.
- 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.
- WiSE-FT: the weights are interpolated 60% finetune / 40% base, which recovered about half of the IFEval/GSM8K loss while keeping the roleplay gains.
- 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.
- 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
| Base | LFM3-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 / classifier | 99 / 98 | 11 / 17 | 5 / 7 |
| KL divergence from base (harmless prompts) | 0 | 0.94 | 1.01 |
| IFEval (prompt, strict) | 75.2 | 69.9 | 70.8 |
| GSM8K (strict) | 70.4 | 66.4 | 62.2 |
| MMLU | 53.5 | 54.5 | 53.3 |
| TruthfulQA MC2 | 46.2 | 47.3 | 46.6 |
| PIQA | 72.2 | 72.5 | 72.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.7 | 82.0 / 87.0 | 85.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.safetensorsand theLFM3-Omni-2B-RP-*.gguffiles 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 themmproj-*.gguffiles are Liquid AI's.
Built on LFM3-Omni-2B by Liquid AI, with Heretic, TRL, PEFT and llama.cpp.