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)# pip install -U transformers accelerate # 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=256) 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
Update README.md
#1
by iamleonie - opened
README.md
CHANGED
|
@@ -1,29 +1,77 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model: LiquidAI/LFM2-2.6B
|
| 3 |
license: other
|
| 4 |
license_name: lfm1.0
|
| 5 |
license_link: LICENSE
|
| 6 |
---
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
The family was developed jointly by [**Insilico Medicine**](https://insilico.com) and [**Liquid AI**](https://www.liquid.ai) and accompanies the study "An Open Benchmark and Language Models for AI in Aging Biology" (Zhavoronkov et al., 2026).
|
| 12 |
|
| 13 |
-
## Model
|
| 14 |
- **Base model**: [LiquidAI/LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B)
|
| 15 |
- **Architecture**: Hybrid Liquid model with multiplicative gates and short convolutions.
|
| 16 |
- **Context length**: 32,768 tokens
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
-
##
|
| 20 |
-
The model was trained on the shared L-LLM corpus spanning aging biology. See [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench) for more details.
|
| 21 |
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
```python
|
| 29 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
@@ -62,13 +110,13 @@ output = model.generate(
|
|
| 62 |
|
| 63 |
print(tokenizer.decode(output[0], skip_special_tokens=False))
|
| 64 |
```
|
| 65 |
-
|
| 66 |
## Intended use and limitations
|
| 67 |
-
|
| 68 |
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.
|
| 69 |
|
| 70 |
-
##
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
|
| 73 |
## Citation
|
| 74 |
|
|
@@ -81,4 +129,13 @@ The fine-tuned model is released under LFM Open License v1.0. The underlying bas
|
|
| 81 |
doi = { 10.57967/hf/9888 },
|
| 82 |
publisher = { Hugging Face }
|
| 83 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
```
|
|
|
|
| 1 |
---
|
| 2 |
+
tags:
|
| 3 |
+
- liquid
|
| 4 |
+
- lfm2
|
| 5 |
+
- lfm2.5
|
| 6 |
+
- longevity
|
| 7 |
+
library_name: transformers
|
| 8 |
base_model: LiquidAI/LFM2-2.6B
|
| 9 |
license: other
|
| 10 |
license_name: lfm1.0
|
| 11 |
license_link: LICENSE
|
| 12 |
---
|
| 13 |
|
| 14 |
+
<div align="center">
|
| 15 |
+
<img
|
| 16 |
+
src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/2b08LKpev0DNEk6DlnWkY.png"
|
| 17 |
+
alt="Liquid AI"
|
| 18 |
+
style="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"
|
| 19 |
+
/>
|
| 20 |
+
<div style="display: flex; justify-content: center; gap: 0.5em; margin-bottom: 1em;">
|
| 21 |
+
<a href="https://docs.liquid.ai/lfm/getting-started/welcome"><strong>Docs</strong></a> •
|
| 22 |
+
<a href="https://discord.com/invite/liquid-ai"><strong>Discord</strong></a>
|
| 23 |
+
</div>
|
| 24 |
+
</div>
|
| 25 |
+
|
| 26 |
+
## Longevity-LLM - LFM2-2.6B
|
| 27 |
+
**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:
|
| 28 |
+
|
| 29 |
+
- [**LFM2-1.2B-Longevity**](https://huggingface.co/LiquidAI/LFM2-1.2B-Longevity/)
|
| 30 |
+
- **LFM2-2.6B-Longevity** *(this model)*
|
| 31 |
+
|
| 32 |
+
This checkpoint, **L-LFM2-2.6B**, was produced by full-parameter supervised fine-tuning of [LiquidAI/LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B) on aging-related multi-omics and clinical data.
|
| 33 |
|
| 34 |
The family was developed jointly by [**Insilico Medicine**](https://insilico.com) and [**Liquid AI**](https://www.liquid.ai) and accompanies the study "An Open Benchmark and Language Models for AI in Aging Biology" (Zhavoronkov et al., 2026).
|
| 35 |
|
| 36 |
+
## Model details
|
| 37 |
- **Base model**: [LiquidAI/LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B)
|
| 38 |
- **Architecture**: Hybrid Liquid model with multiplicative gates and short convolutions.
|
| 39 |
- **Context length**: 32,768 tokens
|
| 40 |
+
- **Language**: English
|
| 41 |
+
|
| 42 |
+
**Training data**. The model was trained on the shared L-LLM corpus spanning aging biology. See [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench) for more details.
|
| 43 |
+
|
| 44 |
+
**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).
|
| 45 |
+
|
| 46 |
+
### Chat Template
|
| 47 |
+
|
| 48 |
+
LFM2 uses a ChatML-like format. See the [Chat Template documentation](https://docs.liquid.ai/lfm/key-concepts/chat-template) for details. Example:
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
<|startoftext|><|im_start|>system
|
| 52 |
+
You are a helpful assistant trained by Liquid AI.<|im_end|>
|
| 53 |
+
<|im_start|>user
|
| 54 |
+
What is C. elegans?<|im_end|>
|
| 55 |
+
<|im_start|>assistant
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
You can use [`tokenizer.apply_chat_template()`](https://huggingface.co/docs/transformers/en/chat_templating#using-applychattemplate) to format your messages automatically.
|
| 59 |
|
| 60 |
|
| 61 |
+
## Inference
|
|
|
|
| 62 |
|
| 63 |
+
LFM2 is supported by many inference frameworks. See the [Inference documentation](https://docs.liquid.ai/lfm/inference/transformers) for the full list.
|
| 64 |
|
| 65 |
+
| Name | Description | Docs | Notebook |
|
| 66 |
+
|------|-------------|------|:--------:|
|
| 67 |
+
| [Transformers](https://github.com/huggingface/transformers) | Simple inference with direct access to model internals. | <a href="https://docs.liquid.ai/lfm/inference/transformers">Link</a> | <a href="https://colab.research.google.com/drive/1_q3jQ6LtyiuPzFZv7Vw8xSfPU5FwkKZY?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 68 |
+
| [vLLM](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/lfm/inference/vllm">Link</a> | <a href="https://colab.research.google.com/drive/1VfyscuHP8A3we_YpnzuabYJzr5ju0Mit?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 69 |
+
| [SGLang](https://github.com/sgl-project/sglang) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/sglang">Link</a> | — |
|
| 70 |
+
| [llama.cpp](https://github.com/ggml-org/llama.cpp) | Cross-platform inference with CPU offloading. | <a href="https://docs.liquid.ai/lfm/inference/llama-cpp">Link</a> | <a href="https://colab.research.google.com/drive/1ohLl3w47OQZA4ELo46i5E4Z6oGWBAyo8?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 71 |
+
| [MLX](https://github.com/ml-explore/mlx) | Apple's machine learning framework optimized for Apple Silicon. | <a href="https://docs.liquid.ai/lfm/inference/mlx">Link</a> | — |
|
| 72 |
+
| [LM Studio](https://lmstudio.ai/) | Desktop application for running LLMs locally. | <a href="https://docs.liquid.ai/deployment/on-device/lm-studio">Link</a> | — |
|
| 73 |
|
| 74 |
+
Quick start with Transformers (compatible with `transformers>=5.1.0`)
|
| 75 |
|
| 76 |
```python
|
| 77 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 110 |
|
| 111 |
print(tokenizer.decode(output[0], skip_special_tokens=False))
|
| 112 |
```
|
|
|
|
| 113 |
## Intended use and limitations
|
|
|
|
| 114 |
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.
|
| 115 |
|
| 116 |
+
## Contact
|
| 117 |
+
|
| 118 |
+
- Got questions or want to connect? [Join our Discord community](https://discord.com/invite/liquid-ai)
|
| 119 |
+
- If you are interested in custom solutions with edge deployment, please contact [our sales team](https://www.liquid.ai/contact).
|
| 120 |
|
| 121 |
## Citation
|
| 122 |
|
|
|
|
| 129 |
doi = { 10.57967/hf/9888 },
|
| 130 |
publisher = { Hugging Face }
|
| 131 |
}
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
```bibtex
|
| 135 |
+
@article{liquidai2025lfm2,
|
| 136 |
+
title={LFM2 Technical Report},
|
| 137 |
+
author={Liquid AI},
|
| 138 |
+
journal={arXiv preprint arXiv:2511.23404},
|
| 139 |
+
year={2025}
|
| 140 |
+
}
|
| 141 |
```
|