Instructions to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth") model = AutoModelForCausalLM.from_pretrained("ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth") 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]:])) - PEFT
How to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth
- SGLang
How to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth 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 "ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth" \ --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": "ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth", "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 "ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth" \ --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": "ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth", max_seq_length=2048, ) - Docker Model Runner
How to use ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth with Docker Model Runner:
docker model run hf.co/ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth
LFM2.5-1.2B-xLAM-Unsloth — Fine-tuned on xLAM-60k
Fine-tuned adapter-merged checkpoint of LFM2.5-1.2B-Instruct on the
Salesforce/xlam-function-calling-60k dataset, produced via
Unsloth + Hugging Face TRL's SFTTrainer.
| Field | Value |
|---|---|
| Base model | LiquidAI/LFM2.5-1.2B-Instruct |
| Architecture | Lfm2ForCausalLM |
| Parameters | 1.2B |
| Precision | bfloat16 (merged 16-bit) |
| Fine-tuning method | QLoRA (4-bit base, LoRA r=16, α=16) |
| Dataset | Salesforce/xlam-function-calling-60k (60,000 examples) |
| Training | N=1 full epoch (7,500 steps, effective batch=8) |
| Learning rate | 2e-4 (linear decay, warmup 5 steps) |
| Unsloth version | 2026.4.6 |
| Trained on | DRAC Fir cluster, NVIDIA H100 80GB HBM3 MIG 3g.40gb |
Usage
Python (transformers)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth", trust_remote_code=True)
messages = [{"role": "user", "content": "Find flights from SFO to NYC on December 25th"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text=text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Unsloth (2× faster inference)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth",
max_seq_length=2048,
load_in_4bit=False,
)
FastLanguageModel.for_inference(model)
GGUF (llama.cpp / Ollama)
Quantized GGUF versions are available at ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth-GGUF:
# llama-cli
llama-cli -hf ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth-GGUF --jinja -p "Find flights from SFO to NYC on December 25th" -n 256
# Ollama
ollama run hf.co/ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth-GGUF:Q4_K_M
Training details
Function-calling fine-tuning on 60,000 examples from Salesforce/xlam-function-calling-60k.
- SFTTrainer (trl >= 0.14) via Unsloth's
FastLanguageModel - LoRA config: r=16, α=16, dropout=0, targeting q_proj/k_proj/v_proj/o_proj/gate_proj/up_proj/down_proj
- Effective batch size: 8 (per_device=2 × grad_accum=4)
- Max sequence length: 2048
- Optimizer: adamw_8bit with linear LR scheduler
- Seed: 3407
Intended use
For research and non-commercial experimentation only. Outputs should be independently verified before any downstream use.
Limitations
- Trained on a single epoch (~7,500 optimizer steps); further training may yield additional gains.
- Fine-tuned from
LFM2.5-1.2B-Instruct, inherits its limitations and biases. - Evaluated only on training-data perplexity; no external benchmarks run on this checkpoint.
- Limited to the 60 function schemas covered in the training dataset; performance on novel APIs may degrade.
Citation
@misc{ lfm25_12b_xlam_unsloth_2026 ,
author = {Ermia Azarkhalili},
title = { LFM2.5-1.2B-xLAM-Unsloth — Function-calling fine-tune of LFM2.5-1.2B-Instruct },
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth}}
}
This lfm2 model was trained 2× faster with Unsloth and Hugging Face's TRL library.
- Downloads last month
- 23
Model tree for ermiaazarkhalili/LFM2.5-1.2B-Function-Calling-xLAM-Unsloth
Base model
LiquidAI/LFM2.5-1.2B-Base