Image-Text-to-Text
MLX
Safetensors
lfm2_vl
liquid
lfm2
lfm2-vl
edge
lfm2.5
lfm2.5-vl
mlx_vlm
conversational
custom_code
4-bit precision
Instructions to use LiquidAI/LFM2.5-VL-3B-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-3B-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-3B-MLX-4bit") config = load_config("LiquidAI/LFM2.5-VL-3B-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-3B-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-3B-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-3B-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use LiquidAI/LFM2.5-VL-3B-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-3B-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-3B-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"
- Hermes Agent
How to use LiquidAI/LFM2.5-VL-3B-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-3B-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-3B-MLX-4bit
Run Hermes
hermes
- Atomic Chat
| { | |
| "architectures": [ | |
| "Lfm2VlForConditionalGeneration" | |
| ], | |
| "auto_map": {}, | |
| "bos_token_id": 124894, | |
| "do_image_splitting": true, | |
| "do_resize": true, | |
| "downsample_factor": 2, | |
| "dtype": "bfloat16", | |
| "encoder_patch_size": 16, | |
| "eos_token_id": [ | |
| 124900 | |
| ], | |
| "freeze_language_model": false, | |
| "freeze_multi_modal_projector": false, | |
| "freeze_vision_tower": false, | |
| "generation_config": { | |
| "_from_model_config": true, | |
| "bos_token_id": 124894, | |
| "eos_token_id": [ | |
| 124900 | |
| ], | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "pad_token_id": 124893, | |
| "transformers_version": "5.8.1", | |
| "use_cache": true | |
| }, | |
| "image_token_id": 124907, | |
| "image_token_index": 124907, | |
| "keep_trainable_parameters_fp32": true, | |
| "language_model_lr_multiplier": 1.0, | |
| "lfm2_attention_backend": "flash_varlen", | |
| "lfm2_attention_fusion": "fused_linear", | |
| "lfm2_flash_varlen_blhd_fastpath": false, | |
| "lfm2_frozen_input_grad_only_linear": true, | |
| "lfm2_mlp_fusion": "triton_swiglu", | |
| "lfm2_rmsnorm_fusion": "none", | |
| "lfm2_short_conv_frozen_recompute_in_proj": 0, | |
| "lfm2_torch_compile_clone_outputs": false, | |
| "lfm2_torch_compile_disable_cudagraphs": true, | |
| "lfm2_torch_compile_dynamic": true, | |
| "lfm2_torch_compile_fullgraph": false, | |
| "lfm2_torch_compile_layers": "none", | |
| "lfm2_torch_compile_mlp": false, | |
| "lfm2_torch_compile_mode": "reduce-overhead", | |
| "lfm2_vl_direct_image_merge_by_shape": true, | |
| "lfm2_vl_forward_dtype": "bf16", | |
| "lfm2_vl_frozen_vision_chunk_size": 2048, | |
| "lfm2_vl_grouped_image_projector": true, | |
| "lfm2_vl_grouped_vision_by_patch_count": false, | |
| "lfm2_vl_grouped_vision_by_shape": true, | |
| "lfm2_vl_inplace_image_merge": true, | |
| "lfm2_vl_siglip_packed_vision": true, | |
| "lfm2_vl_torch_compile_vision_encoder": true, | |
| "lfm2_vl_torch_compile_vision_encoder_mode": "whole", | |
| "lm_head_loss_mask_only": true, | |
| "max_image_tokens": 256, | |
| "max_num_patches": 1024, | |
| "max_pixels_tolerance": 2.0, | |
| "max_tiles": 10, | |
| "min_image_tokens": 64, | |
| "min_tiles": 1, | |
| "model_type": "lfm2_vl", | |
| "pad_token_id": 124893, | |
| "projector_bias": true, | |
| "projector_hidden_act": "gelu", | |
| "projector_hidden_size": 2048, | |
| "projector_lr_multiplier": 1.0, | |
| "projector_use_layernorm": false, | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 4, | |
| "mode": "affine" | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 4, | |
| "mode": "affine" | |
| }, | |
| "siglip2_layernorm_fusion": "liger", | |
| "text_config": { | |
| "block__name_mlp": "parallel_mlp_merged", | |
| "block_auto_adjust_ff_dim": false, | |
| "block_dim": 2048, | |
| "block_ffn_dim_multiplier": 1.0, | |
| "block_ffn_te_autocast": false, | |
| "block_ffn_use_quantized_params": false, | |
| "block_mlp_init_scale": 1.0, | |
| "block_multiple_of": 256, | |
| "block_norm_eps": 1e-05, | |
| "block_out_init_scale": 1.0, | |
| "block_use_swiglu": true, | |
| "block_use_xavier_init": true, | |
| "bos_token_id": 124894, | |
| "conv_L_cache": 3, | |
| "conv_bias": false, | |
| "conv_dim": 2048, | |
| "conv_use_xavier_init": true, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 124900, | |
| "full_attn_idxs": null, | |
| "hidden_size": 2048, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 10752, | |
| "layer_types": [ | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv" | |
| ], | |
| "lfm2_attention_backend": "flash_varlen", | |
| "lfm2_flash_varlen_blhd_fastpath": false, | |
| "lfm2_frozen_input_grad_only_linear": true, | |
| "max_position_embeddings": 128000, | |
| "mm_config_image_embedder": { | |
| "activation_checkpointing_layer_stride": 0, | |
| "attn_implementation": "sdpa", | |
| "cuda_sync_points": [], | |
| "downsample": 2, | |
| "encoder_load_balance": false, | |
| "hidden_dim": 2048, | |
| "hidden_state_index": -1, | |
| "layer_norm": false, | |
| "max_batch_size": 1024, | |
| "pretrained_model_name_or_path": "google/siglip2-so400m-patch16-naflex", | |
| "set_activation_checkpointing": false, | |
| "use_image_special_tokens": true, | |
| "use_pooling_head": false, | |
| "use_slice_special_tokens": false, | |
| "use_torch_pixel_unshuffle": false | |
| }, | |
| "model_type": "lfm2", | |
| "norm_eps": 1e-05, | |
| "num_attention_heads": 32, | |
| "num_heads": 32, | |
| "num_hidden_layers": 30, | |
| "num_key_value_heads": 8, | |
| "output_softcap": 0.0, | |
| "pad_token_id": 124893, | |
| "rope_parameters": { | |
| "rope_theta": 1000000.0, | |
| "rope_type": "default" | |
| }, | |
| "tie_word_embeddings": true, | |
| "use_cache": true, | |
| "use_pos_enc": true, | |
| "vocab_size": 128000, | |
| "architectures": [ | |
| "Lfm2ForCausalLM" | |
| ], | |
| "tie_embedding": true, | |
| "rope_theta": 1000000.0, | |
| "block_ff_dim": 10752 | |
| }, | |
| "tie_word_embeddings": true, | |
| "tile_size": 512, | |
| "transformers_version": "5.8.1", | |
| "use_image_special_tokens": true, | |
| "use_thumbnail": true, | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "dtype": "bfloat16", | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_size": 1152, | |
| "intermediate_size": 4304, | |
| "layer_norm_eps": 1e-06, | |
| "model_type": "siglip2_vision_model", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 27, | |
| "num_patches": 256, | |
| "patch_size": 16, | |
| "vision_use_head": false | |
| }, | |
| "vision_tower_lr_multiplier": 1.0 | |
| } | |