Instructions to use LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit 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("LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit") config = load_config("LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit") # 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 LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit"
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": "LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit 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 "LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit"
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 LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit"
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 "LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit" \ --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"
LFM2.5-VL-450M-Extract-MLX-8bit
LFM2.5-VL-450M-Extract-MLX-8bit is the 8-bit quantized Apple Silicon MLX port of Liquid AI's LFM2.5-VL-450M-Extract. It extracts user-defined fields from images and returns them as strict JSON, offering the ideal balance between high extraction accuracy, minimal quantization loss, and fast inference on Apple Silicon (M1/M2/M3/M4) devices via MLX and mlx-vlm.
⚙️ How it works
You specify what to extract as a YAML field list in the system prompt, and the model returns a JSON object with those fields.
- System prompt:
wood_color: The overall coloration of the wood surface
wood_texture: The tactile quality of the wood surface
wood_pattern: The pattern types visible on the wood surface
- Output:
{
"wood_color": "light to medium brown",
"wood_texture": "smooth with visible grain",
"wood_pattern": "parallel, irregular, wavy"
}
Our model also supports enum constrained definitions:
wood_color: The overall coloration of the wood surface, such as blue, red, or light tan
wood_texture: The tactile quality of the wood surface, select from smooth, rough, or grainy
wood_pattern: The pattern types visible on the wood surface, e.g., straight, wavy, or curly
📄 Model Details
| Property | Detail |
|---|---|
| Base Model | LiquidAI/LFM2.5-VL-450M-Extract |
| Parameters (LM only) | 350M |
| Vision Encoder | SigLIP2 (~100M, SigLIP-2 paper) |
| Quantization | 8-bit affine (group_size: 64, mode: affine) |
| Weights Size | ~565 MB (model.safetensors) |
| Context Window | 128,000 tokens |
| Runtime / Library | Apple Silicon MLX (mlx_vlm) |
| License | LFM Open License v1.0 |
📊 Conversion Specs & Resource Usage
- Conversion Parameters:
python -m mlx_vlm.convert --hf-path LiquidAI/LFM2.5-VL-450M-Extract -q --q-bits 8 --q-group-size 64 - Memory Footprint: ~600 MB active unified memory during inference.
| Model Variant | Precision | Group Size | Weight Size | Est. Unified RAM |
|---|---|---|---|---|
| LFM2.5-VL-450M-Extract-MLX-4bit | 4-bit (int4) |
64 | ~388 MB | ~400 MB |
| LFM2.5-VL-450M-Extract-MLX-8bit | 8-bit (int8) |
64 | ~565 MB | ~600 MB |
| LFM2.5-VL-450M-Extract-MLX-bf16 | bfloat16 | N/A | ~897 MB | ~900 MB |
🏃 How to run with MLX
1. Install dependencies
pip install mlx-vlm pillow
2. Run inference in Python
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_image
model_id = "LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit"
model, processor = load(model_id)
image = load_image("https://huggingface.co/LiquidAI/LFM2.5-VL-450M-Extract/resolve/main/sample_image.png")
fields_yaml = """wood_color: The overall coloration of the wood surface
wood_texture: The tactile quality of the wood surface
wood_pattern: The pattern types visible on the wood surface"""
system_prompt = f"""Extract the following from the image:
{fields_yaml}
Respond with only a JSON object. Do not include any text outside the JSON."""
formatted_prompt = apply_chat_template(
processor,
processor.config,
system_prompt,
num_images=1
)
output = generate(
model,
processor,
formatted_prompt,
image=[image],
max_tokens=512,
temperature=0.0,
verbose=False
)
print(output)
📬 Citation & Contact
- Liquid AI Discord: Join Discord
- MLX Framework: MLX GitHub
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
- Downloads last month
- 30
8-bit
Model tree for LeoFortunato/LFM2.5-VL-450M-Extract-MLX-8bit
Base model
LiquidAI/LFM2.5-350M-Base