Instructions to use LiquidAI/LFM2-1.2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2-1.2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM2-1.2B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2-1.2B") model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-1.2B") 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
- vLLM
How to use LiquidAI/LFM2-1.2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM2-1.2B" # 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-1.2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2-1.2B
- SGLang
How to use LiquidAI/LFM2-1.2B 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-1.2B" \ --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-1.2B", "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-1.2B" \ --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-1.2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM2-1.2B with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2-1.2B
Update README.md
Browse files
README.md
CHANGED
|
@@ -21,11 +21,17 @@ tags:
|
|
| 21 |
|
| 22 |
<center>
|
| 23 |
<div style="text-align: center;">
|
| 24 |
-
<
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
</div>
|
| 30 |
<div style="display: flex; justify-content: center;">
|
| 31 |
<a href="https://playground.liquid.ai/chat">
|
|
@@ -35,7 +41,7 @@ tags:
|
|
| 35 |
<rect fill="#fff" width="200" height="200"></rect>
|
| 36 |
<rect fill="url(#x)" x="200" width="800" height="200"></rect>
|
| 37 |
</g>
|
| 38 |
-
<g transform="translate(
|
| 39 |
<path d="M172.314 129.313L172.219 129.367L206.125 188.18C210.671 195.154 213.324 203.457 213.324 212.382C213.324 220.834 210.956 228.739 206.839 235.479L275.924 213.178L167.853 33.6L141.827 76.9614L172.314 129.313Z" fill="black"/>
|
| 40 |
<path d="M114.217 302.4L168.492 257.003C168.447 257.003 168.397 257.003 168.352 257.003C143.515 257.003 123.385 237.027 123.385 212.387C123.385 203.487 126.023 195.204 130.55 188.24L162.621 132.503L135.966 86.7327L60.0762 213.183L114.127 302.4H114.217Z" fill="black"/>
|
| 41 |
<path d="M191.435 250.681C191.435 250.681 191.43 250.681 191.425 250.686L129.71 302.4H221.294L267.71 226.593L191.435 250.686V250.681Z" fill="black"/>
|
|
@@ -290,4 +296,18 @@ LFM2 outperforms similar-sized models across different evaluation categories.
|
|
| 290 |
|
| 291 |
## 📬 Contact
|
| 292 |
|
| 293 |
-
If you are interested in custom solutions with edge deployment, please contact [our sales team](https://www.liquid.ai/contact).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
<center>
|
| 23 |
<div style="text-align: center;">
|
| 24 |
+
<picture>
|
| 25 |
+
<source
|
| 26 |
+
srcset="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/nWUhffgmUBuNAdxUX6g1T.png"
|
| 27 |
+
media="(prefers-color-scheme: dark)"
|
| 28 |
+
/>
|
| 29 |
+
<img
|
| 30 |
+
src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/7_6D7rWrLxp2hb6OHSV1p.png"
|
| 31 |
+
alt="Liquid AI"
|
| 32 |
+
style="width: 100%; max-width: 66%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"
|
| 33 |
+
/>
|
| 34 |
+
</picture>
|
| 35 |
</div>
|
| 36 |
<div style="display: flex; justify-content: center;">
|
| 37 |
<a href="https://playground.liquid.ai/chat">
|
|
|
|
| 41 |
<rect fill="#fff" width="200" height="200"></rect>
|
| 42 |
<rect fill="url(#x)" x="200" width="800" height="200"></rect>
|
| 43 |
</g>
|
| 44 |
+
<g transform="translate(25, 25) scale(0.45, 0.45)">
|
| 45 |
<path d="M172.314 129.313L172.219 129.367L206.125 188.18C210.671 195.154 213.324 203.457 213.324 212.382C213.324 220.834 210.956 228.739 206.839 235.479L275.924 213.178L167.853 33.6L141.827 76.9614L172.314 129.313Z" fill="black"/>
|
| 46 |
<path d="M114.217 302.4L168.492 257.003C168.447 257.003 168.397 257.003 168.352 257.003C143.515 257.003 123.385 237.027 123.385 212.387C123.385 203.487 126.023 195.204 130.55 188.24L162.621 132.503L135.966 86.7327L60.0762 213.183L114.127 302.4H114.217Z" fill="black"/>
|
| 47 |
<path d="M191.435 250.681C191.435 250.681 191.43 250.681 191.425 250.686L129.71 302.4H221.294L267.71 226.593L191.435 250.686V250.681Z" fill="black"/>
|
|
|
|
| 296 |
|
| 297 |
## 📬 Contact
|
| 298 |
|
| 299 |
+
If you are interested in custom solutions with edge deployment, please contact [our sales team](https://www.liquid.ai/contact).
|
| 300 |
+
|
| 301 |
+
## Citation
|
| 302 |
+
|
| 303 |
+
```
|
| 304 |
+
@article{liquidai2025lfm2technicalreport,
|
| 305 |
+
title={LFM2 Technical Report},
|
| 306 |
+
author={Liquid AI},
|
| 307 |
+
year={2025},
|
| 308 |
+
eprint={2511.23404},
|
| 309 |
+
archivePrefix={arXiv},
|
| 310 |
+
primaryClass={cs.LG},
|
| 311 |
+
url={https://arxiv.org/abs/2511.23404},
|
| 312 |
+
}
|
| 313 |
+
```
|