Find more information about LFM2.5-350M in our
blog post.
This pre-trained checkpoint is only recommended for tasks that require heavy fine-tuning, like language-specific (e.g., Japanese) or domain-specific (e.g., medical) assistants, training on proprietary data, or experimenting with novel post-training approaches.
LFM2.5 is supported by many inference frameworks. See the
Inference documentation for the full list.
1from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
2
3model_id = "LiquidAI/LFM2.5-350M-Base"
4model = AutoModelForCausalLM.from_pretrained(
5 model_id,
6 device_map="auto",
7 dtype="bfloat16",
8# attn_implementation="flash_attention_2" <- uncomment on compatible GPU
9)
10tokenizer = AutoTokenizer.from_pretrained(model_id)
11streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
12
13prompt = "What is C. elegans?"
14
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.1,
26 top_k=50,
27 repetition_penalty=1.05,
28 max_new_tokens=512,
29 streamer=streamer,
30)
We recommend fine-tuning LFM2.5 for your specific use case to achieve the best results.
1@article{liquidAI2026350M,
2 author = {Liquid AI},
3 title = {LFM2.5-350M: No Size Left Behind},
4 journal = {Liquid AI Blog},
5 year = {2026},
6 note = {www.liquid.ai/blog/lfm2-5-350m-no-size-left-behind},
7}
1@article{liquidai2025lfm2,
2 title={LFM2 Technical Report},
3 author={Liquid AI},
4 journal={arXiv preprint arXiv:2511.23404},
5 year={2025}
6}