Skip to main content
← Back to Text Models LFM2-8B-A1B is Liquid AI’s Mixture-of-Experts model, combining 8B total parameters with only 1.5B active parameters per forward pass. This delivers the quality of larger models with the speed and efficiency of smaller ones—ideal for on-device deployment.

Specifications

PropertyValue
Parameters8B (1.5B active)
Context Length32K tokens
ArchitectureLFM2 (MoE)

MoE Efficiency

8B quality, 1.5B inference cost

On-Device

Runs on phones and laptops

Tool Calling

Native function calling support

Quick Start

Install:
pip install "transformers>=5.0.0" torch
Transformers v5 is newly released. If you encounter issues, fall back to the pinned git source:
pip install git+https://github.com/huggingface/transformers.git@0c9a72e4576fe4c84077f066e585129c97bfd4e6 torch
Download & Run:
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-8B-A1B", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2-8B-A1B")

input_ids = tokenizer.apply_chat_template(
    [{"role": "user", "content": "What is machine learning?"}],
    add_generation_prompt=True, return_tensors="pt"
).to(model.device)

output = model.generate(input_ids, max_new_tokens=256)
print(tokenizer.decode(output[0], skip_special_tokens=True))