Instructions to use LiquidAI/LFM2.5-VL-450M-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LiquidAI/LFM2.5-VL-450M-MLX-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("LiquidAI/LFM2.5-VL-450M-MLX-4bit") config = load_config("LiquidAI/LFM2.5-VL-450M-MLX-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use LiquidAI/LFM2.5-VL-450M-MLX-4bit 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-VL-450M-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/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-VL-450M-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use LiquidAI/LFM2.5-VL-450M-MLX-4bit 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-VL-450M-MLX-4bit"
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-VL-450M-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LiquidAI/LFM2.5-VL-450M-MLX-4bit 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-VL-450M-MLX-4bit"
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-VL-450M-MLX-4bit" \ --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"
`chat_template.jinja` is missing a brace on line 3 β BOS token is never emitted
The chat template in the current revision (f19926f17a25164d4cbcdc16d9eaf4714b807cfb, 2026-08-12) has a one-character typo on line 3:
{# <|tool_list_start|> detection hint for mlx_lm #}
{- bos_token -}}
It should be {{- bos_token -}}. The opening brace was lost, so this is no longer a Jinja expression.
This looks like a slip during the bulk edit that added the detection hint for mlx_lm comment across the MLX repos on 2026-08-12 between 19:14 and 19:27. The other fourteen got it right β LFM2.5-VL-3B-MLX-4bit, for example, has the identical comment followed by a correct {{- bos_token -}}. Only this repo is affected.
Why it is worth fixing promptly
It fails two different ways depending on the Jinja implementation, and the quieter one is the more damaging.
With transformers (and therefore mlx-lm), it does not error β it silently corrupts every prompt. The malformed line is treated as literal text:
from transformers import AutoTokenizer
tok = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-VL-450M-MLX-4bit")
print(repr(tok.apply_chat_template([{"role": "user", "content": "hello"}],
tokenize=False, add_generation_prompt=True)))
'\n{- bos_token -}}<|im_start|>user\nhello<|im_end|>\n<|im_start|>assistant\n'
Every prompt now begins with the literal string {- bos_token -}} and no BOS token. There is no warning, so users see only degraded output and have no obvious reason to suspect the template.
With a strict Jinja parser, it is a hard failure. In SwiftLM (Swift Jinja via swift-transformers) every request returns HTTP 500:
parser('Unexpected token type: closeExpression')
The parser reaches the closing -}} with nothing opened. The model loads fine and the server starts normally; it fails at first inference, which makes it awkward to diagnose from a user report.
Confirmation that this is the only cause
Same revision, same weights, same request β restoring the single { and changing nothing else:
| template | result |
|---|---|
| as published | HTTP 500, Unexpected token type: closeExpression |
with {{- restored |
HTTP 200, correct output, prompt_tokens: 271 |
Identical token counts to the previous revision (10ce3604e42cd595497c47aaf67b7890e1e2a3b4), which works.
Suggested fix
Line 3 of chat_template.jinja:
-{- bos_token -}}
+{{- bos_token -}}
Happy to open a PR against the repo if that is easier than patching it directly.
Thanks for publishing the MLX conversions β the 450M is a genuinely useful size for CI and for small-footprint deployments, which is how we ran into this.