Image-Text-to-Text
MLX
Safetensors
lfm2_vl
liquid
lfm2.5
edge
decision
classification
calibration
system-one
multimodal
vision
mlx-vlm
conversational
custom_code
4-bit precision
Instructions to use LiquidAI/d1-3B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LiquidAI/d1-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/d1-3B-MLX-4bit") config = load_config("LiquidAI/d1-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/d1-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/d1-3B-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/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/d1-3B-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use LiquidAI/d1-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/d1-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/d1-3B-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LiquidAI/d1-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/d1-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/d1-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"
Download config.json from LiquidAI/d1-3B-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 3.44 kB
-
https://huggingface.co/LiquidAI/d1-3B-MLX-4bit/resolve/main/config.json
- Command line
-
hf download hf://LiquidAI/d1-3B-MLX-4bit/config.json
-
curl -L -o config.json https://huggingface.co/LiquidAI/d1-3B-MLX-4bit/resolve/main/config.json
3.44 kB
| { | |
| "architectures": [ | |
| "Lfm2VlForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoModel": "modeling_d1.D1Model" | |
| }, | |
| "bos_token_id": 124894, | |
| "do_image_splitting": true, | |
| "do_resize": true, | |
| "downsample_factor": 2, | |
| "dtype": "float16", | |
| "encoder_patch_size": 16, | |
| "eos_token_id": 124900, | |
| "image_token_id": 124907, | |
| "max_image_tokens": 256, | |
| "max_num_patches": 1024, | |
| "max_pixels_tolerance": 2.0, | |
| "max_tiles": 10, | |
| "min_image_tokens": 64, | |
| "min_tiles": 2, | |
| "model_type": "lfm2_vl", | |
| "pad_token_id": 124893, | |
| "projector_bias": true, | |
| "projector_hidden_act": "gelu", | |
| "projector_hidden_size": 2048, | |
| "projector_use_layernorm": false, | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 4, | |
| "mode": "affine" | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 4, | |
| "mode": "affine" | |
| }, | |
| "text_config": { | |
| "architectures": [ | |
| "Lfm2ForCausalLM" | |
| ], | |
| "block__name_mlp": "parallel_mlp_merged", | |
| "block_auto_adjust_ff_dim": false, | |
| "block_dim": 2048, | |
| "block_ffn_dim_multiplier": 1.0, | |
| "block_multiple_of": 256, | |
| "block_norm_eps": 1e-05, | |
| "block_use_swiglu": true, | |
| "bos_token_id": 124894, | |
| "conv_L_cache": 3, | |
| "conv_bias": false, | |
| "conv_dim": 2048, | |
| "dtype": "float16", | |
| "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" | |
| ], | |
| "max_position_embeddings": 32768, | |
| "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 | |
| }, | |
| "tie_word_embeddings": true, | |
| "tile_size": 512, | |
| "transformers_version": "5.14.1", | |
| "use_image_special_tokens": true, | |
| "use_thumbnail": true, | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "dtype": "float16", | |
| "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 | |
| } | |
| } | |