Instructions to use LiquidAI/LFM2.5-1.2B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2.5-1.2B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM2.5-1.2B-Instruct") 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.5-1.2B-Instruct") model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2.5-1.2B-Instruct", 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.5-1.2B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM2.5-1.2B-Instruct" # 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.5-1.2B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2.5-1.2B-Instruct
- SGLang
How to use LiquidAI/LFM2.5-1.2B-Instruct 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.5-1.2B-Instruct" \ --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.5-1.2B-Instruct", "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.5-1.2B-Instruct" \ --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.5-1.2B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM2.5-1.2B-Instruct with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2.5-1.2B-Instruct
Commit History
-
Fix chat template: render assistant tool_calls history
Verified signatureThanks for LFM2.5. The 1.2B is a remarkably capable tool caller for its size, and we have enjoyed working with it. Defect: the shipped message loop renders `content` but never renders a past assistant turn's `tool_calls`. Standard OpenAI-compatible clients replay history as an assistant `tool_calls` array followed by `role: tool` results. The current template therefore emits an empty assistant turn, and the model cannot see the actions it already took. Measured effect: in seeded 4-step and 6-step runs with the official Q4_K_M GGUF, temperature 0.1, top_k 50, and llama.cpp, the shipped template scored ordered 0/6 and exact 0/6. With history rendered, the fixed 4-step runs scored ordered 3/3 and exact 0/3 because the model inserted one unrequested note call each run. The fixed 6-step runs restored coherent history but still fabricated the final read, so they scored ordered 0/3 and exact 0/3. This patch restores memory. It does not claim to fix the model's extra call or fabricated final…6495113 -
Update README.md
Verified signature3d2b14b
-
Update LICENSE
Verified signature868df74
-
Fix Try LFM link to use playground.liquid.ai homepage
6314d2b -
Add Discord community link to README
97fd4c6
-
Update README.md
Verified signaturee7114d1
-
Update README.md
Verified signaturee129ea4
-
add GRPO TRL fine-tuning notebook
Verified signature719098d
-
Add GPQA evaluation result (#9)
Verified signature- Add GPQA evaluation result (29b5ff86b0a09af474084b9f915993f48d56c112) - Fix task_id to diamond (matching benchmark eval.yaml) (2bc02b7640f5428474e8eb8efb78d88673618a98) Co-authored-by: ben burtenshaw <burtenshaw@users.noreply.huggingface.co>8c1348a
-
Update README.md
Verified signature8dc4e68
-
Update README.md
Verified signature47c527b
-
Update README.md
Verified signaturec20ca41
-
Update README.md
Verified signature43f1e80
-
Update README.md
Verified signature286966c -
Upload README.md with huggingface_hub
Verified signature4393ab8
-
Update README.md
Verified signaturea4ba0a6
-
Add files using upload-large-folder tool
Verified signature205939a -
initial commit
Verified signaturef3a7622