LFM2 Technical Report
Paper • 2511.23404 • Published • 65
How to use nassimjp/LFM2.5-1.2B-Base-Pashto with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="nassimjp/LFM2.5-1.2B-Base-Pashto")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("nassimjp/LFM2.5-1.2B-Base-Pashto")
model = AutoModelForCausalLM.from_pretrained("nassimjp/LFM2.5-1.2B-Base-Pashto", 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]:]))How to use nassimjp/LFM2.5-1.2B-Base-Pashto with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "nassimjp/LFM2.5-1.2B-Base-Pashto"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nassimjp/LFM2.5-1.2B-Base-Pashto",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/nassimjp/LFM2.5-1.2B-Base-Pashto
How to use nassimjp/LFM2.5-1.2B-Base-Pashto with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "nassimjp/LFM2.5-1.2B-Base-Pashto" \
--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": "nassimjp/LFM2.5-1.2B-Base-Pashto",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "nassimjp/LFM2.5-1.2B-Base-Pashto" \
--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": "nassimjp/LFM2.5-1.2B-Base-Pashto",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use nassimjp/LFM2.5-1.2B-Base-Pashto with Docker Model Runner:
docker model run hf.co/nassimjp/LFM2.5-1.2B-Base-Pashto
# ======================================================
# 2️⃣ TOKENIZER
# ======================================================
PASHTO_ATOMS = ["ښ","څ","ځ","ڼ","ږ","ډ","ټ","ړ","ئ","ې","ۍ","ګ",
"ک","ی","گ","چ","ژ","پ","ۀ","أ","إ","آ","ؤ","ء","ٱ",
"ٹ","ڈ","ڑ","ں","ھ","ے","ۓ","۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"]
Requires large‑scale Pashto corpora, deduped and domain‑balanced.
Requires high‑quality Pashto instruction datasets in chat format.
Special thanks to the open‑source community and Pashto NLP contributors whose work made this model possible.
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
This model is released under the same license terms as the base model
(LiquidAI/LFM2.5-1.2B-Base).
Please refer to the original model card for detailed license information.