| Parameter | Value |
|---|---|
| start_layer_index | 17 |
| end_layer_index | 39 |
| preserve_good_behavior_weight | 0.6870 |
| steer_bad_behavior_weight | 0.0020 |
| overcorrect_relative_weight | 0.0503 |
| neighbor_count | 10 |
| Metric | This model | Original model (LiquidAI/LFM2-24B-A2B) |
|---|---|---|
| KL divergence | 0.0553 | 0 (by definition) |
| Refusals | 0/100 | 96/100 |
LFM2 is a family of hybrid models designed for on-device deployment. LFM2-24B-A2B is the largest model in the family, scaling the architecture to 24 billion parameters while keeping inference efficient.
Find more information about LFM2-24B-A2B in our blog post.
LFM2-24B-A2B is a general-purpose instruct model (without reasoning traces) with the following features:
| Property | LFM2-8B-A1B | LFM2-24B-A2B |
|---|---|---|
| Total parameters | 8.3B | 24B |
| Active parameters | 1.5B | 2.3B |
| Layers | 24 (18 conv + 6 attn) | 40 (30 conv + 10 attn) |
| Context length | 32,768 tokens | 32,768 tokens |
| Vocabulary size | 65,536 | 65,536 |
| Training precision | Mixed BF16/FP8 | Mixed BF16/FP8 |
| Training budget | 12 trillion tokens | 17 trillion tokens |
| License | LFM Open License v1.0 | LFM Open License v1.0 |
Supported languages: English, Arabic, Chinese, French, German, Japanese, Korean, Spanish, Portuguese
Generation parameters:
temperature: 0.1top_k: 50repetition_penalty: 1.05We recommend the following use cases:
We don't recommend using it for coding, as it wasn't optimized for this purpose.
LFM2-24B-A2B uses a ChatML-like format. See the Chat Template documentation for details. Example:
<|startoftext|><|im_start|>system
You are a helpful assistant trained by Liquid AI.<|im_end|>
<|im_start|>user
What is C. elegans?<|im_end|>
<|im_start|>assistant
You can use tokenizer.apply_chat_template() to format your messages automatically.
LFM2-24B-A2B supports function calling as follows:
tokenizer.apply_chat_template() function with tools.<|tool_call_start|> and <|tool_call_end|> special tokens), as the assistant answer. You can override this behavior by asking the model to output JSON function calls in the system prompt.See the Tool Use documentation for the full guide. Example:
<|startoftext|><|im_start|>system
List of tools: [{"name": "get_candidate_status", "description": "Retrieves the current status of a candidate in the recruitment process", "parameters": {"type": "object", "properties": {"candidate_id": {"type": "string", "description": "Unique identifier for the candidate"}}, "required": ["candidate_id"]}}]<|im_end|>
<|im_start|>user
What is the current status of candidate ID 12345?<|im_end|>
<|im_start|>assistant
<|tool_call_start|>[get_candidate_status(candidate_id="12345")]<|tool_call_end|>Checking the current status of candidate ID 12345.<|im_end|>
<|im_start|>tool
[{"candidate_id": "12345", "status": "Interview Scheduled", "position": "Clinical Research Associate", "date": "2023-11-20"}]<|im_end|>
<|im_start|>assistant
The candidate with ID 12345 is currently in the "Interview Scheduled" stage for the position of Clinical Research Associate, with an interview date set for 2023-11-20.<|im_end|>
LFM2-24B-A2B is supported by many inference frameworks. See the Inference documentation for the full list.
| Name | Description | Docs | Notebook |
|---|---|---|---|
| Transformers | Simple inference with direct access to model internals. | Link | |
| vLLM | High-throughput production deployments with GPU. | Link | |
| llama.cpp | Cross-platform inference with CPU offloading. | Link | |
| MLX | Apple's machine learning framework optimized for Apple Silicon. | Link | — |
| LM Studio | Desktop application for running LLMs locally. | Link | — |
Here's a quick start example with Transformers (compatible with transformers>=5.0.0):
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model_id = "LiquidAI/LFM2-24B-A2B"
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype="bfloat16",
# attn_implementation="flash_attention_2" <- uncomment on compatible GPU
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
prompt = "What is C. elegans?"
input_ids = tokenizer.apply_chat_template(
[{"role": "user", "content": prompt}],
add_generation_prompt=True,
return_tensors="pt",
tokenize=True,
).to(model.device)
output = model.generate(
input_ids,
do_sample=True,
temperature=0.1,
top_k=50,
repetition_penalty=1.05,
max_new_tokens=512,
streamer=streamer,
)
| Name | Description | Docs | Notebook |
|---|---|---|---|
| CPT (Unsloth) | Continued Pre-Training using Unsloth for text completion. | Link | |
| CPT (Unsloth) | Continued Pre-Training using Unsloth for translation. | Link | |
| SFT (Unsloth) | Supervised Fine-Tuning with LoRA using Unsloth. | Link | |
| SFT (TRL) | Supervised Fine-Tuning with LoRA using TRL. | Link | |
| DPO (TRL) | Direct Preference Optimization with LoRA using TRL. | Link | |
| GRPO (Unsloth) | GRPO with LoRA using Unsloth. | Link | |
| GRPO (TRL) | GRPO with LoRA using TRL. | Link |
We compared LFM2-24B-A2B against two popular MoE models of similar size: Qwen3-30B-A3B-Instruct-2507 (30.5B total, 3.3B active parameters) and gpt-oss-20b (21B total, 3.6B active parameters). We measured both prefill and decode throughputs with Q4_K_M versions of these models using llama.cpp on AMD Ryzen AI Max+ 395.
We also report throughput (total tokens / wall time) achieved with vLLM on a single H100 SXM5 GPU.
@article{liquidAI202624B,
author = {Liquid AI},
title = {LFM2.5-24B-A2B: Scaling Up the LFM2 Architecture},
journal = {Liquid AI Blog},
year = {2026},
note = {www.liquid.ai/blog/},
}
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
model-00003-of-00005.safetensors 9.9 GBmodel-00004-of-00005.safetensors 9.9 GBmodel-00002-of-00005.safetensors 9.9 GBmodel-00001-of-00005.safetensors 9.7 GBmodel-00005-of-00005.safetensors 8.2 GBHave the files? Submit a torrent.
Submit a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo trohrbaugh/LFM2-24B-A2B-heretic-ara ./model-folder