Instructions to use mlx-community/LFM2.5-VL-3B-OptiQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/LFM2.5-VL-3B-OptiQ-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("mlx-community/LFM2.5-VL-3B-OptiQ-4bit") config = load_config("mlx-community/LFM2.5-VL-3B-OptiQ-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 mlx-community/LFM2.5-VL-3B-OptiQ-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 "mlx-community/LFM2.5-VL-3B-OptiQ-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": "mlx-community/LFM2.5-VL-3B-OptiQ-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use mlx-community/LFM2.5-VL-3B-OptiQ-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 "mlx-community/LFM2.5-VL-3B-OptiQ-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 "mlx-community/LFM2.5-VL-3B-OptiQ-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"
- Hermes Agent
How to use mlx-community/LFM2.5-VL-3B-OptiQ-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 "mlx-community/LFM2.5-VL-3B-OptiQ-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 mlx-community/LFM2.5-VL-3B-OptiQ-4bit
Run Hermes
hermes
- Atomic Chat
mlx-community/LFM2.5-VL-3B-OptiQ-4bit
Built with mlx-optiq, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. All OptiQ quants · Docs
Liquid's on-device vision-language model, quantized for a Mac. This is an OptiQ mixed-precision quant of LiquidAI/LFM2.5-VL-3B-MLX-bf16. 2.8 GB on disk, down from 6.3 GB.
LFM2.5-VL pairs a SigLIP2 encoder with the LFM2.5 hybrid language tower: short convolutional blocks alternate with full-attention blocks, and only the attention blocks carry a KV cache, so memory grows slowly as context does. OptiQ quantizes the language tower to mixed 4/8-bit and keeps the vision tower at bf16 in a sidecar, so one checkpoint does text and images.
It reads images
Ran through this quantized model on Apple Silicon, MLX only:
| Input | Output |
|---|---|
| a blue square on white | "A blue square." |
| a green triangle on white | "Green triangle." |
| a red circle on white | "A red circle." |
What it is
| Property | Value |
|---|---|
| Base | LiquidAI/LFM2.5-VL-3B-MLX-bf16 (SigLIP2 + LFM2.5, ~3B params) |
| Method | OptiQ mixed-precision, sensitivity-driven (bf16 reference) |
| Language tower | per-layer 4/8-bit: 88 layers at 4-bit, 78 at 8-bit |
| Vision tower | bf16, kept in optiq/optiq_vision.safetensors (441 tensors) |
| On disk | 1.98 GB language + 0.85 GB vision |
| Resolution | native aspect ratio; position embeddings resampled per image |
The vision tower runs natively in MLX with no PyTorch and no mlx-vlm at runtime. It was checked against the reference implementation across four patch grids and matches to bf16 round-off, so image answers are the base model's rather than an approximation.
Following llama.cpp's naming for mixed quants, the "4bit" label denotes the family, not the weighted average.
Capability Score
Six-metric mean (the standard OptiQ text eval).
| Metric | Score |
|---|---|
| MMLU (5-shot, 969 samples) | 54.3% |
| GSM8K (1000 samples) | 44.6% |
| IFEval (full set, strict) | 77.4% |
| BFCL-V3 simple (200 calls) | 0.0% |
| HumanEval (164 problems, pass@1) | 40.2% |
| HashHop (long-context retrieval) | 11.0% |
| Capability Score (mean of 6) | 37.93 |
It does not initiate tool calls. The 0.0% is a real result, not a harness artifact: on BFCL's prompts this model works the answer out itself rather than calling the function. Asked "find the area of a triangle with base 10 and height 5" it derives the formula and answers 25, while its text-only sibling LFM2.5-1.2B-Instruct calls calculate_triangle_area and scores 45.0%. Both were run through the same harness with the same chat template logic.
It emits correct calls when told to use a tool — <|tool_call_start|>[get_weather(city="Paris")]<|tool_call_end|> parses cleanly — so the capability is there; the model just does not reach for it unprompted. If you need agentic tool use at this size, take the text 1.2B or 2.6B instead.
Long-context retrieval also falls off quickly: 40% at one hop, near zero beyond. That is what a hybrid with few attention layers predicts, and it is the trade that keeps its KV cache small.
Run it
pip install "mlx-optiq>=0.4.20"
For image input, serve it with an OpenAI + Anthropic-compatible endpoint:
optiq serve --model mlx-community/LFM2.5-VL-3B-OptiQ-4bit
Then send an image as image_url content. Text-only generation also loads directly:
import optiq # registers the lfm2_vl arch + vision sidecar
from mlx_lm import load, generate
model, tok = load("mlx-community/LFM2.5-VL-3B-OptiQ-4bit")
msgs = [{"role": "user", "content": "Explain why the sky is blue."}]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
print(generate(model, tok, prompt=prompt, max_tokens=400))
Links
- Project website: mlx-optiq.com
- Family guide: mlx-optiq.com/docs/lfm2.5
- All OptiQ quants: mlx-optiq.com/models
- Base model: LiquidAI/LFM2.5-VL-3B-MLX-bf16
- Downloads last month
- 86
4-bit
Model tree for mlx-community/LFM2.5-VL-3B-OptiQ-4bit
Base model
LiquidAI/LFM2.5-2.6B-Base