Instructions to use LiquidAI/LFM2.5-24B-A2B-MLX-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LiquidAI/LFM2.5-24B-A2B-MLX-6bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("LiquidAI/LFM2.5-24B-A2B-MLX-6bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use LiquidAI/LFM2.5-24B-A2B-MLX-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LiquidAI/LFM2.5-24B-A2B-MLX-6bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "LiquidAI/LFM2.5-24B-A2B-MLX-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use LiquidAI/LFM2.5-24B-A2B-MLX-6bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "LiquidAI/LFM2.5-24B-A2B-MLX-6bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "LiquidAI/LFM2.5-24B-A2B-MLX-6bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2.5-24B-A2B-MLX-6bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use LiquidAI/LFM2.5-24B-A2B-MLX-6bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LiquidAI/LFM2.5-24B-A2B-MLX-6bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default LiquidAI/LFM2.5-24B-A2B-MLX-6bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LiquidAI/LFM2.5-24B-A2B-MLX-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LiquidAI/LFM2.5-24B-A2B-MLX-6bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "LiquidAI/LFM2.5-24B-A2B-MLX-6bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
LiquidAI/LFM2.5-24B-A2B-MLX-6bit
This model LiquidAI/LFM2.5-24B-A2B-MLX-6bit was converted to MLX format from LiquidAI/LFM2.5-24B-A2B using mlx-lm version 0.32.0.
About this quantization
Quantized to 6 bits per weight (group size 64, affine mode). MoE routing gates kept unquantized in float32.
For base model details, capabilities, and recommended generation settings, see the original model card.
Use with mlx
Requires mlx-lm 0.32.0 or later. Earlier versions load the model but route the experts incorrectly.
pip install -U "mlx-lm>=0.32.0"
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler, make_logits_processors
model, tokenizer = load("LiquidAI/LFM2.5-24B-A2B-MLX-6bit")
prompt = "What is C. elegans?"
if tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
sampler = make_sampler(temp=0.1, top_k=50)
logits_processors = make_logits_processors(repetition_penalty=1.05)
response = generate(
model, tokenizer, prompt=prompt, max_tokens=4096,
sampler=sampler, logits_processors=logits_processors,
verbose=True,
)
Chat Template
LFM2.5 uses a ChatML-like format. See the Chat Template documentation for details. Example:
<|startoftext|><|im_start|>system
You are a helpful assistant trained by Liquid AI.<|im_end|>
<|im_start|>user
What is C. elegans?<|im_end|>
<|im_start|>assistant
<think>
Because LFM2.5-24B-A2B is a reasoning model, assistant turns contain an explicit chain of thought before the final answer. tokenizer.apply_chat_template() formats messages automatically.
Tool Use
LFM2.5 supports function calling. Pass tools to tokenizer.apply_chat_template(..., tools=...). See the Tool Use documentation for the full guide.
License
LFM Open License v1.0 — see the LICENSE file or the original model card for terms.
Citation
@article{liquidAI202624BA2B,
author = {Liquid AI},
title = {LFM2.5-24B-A2B: Built for Fast On-Device Agents},
journal = {Liquid AI Blog},
year = {2026},
note = {www.liquid.ai/blog/lfm2-5-24b-a2b},
}
@article{liquidai2025lfm2,
title = {LFM2 Technical Report},
author = {Liquid AI},
journal = {arXiv preprint arXiv:2511.23404},
year = {2025}
}
- Downloads last month
- 301
6-bit