Instructions to use EZCon/LFM2.5-VL-1.6B-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-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-mlx") config = load_config("EZCon/LFM2.5-VL-1.6B-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 Settings
- LM Studio
- Pi
How to use EZCon/LFM2.5-VL-1.6B-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-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-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use EZCon/LFM2.5-VL-1.6B-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-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-mlx
Run Hermes
hermes
| {{- bos_token -}} | |
| {%- set keep_past_thinking = keep_past_thinking | default(false) -%} | |
| {%- set ns = namespace(system_prompt="") -%} | |
| {%- if messages[0]["role"] == "system" -%} | |
| {%- set sys_content = messages[0]["content"] -%} | |
| {%- if sys_content is not string -%} | |
| {%- for item in sys_content -%} | |
| {%- if item["type"] == "text" -%} | |
| {%- set ns.system_prompt = ns.system_prompt + item["text"] -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- else -%} | |
| {%- set ns.system_prompt = sys_content -%} | |
| {%- endif -%} | |
| {%- set messages = messages[1:] -%} | |
| {%- endif -%} | |
| {%- if tools -%} | |
| {%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%} | |
| {%- for tool in tools -%} | |
| {%- if tool is not string -%} | |
| {%- set tool = tool | tojson -%} | |
| {%- endif -%} | |
| {%- set ns.system_prompt = ns.system_prompt + tool -%} | |
| {%- if not loop.last -%} | |
| {%- set ns.system_prompt = ns.system_prompt + ", " -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- set ns.system_prompt = ns.system_prompt + "]" -%} | |
| {%- endif -%} | |
| {%- if ns.system_prompt -%} | |
| {{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}} | |
| {%- endif -%} | |
| {%- set ns.last_assistant_index = -1 -%} | |
| {%- for message in messages -%} | |
| {%- if message["role"] == "assistant" -%} | |
| {%- set ns.last_assistant_index = loop.index0 -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- for message in messages -%} | |
| {{- "<|im_start|>" + message["role"] + "\n" -}} | |
| {%- if message["content"] is not string -%} | |
| {%- set ns.content = "" -%} | |
| {%- for item in message["content"] -%} | |
| {%- if item["type"] == "image" -%} | |
| {%- set ns.content = ns.content + "<image>" -%} | |
| {%- elif item["type"] == "text" -%} | |
| {%- set ns.content = ns.content + item["text"] -%} | |
| {%- else -%} | |
| {%- set ns.content = ns.content + item | tojson -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- set content = ns.content -%} | |
| {%- else -%} | |
| {%- set content = message["content"] -%} | |
| {%- endif -%} | |
| {%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%} | |
| {%- if "</think>" in content -%} | |
| {%- set content = content.split("</think>")[-1] | trim -%} | |
| {%- endif -%} | |
| {%- endif -%} | |
| {{- content + "<|im_end|>\n" -}} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt -%} | |
| {{- "<|im_start|>assistant\n" -}} | |
| {%- endif -%} |