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")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LiquidAI/LFM2-1.2B", dtype="auto") - 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/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-1.2B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-1.2B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-1.2B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LiquidAI/LFM2-1.2B with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2-1.2B
Support tool calls
Hey, thanks for your PR! We need some time to craft a consolidated chat template, but we'll take your suggestion into account.
All love friends, I finally got around to applying my research on your model for interruptible streams for parallel and sequential tool calling and taught it to do some light reasoning on top of your pirate version @mlabonne and it absolutely crushes tool calling more consistent than many much larger models. Nice job guys.
All love friends, I finally got around to applying my research on your model for interruptible streams for parallel and sequential tool calling and taught it to do some light reasoning on top of your pirate version @mlabonne and it absolutely crushes tool calling more consistent than many much larger models. Nice job guys.
this is super cool , would love to take a peak at the pirate code if it's opened somewhere
Sure, the pirate model was used with the Axolotl SFT notebook.
A little update for my experiments with Liquid calling a larger model function calling is pretty cool. https://youtube.com/shorts/zgrxHFKesPI?si=ii2X2gftNfUmJEkO
hello