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 accelerate
Download & Run:
from transformers import AutoModelForCausalLM, AutoTokenizer

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

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

output = model.generate(input_ids, max_new_tokens=512)
response = tokenizer.decode(output[0][len(input_ids[0]):], skip_special_tokens=True)
print(response)