Views
No views yet


| Property | LFM2-350M | LFM2-700M | LFM2-1.2B | LFM2-2.6B |
|---|---|---|---|---|
| Parameters | 354,483,968 | 742,489,344 | 1,170,340,608 | 2,569,272,320 |
| Layers | 16 (10 conv + 6 attn) | 16 (10 conv + 6 attn) | 16 (10 conv + 6 attn) | 30 (22 conv + 8 attn) |
| Context length | 32,768 tokens | 32,768 tokens | 32,768 tokens | 32,768 tokens |
| Vocabulary size | 65,536 | 65,536 | 65,536 | 65,536 |
| Precision | bfloat16 | bfloat16 | bfloat16 | bfloat16 |
| Training budget | 10 trillion tokens | 10 trillion tokens | 10 trillion tokens | 10 trillion tokens |
| License | LFM Open License v1.0 | LFM Open License v1.0 | LFM Open License v1.0 | LFM Open License v1.0 |
temperature=0.3min_p=0.15repetition_penalty=1.05<|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
It's a tiny nematode that lives in temperate soil environments.<|im_end|>.apply_chat_template() function from Hugging Face transformers.<|tool_list_start|> and <|tool_list_end|> special tokens), usually in the system prompt<|tool_call_start|> and <|tool_call_end|> special tokens), as the assistant answer.<|tool_response_start|> and <|tool_response_end|> special tokens), as a "tool" role.<|startoftext|><|im_start|>system
List of tools: <|tool_list_start|>[{"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"]}}]<|tool_list_end|><|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
<|tool_response_start|>[{"candidate_id": "12345", "status": "Interview Scheduled", "position": "Clinical Research Associate", "date": "2023-11-20"}]<|tool_response_end|><|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|>.apply_chat_template() as shown in this page to automatically format the system prompt.transformers v4.55 or a more recent version as follows:pip install -U transformers1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3# Load model and tokenizer
4model_id = "LiquidAI/LFM2-2.6B-Exp"
5model = AutoModelForCausalLM.from_pretrained(
6 model_id,
7 device_map="auto",
8 torch_dtype="bfloat16",
9# attn_implementation="flash_attention_2" <- uncomment on compatible GPU
10)
11tokenizer = AutoTokenizer.from_pretrained(model_id)
12
13# Generate answer
14prompt = "What is C. elegans?"
15input_ids = tokenizer.apply_chat_template(
16 [{"role": "user", "content": prompt}],
17 add_generation_prompt=True,
18 return_tensors="pt",
19 tokenize=True,
20).to(model.device)
21
22output = model.generate(
23 input_ids,
24 do_sample=True,
25 temperature=0.3,
26 min_p=0.15,
27 repetition_penalty=1.05,
28 max_new_tokens=512,
29)
30
31print(tokenizer.decode(output[0], skip_special_tokens=False))
32
33# <|startoftext|><|im_start|>user
34# What is C. elegans?<|im_end|>
35# <|im_start|>assistant
36# C. elegans, also known as Caenorhabditis elegans, is a small, free-living
37# nematode worm (roundworm) that belongs to the phylum Nematoda.vLLM v0.10.2 or a more recent version as follows:uv pip install vllm==0.10.2 --extra-index-url https://wheels.vllm.ai/0.10.2/ --torch-backend=auto1from vllm import LLM, SamplingParams
2
3prompts = [
4 "What is C. elegans?",
5 "Say hi in JSON format",
6 "Define AI in Spanish"
7]
8sampling_params = SamplingParams(temperature=0.3, min_p=0.15, repetition_penalty=1.05)
9
10llm = LLM(model="LiquidAI/LFM2-2.6B-Exp")
11
12outputs = llm.generate(prompts, sampling_params)
13
14for output in outputs:
15 prompt = output.prompt
16 generated_text = output.outputs[0].text
17 print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")| Notebook | Description | Link |
|---|---|---|
| SFT (Unsloth) | Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using Unsloth. | ![]() |
| SFT (TRL) | Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using TRL. | ![]() |
| DPO (TRL) | Preference alignment with Direct Preference Optimization (DPO) using TRL. | ![]() |
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}