Skip to main content
← Back to Text Models
This model is deprecated. Use LFM2.5-1.2B-Instruct for improved performance.
LFM2-1.2B was the original 1.2B parameter model in the LFM2 series. It has been superseded by LFM2.5-1.2B-Instruct, which offers better chat, instruction-following, and tool-calling performance.

Specifications

PropertyValue
Parameters1.2B
Context Length32K tokens
ArchitectureLFM2 (Dense)

Quick Start

Install:
pip install transformers torch
Download & Run:
from transformers import AutoModelForCausalLM, AutoTokenizer

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

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))