Image-Text-to-Text
MLX
Safetensors
lfm3_vl
liquid
lfm3
edge
decision
classification
calibration
system-one
multimodal
vision
conversational
custom_code
4-bit precision
Instructions to use LiquidAI/d1-2B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LiquidAI/d1-2B-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-2B-MLX-4bit") config = load_config("LiquidAI/d1-2B-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-2B-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-2B-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-2B-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use LiquidAI/d1-2B-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-2B-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-2B-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LiquidAI/d1-2B-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-2B-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-2B-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 calibration.json from LiquidAI/d1-2B-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 4.92 kB
-
https://huggingface.co/LiquidAI/d1-2B-MLX-4bit/resolve/main/calibration.json
- Command line
-
hf download hf://LiquidAI/d1-2B-MLX-4bit/calibration.json
-
curl -L -o calibration.json https://huggingface.co/LiquidAI/d1-2B-MLX-4bit/resolve/main/calibration.json
4.92 kB
| { | |
| "default": 1.337398453966105, | |
| "temperatures": {}, | |
| "tables": { | |
| "found:text": [ | |
| [ | |
| 0.005682162615729877, | |
| 0.0 | |
| ], | |
| [ | |
| 0.020574209407310595, | |
| 0.011363636363636364 | |
| ], | |
| [ | |
| 0.05274184431288053, | |
| 0.022727272727272728 | |
| ], | |
| [ | |
| 0.12593568082560191, | |
| 0.11363636363636363 | |
| ], | |
| [ | |
| 0.2609023091129281, | |
| 0.25 | |
| ], | |
| [ | |
| 0.45711776140061294, | |
| 0.42045454545454547 | |
| ], | |
| [ | |
| 0.6460263153368776, | |
| 0.5568181818181818 | |
| ], | |
| [ | |
| 0.7728411636569283, | |
| 0.7727272727272727 | |
| ], | |
| [ | |
| 0.852111120115627, | |
| 0.8522727272727273 | |
| ], | |
| [ | |
| 0.9055508368394591, | |
| 0.9204545454545454 | |
| ], | |
| [ | |
| 0.9416752389886163, | |
| 0.9318181818181818 | |
| ], | |
| [ | |
| 0.9675597308034246, | |
| 0.9772727272727273 | |
| ], | |
| [ | |
| 0.9927885918454691, | |
| 0.9924242424242424 | |
| ], | |
| [ | |
| 0.9997205003886156, | |
| 1.0 | |
| ] | |
| ], | |
| "found:number": [ | |
| [ | |
| 0.01582507598356401, | |
| 0.0 | |
| ], | |
| [ | |
| 0.1465578345315797, | |
| 0.2857142857142857 | |
| ], | |
| [ | |
| 0.29448616611106054, | |
| 0.5 | |
| ], | |
| [ | |
| 0.6300800165959767, | |
| 0.7142857142857143 | |
| ], | |
| [ | |
| 0.9313231366021293, | |
| 0.9285714285714286 | |
| ], | |
| [ | |
| 0.9951998972501911, | |
| 1.0 | |
| ] | |
| ], | |
| "found:date": [ | |
| [ | |
| 0.008417200646363199, | |
| 0.0 | |
| ], | |
| [ | |
| 0.5494083234419426, | |
| 0.5 | |
| ], | |
| [ | |
| 0.9654906044403712, | |
| 0.9166666666666666 | |
| ], | |
| [ | |
| 0.9966836659113566, | |
| 1.0 | |
| ] | |
| ], | |
| "found:box": [ | |
| [ | |
| 0.0010319100776659475, | |
| 0.0027472527472527475 | |
| ], | |
| [ | |
| 0.0162678323005357, | |
| 0.11235955056179775 | |
| ], | |
| [ | |
| 0.1641463061831407, | |
| 0.4157303370786517 | |
| ], | |
| [ | |
| 0.6041711138630492, | |
| 0.8541666666666666 | |
| ], | |
| [ | |
| 0.8735690557675277, | |
| 0.978021978021978 | |
| ], | |
| [ | |
| 0.9579824398960495, | |
| 0.9887640449438202 | |
| ], | |
| [ | |
| 0.9952215192477699, | |
| 1.0 | |
| ] | |
| ], | |
| "box": [ | |
| [ | |
| 0.08177083333333333, | |
| 0.18333333333333332 | |
| ], | |
| [ | |
| 0.35257161458333336, | |
| 0.4 | |
| ], | |
| [ | |
| 0.5962035123966942, | |
| 0.6694214876033058 | |
| ], | |
| [ | |
| 0.7902631915983607, | |
| 0.7786885245901639 | |
| ], | |
| [ | |
| 0.8755763319672131, | |
| 0.8688524590163934 | |
| ], | |
| [ | |
| 0.9086263020833333, | |
| 0.9 | |
| ], | |
| [ | |
| 0.9435433650362319, | |
| 0.9492753623188406 | |
| ], | |
| [ | |
| 0.9652183219178082, | |
| 0.9726027397260274 | |
| ], | |
| [ | |
| 0.9831365659916201, | |
| 0.9888268156424581 | |
| ], | |
| [ | |
| 0.9948308270676691, | |
| 1.0 | |
| ] | |
| ], | |
| "estimate": [ | |
| [ | |
| 0.030000000000000002, | |
| 0.22420634920634921 | |
| ], | |
| [ | |
| 0.09, | |
| 0.28869047619047616 | |
| ], | |
| [ | |
| 0.15000000000000002, | |
| 0.3551587301587302 | |
| ], | |
| [ | |
| 0.21000000000000002, | |
| 0.4007936507936508 | |
| ], | |
| [ | |
| 0.27, | |
| 0.4603174603174603 | |
| ], | |
| [ | |
| 0.32999999999999996, | |
| 0.5238095238095238 | |
| ], | |
| [ | |
| 0.39, | |
| 0.5922619047619048 | |
| ], | |
| [ | |
| 0.44999999999999996, | |
| 0.6448412698412699 | |
| ], | |
| [ | |
| 0.51, | |
| 0.7033730158730159 | |
| ], | |
| [ | |
| 0.57, | |
| 0.7579365079365079 | |
| ], | |
| [ | |
| 0.63, | |
| 0.7986111111111112 | |
| ], | |
| [ | |
| 0.69, | |
| 0.8452380952380952 | |
| ], | |
| [ | |
| 0.75, | |
| 0.8869047619047619 | |
| ], | |
| [ | |
| 0.81, | |
| 0.9246031746031746 | |
| ], | |
| [ | |
| 0.87, | |
| 0.9523809523809523 | |
| ], | |
| [ | |
| 0.93, | |
| 0.9751984126984127 | |
| ], | |
| [ | |
| 0.9799999999999999, | |
| 0.9940476190476191 | |
| ] | |
| ], | |
| "multiple": [ | |
| [ | |
| 0.0016627926872626571, | |
| 0.0 | |
| ], | |
| [ | |
| 0.008286236297705318, | |
| 0.0024813895781637717 | |
| ], | |
| [ | |
| 0.013284336191710702, | |
| 0.0049504950495049506 | |
| ], | |
| [ | |
| 0.017877624036637375, | |
| 0.015 | |
| ], | |
| [ | |
| 0.023793328700436385, | |
| 0.018518518518518517 | |
| ], | |
| [ | |
| 0.03199311782995977, | |
| 0.03398058252427184 | |
| ], | |
| [ | |
| 0.04889508202323689, | |
| 0.05459057071960298 | |
| ], | |
| [ | |
| 0.07631002315865278, | |
| 0.07407407407407407 | |
| ], | |
| [ | |
| 0.10610537429711313, | |
| 0.1262135922330097 | |
| ], | |
| [ | |
| 0.1516745984883731, | |
| 0.15865384615384615 | |
| ], | |
| [ | |
| 0.2304679394076778, | |
| 0.21393034825870647 | |
| ], | |
| [ | |
| 0.374861408323991, | |
| 0.3417085427135678 | |
| ], | |
| [ | |
| 0.6689872755703948, | |
| 0.7 | |
| ], | |
| [ | |
| 0.976994335126831, | |
| 0.9690721649484536 | |
| ] | |
| ], | |
| "found:boxes": [ | |
| [ | |
| 0.0022886859880368398, | |
| 0.0 | |
| ], | |
| [ | |
| 0.11311487904813239, | |
| 0.0891089108910891 | |
| ], | |
| [ | |
| 0.39857997008840157, | |
| 0.3786407766990291 | |
| ], | |
| [ | |
| 0.8182158553298949, | |
| 0.8514851485148515 | |
| ], | |
| [ | |
| 0.980104905128495, | |
| 0.9702970297029703 | |
| ], | |
| [ | |
| 0.9981022046260327, | |
| 1.0 | |
| ] | |
| ], | |
| "boxes": [ | |
| [ | |
| 0.00048828125, | |
| 0.0 | |
| ], | |
| [ | |
| 0.008246527777777778, | |
| 0.05555555555555555 | |
| ], | |
| [ | |
| 0.0777587890625, | |
| 0.3125 | |
| ], | |
| [ | |
| 0.20135498046875, | |
| 0.46875 | |
| ], | |
| [ | |
| 0.3692626953125, | |
| 0.5625 | |
| ], | |
| [ | |
| 0.50830078125, | |
| 0.625 | |
| ], | |
| [ | |
| 0.5980224609375, | |
| 0.6875 | |
| ], | |
| [ | |
| 0.6732177734375, | |
| 0.8125 | |
| ], | |
| [ | |
| 0.8321126302083334, | |
| 0.9375 | |
| ], | |
| [ | |
| 0.9644757699275363, | |
| 0.9710144927536232 | |
| ], | |
| [ | |
| 0.9945746527777778, | |
| 1.0 | |
| ] | |
| ] | |
| } | |
| } | |