Instructions to use LiquidAI/LFM2.5-1.2B-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2.5-1.2B-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM2.5-1.2B-Thinking") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-1.2B-Thinking") model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2.5-1.2B-Thinking", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/LFM2.5-1.2B-Thinking 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-Thinking" # 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-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2.5-1.2B-Thinking
- SGLang
How to use LiquidAI/LFM2.5-1.2B-Thinking 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-Thinking" \ --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-Thinking", "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-Thinking" \ --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-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM2.5-1.2B-Thinking with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2.5-1.2B-Thinking
Fix chat template: render tool_calls history and add <think> handling
Thanks for the 1.2B-Thinking model. Visible small-model reasoning that still tool calls correctly is genuinely useful to work with.
The shipped template is byte-identical to the 1.2B-Instruct template and has two independently testable gaps.
First, a past assistant tool_calls turn renders empty because the message loop emits content only. Agent clients therefore lose the model's action history.
Second, the template has no <think> handling. An assistant thinking field is not replayed into history, and llama.cpp does not enable its LFM reasoning extraction path because that path checks the template source for <think>. On the tested default route, raw reasoning appeared inside content and no reasoning_content field was present.
This proposal ports the LFM2.5-8B-A1B tool-call macros and its <think> handling. The render regression proves the empty-turn defect and native LFM tool-call rendering independently from the live reasoning test. On the live fixed route, reasoning arrived separated in reasoning_content, the leak from content was gone, and structured tool calls still parsed.
There is one policy question for Liquid: should thinking or reasoning_content be replayed into tool-loop history, and should keep_past_thinking govern only older completed turns or all assistant turns? The included implementation mirrors the current 8B template, but that policy belongs to Liquid. We are happy to split the history and extraction changes or follow a different reasoning-history convention.
GGUF users receive the fix through a re-converted GGUF or a runtime template override, which is how we verified it live.
Evidence and the two separate reproductions:
https://github.com/graphometer/droplet/tree/main/public/evidence
Disclosure: prepared with heavy AI assistance; every claim above comes from recorded runs that can be inspected. Not affiliated with, endorsed by, or connected to Liquid AI.