Image-Text-to-Text
MLX
Safetensors
lfm2_vl
liquid
lfm2
lfm2-vl
edge
lfm2.5-vl
lfm2.5
conversational
8-bit precision
Instructions to use EZCon/LFM2.5-VL-1.6B-8bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use EZCon/LFM2.5-VL-1.6B-8bit-mlx 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("EZCon/LFM2.5-VL-1.6B-8bit-mlx") config = load_config("EZCon/LFM2.5-VL-1.6B-8bit-mlx") # 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
- LM Studio
- Pi
How to use EZCon/LFM2.5-VL-1.6B-8bit-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "EZCon/LFM2.5-VL-1.6B-8bit-mlx"
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": "EZCon/LFM2.5-VL-1.6B-8bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use EZCon/LFM2.5-VL-1.6B-8bit-mlx 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 "EZCon/LFM2.5-VL-1.6B-8bit-mlx"
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 EZCon/LFM2.5-VL-1.6B-8bit-mlx
Run Hermes
hermes
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- chat_template.jinja +4 -3
README.md
CHANGED
|
@@ -25,7 +25,7 @@ base_model: LiquidAI/LFM2.5-1.2B-Base
|
|
| 25 |
---
|
| 26 |
|
| 27 |
# EZCon/LFM2.5-VL-1.6B-8bit-mlx
|
| 28 |
-
This model was converted to MLX format from [`LiquidAI/LFM2.5-VL-1.6B`]() using mlx-vlm version **0.3.
|
| 29 |
Refer to the [original model card](https://huggingface.co/LiquidAI/LFM2.5-VL-1.6B) for more details on the model.
|
| 30 |
## Use with mlx
|
| 31 |
|
|
|
|
| 25 |
---
|
| 26 |
|
| 27 |
# EZCon/LFM2.5-VL-1.6B-8bit-mlx
|
| 28 |
+
This model was converted to MLX format from [`LiquidAI/LFM2.5-VL-1.6B`]() using mlx-vlm version **0.3.12**.
|
| 29 |
Refer to the [original model card](https://huggingface.co/LiquidAI/LFM2.5-VL-1.6B) for more details on the model.
|
| 30 |
## Use with mlx
|
| 31 |
|
chat_template.jinja
CHANGED
|
@@ -38,10 +38,9 @@
|
|
| 38 |
{%- endfor -%}
|
| 39 |
{%- for message in messages -%}
|
| 40 |
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
| 41 |
-
{%-
|
| 42 |
-
{%- if content is not string -%}
|
| 43 |
{%- set ns.content = "" -%}
|
| 44 |
-
{%- for item in content -%}
|
| 45 |
{%- if item["type"] == "image" -%}
|
| 46 |
{%- set ns.content = ns.content + "<image>" -%}
|
| 47 |
{%- elif item["type"] == "text" -%}
|
|
@@ -51,6 +50,8 @@
|
|
| 51 |
{%- endif -%}
|
| 52 |
{%- endfor -%}
|
| 53 |
{%- set content = ns.content -%}
|
|
|
|
|
|
|
| 54 |
{%- endif -%}
|
| 55 |
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 56 |
{%- if "</think>" in content -%}
|
|
|
|
| 38 |
{%- endfor -%}
|
| 39 |
{%- for message in messages -%}
|
| 40 |
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
| 41 |
+
{%- if message["content"] is not string -%}
|
|
|
|
| 42 |
{%- set ns.content = "" -%}
|
| 43 |
+
{%- for item in message["content"] -%}
|
| 44 |
{%- if item["type"] == "image" -%}
|
| 45 |
{%- set ns.content = ns.content + "<image>" -%}
|
| 46 |
{%- elif item["type"] == "text" -%}
|
|
|
|
| 50 |
{%- endif -%}
|
| 51 |
{%- endfor -%}
|
| 52 |
{%- set content = ns.content -%}
|
| 53 |
+
{%- else -%}
|
| 54 |
+
{%- set content = message["content"] -%}
|
| 55 |
{%- endif -%}
|
| 56 |
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 57 |
{%- if "</think>" in content -%}
|