Instructions to use SkyAsl/LFM2.5-1.2B-TR-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SkyAsl/LFM2.5-1.2B-TR-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SkyAsl/LFM2.5-1.2B-TR-Base") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SkyAsl/LFM2.5-1.2B-TR-Base") model = AutoModelForCausalLM.from_pretrained("SkyAsl/LFM2.5-1.2B-TR-Base") 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 SkyAsl/LFM2.5-1.2B-TR-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SkyAsl/LFM2.5-1.2B-TR-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SkyAsl/LFM2.5-1.2B-TR-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SkyAsl/LFM2.5-1.2B-TR-Base
- SGLang
How to use SkyAsl/LFM2.5-1.2B-TR-Base 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 "SkyAsl/LFM2.5-1.2B-TR-Base" \ --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": "SkyAsl/LFM2.5-1.2B-TR-Base", "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 "SkyAsl/LFM2.5-1.2B-TR-Base" \ --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": "SkyAsl/LFM2.5-1.2B-TR-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SkyAsl/LFM2.5-1.2B-TR-Base with Docker Model Runner:
docker model run hf.co/SkyAsl/LFM2.5-1.2B-TR-Base
LFM2.5-1.2B-TR-Base
This model is a Turkish language adaptation of LiquidAI/LFM-2.5-1.2B-Base developed via Continued Pre-training (CPT). It utilizes the Hybrid Liquid Foundation Model architecture, offering high reasoning capabilities within the 1.2B parameter class.
🚀 Model Details
- Developed by: SkyAsl
- Base Model: LiquidAI LFM-2.5-1.2B
- Language: Turkish
- Architecture: Hybrid (Linear Attention + Convolution)
- Training Method: LoRA (Rank 128) - Continued Pre-training
- Total Training Tokens: ~805 Million (0.8B)
📚 Dataset Mix
The model was trained on a diverse and curated mix of Turkish data to ensure excellence in logic, formal knowledge, and contemporary language:
- Logic & Mathematics:
duxx/orca-math-word-problems-tr(100k samples) - Focused on reasoning and chain-of-thought in Turkish. - General Knowledge:
musabg/wikipedia-tr(290k samples) - Extensive encyclopedic knowledge, filtered for long-form content (>500 chars). - Conversational & Fluency:
gorkemgoknar/tr_ted_talk_translated(180k samples) - Natural speech patterns and translated talk transcripts. - News & Contemporary Prose:
turkish-nlp-suite/Havadis(300k samples) - Modern news language, filtered for high-quality long articles (>1000 chars).
🛠️ Technical Training Specifications
A Pre-packing technique was implemented during the training process, where all text was packed into fixed-length blocks of 4096 tokens to maximize GPU efficiency.
- LoRA Rank: 128
- LoRA Alpha: 256
- Context Length: 4096
- Learning Rate: 2e-5
- Epoch: 1
- Optimizer: Paged AdamW 32bit
- Precision: bfloat16 (Trained on NVIDIA A100 40GB)
⚠️ Important Note: Base Model Status
This is a Base Model. It has not been fine-tuned for instruction following or chat (SFT). While it has acquired strong Turkish language foundations, it acts as an "autocomplete" engine. To use it as an assistant, Instruction Tuning is highly recommended.
- Instruction Tuned version is coming soon...
Usage (Inference)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "SkyAsl/LFM-2.5-1.2B-TR-Base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
prompt = "Türkiye Cumhuriyeti'nin kurucusu Mustafa Kemal Atatürk,"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=50, temperature=0.3)
print(tokenizer.decode(output[0], skip_special_tokens=True))
🙏 Acknowledgements
This work is based on the LiquidAI/LFM2.5-1.2B-Base model. I thank the LiquidAI team for releasing the Hybrid Liquid Foundation Model architecture and enabling this research.
I also acknowledge the creators and maintainers of the datasets used during continued pre-training:
All datasets were used in accordance with their respective licenses and intended research or educational purposes.
📄 License
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.
- Downloads last month
- 3