Instructions to use LiquidAI/LFM2-2.6B-Longevity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2-2.6B-Longevity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM2-2.6B-Longevity") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2-2.6B-Longevity") model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-2.6B-Longevity", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/LFM2-2.6B-Longevity with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM2-2.6B-Longevity" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-2.6B-Longevity", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2-2.6B-Longevity
- SGLang
How to use LiquidAI/LFM2-2.6B-Longevity with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LiquidAI/LFM2-2.6B-Longevity" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-2.6B-Longevity", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LiquidAI/LFM2-2.6B-Longevity" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-2.6B-Longevity", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM2-2.6B-Longevity with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2-2.6B-Longevity
Longevity-LLM - LFM2-2.6B
Longevity-LLM (L-LLM) is a family of compact, domain-adapted language models for interpreting heterogeneous aging biology data. Longevity LFMs are available in two sizes:
- LFM2-1.2B-Longevity
- LFM2-2.6B-Longevity (this model)
This checkpoint, L-LFM2-2.6B, was produced by full-parameter supervised fine-tuning of LiquidAI/LFM2-2.6B on aging-related multi-omics and clinical data.
The family was developed jointly by Insilico Medicine and Liquid AI and accompanies the study "An Open Benchmark and Language Models for AI in Aging Biology" (Zhavoronkov et al., 2026).
Model details
- Base model: LiquidAI/LFM2-2.6B
- Architecture: Hybrid Liquid model with multiplicative gates and short convolutions.
- Context length: 32,768 tokens
- Language: English
Training data. The model was trained on the shared L-LLM corpus spanning aging biology. See LongevityBench for more details.
Training procedure. L-LFM2-2.6B was trained with full-parameter supervised fine-tuning. Prompts were formatted in ChatML with a dynamic-thinking template (user turns suffixed with /think or /no_think to select response mode at inference).
Chat Template
LFM2 uses a ChatML-like format. See the Chat Template documentation for details. Example:
<|startoftext|><|im_start|>system
You are a biomedical AI specialized in aging biology, trained on genomic, proteomic, and clinical data.<|im_end|>
<|im_start|>user
What is C. elegans?<|im_end|>
<|im_start|>assistant
You can use tokenizer.apply_chat_template() to format your messages automatically.
Inference
LFM2 is supported by many inference frameworks. See the Inference documentation for the full list.
| Name | Description | Docs | Notebook |
|---|---|---|---|
| Transformers | Simple inference with direct access to model internals. | Link | ![]() |
| vLLM | High-throughput production deployments with GPU. | Link | ![]() |
| SGLang | High-throughput production deployments with GPU. | Link | — |
| llama.cpp | Cross-platform inference with CPU offloading. | Link | ![]() |
| MLX | Apple's machine learning framework optimized for Apple Silicon. | Link | — |
| LM Studio | Desktop application for running LLMs locally. | Link | — |
Quick start with Transformers (compatible with transformers>=5.1.0)
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model_id = "LiquidAI/LFM2-2.6B-Longevity"
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype="bfloat16",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
# Generate answer
messages = [
{"role": "system", "content": "You are a biomedical AI specialized in aging biology, trained on genomic, proteomic, and clinical data."},
{"role": "user", "content": "What are the hallmarks of aging?"},
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
tokenize=True,
return_dict=False,
).to(model.device)
output = model.generate(
input_ids,
do_sample=True,
temperature=0.3,
min_p=0.15,
repetition_penalty=1.05,
max_new_tokens=1500
)
print(tokenizer.decode(output[0], skip_special_tokens=False))
Intended use and limitations
Intended for research on aging biology and omics interpretation. Outputs are model predictions, not clinical advice, and should be validated experimentally. Performance is strongest on the modalities represented in the training corpus.
Contact
- Got questions or want to connect? Join our Discord community
- If you are interested in custom solutions with edge deployment, please contact our sales team.
Citation
@misc{liquid_ai_2026,
author = { Liquid AI },
title = { LFM2-2.6B-Longevity (Revision 601e34d) },
year = 2026,
url = { https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity },
doi = { 10.57967/hf/9888 },
publisher = { Hugging Face }
}
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
- Downloads last month
- 1,457
