Instructions to use LiquidAI/d1-3B-MLX-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LiquidAI/d1-3B-MLX-fp16 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-fp16") config = load_config("LiquidAI/d1-3B-MLX-fp16") # 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-fp16 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-fp16"
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-fp16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use LiquidAI/d1-3B-MLX-fp16 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-fp16"
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-fp16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LiquidAI/d1-3B-MLX-fp16 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-fp16"
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-fp16" \ --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"
d1-3B-MLX-fp16
d1-3B is a decision model developed by Liquid AI: it answers named, typed questions over a state (text, JSON or images) in one forward pass, with no generated tokens.
This repository is an MLX export of d1-3B in float16 for Apple Silicon, run with mlx-vlm. Find more details in the original model card: https://huggingface.co/LiquidAI/d1-3B
🏃 How to run d1-3B
d1 support is in mlx-vlm after 0.7.6. Until the next release, install it from GitHub:
pip install -U git+https://github.com/Blaizzy/mlx-vlm.git
from mlx_vlm import load, predict
model, processor = load("LiquidAI/d1-3B-MLX-fp16")
# Text: several named questions over one state, answered in one pass
questions = {
"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"},
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Charges, refunds, invoices",
"technical": "App or site faults",
"fraud": "Suspected unauthorised use",
},
},
"urgency": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": ["Can wait", "Today", "Blocking the customer now"],
},
}
result = predict(model, processor, "I was charged twice this month, please refund one of them.", questions)
print(result["answers"])
# Image: the photo is the whole state
cats = {
"type": "choice",
"instructions": "How many cats are there?",
"criteria": {"one": "One", "two": "Two", "more": "Three or more"},
}
print(predict(model, processor, None, {"cats": cats},
images=["http://images.cocodataset.org/val2017/000000039769.jpg"]))
Each call returns {"answers": {name: answer}, "usage": {"input_tokens": n, "output_tokens": 0}}. A choice answer has the chosen label in value, plus probabilities and metadata.confidence; a score answer has the expected level in value, plus probabilities and the level legend; a noul (or bool) answer has probability, the probability of yes.
From the command line:
python -m mlx_vlm decide --model LiquidAI/d1-3B-MLX-fp16 \
--state "I was charged twice this month, please refund one of them." \
--questions '{"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"}}'
--state is optional with one or more --image options.
As a server, with the same request shape on /v1/decisions ("images" take URLs, paths or base64 data URIs):
python -m mlx_vlm server --decision-model LiquidAI/d1-3B-MLX-fp16
curl http://127.0.0.1:8080/v1/decisions -H "Content-Type: application/json" -d '{
"state": "I was charged twice this month, please refund one of them.",
"questions": {"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"}}
}'
📏 Precisions
Every precision was checked against the original checkpoint run in float32 with mlx-vlm, which matches the PyTorch reference to about 1e-5 in probability. The check covers 104 text and 41 image answers. "Same top answer" counts answers whose most likely option matches the float32 run; Δp is the largest change in any option's probability.
| Repository | Weights | Size | Same top answer | Max Δp | Mean Δp |
|---|---|---|---|---|---|
| d1-3B-MLX-fp16 | float16 | 6.25 GB | 145/145 | 0.005 | 0.0006 |
| d1-3B-MLX-8bit | 8-bit language model; vision tower, projector and norms in float16 | 3.72 GB | 144/145 | 0.015 | 0.0020 |
| d1-3B-MLX-4bit | 4-bit language model; vision tower, projector and norms in float16 | 2.37 GB | 142/145 | 0.212 | 0.0276 |
float16 is the recommended precision. The checkpoint is stored in bfloat16; in float16 all but about 0.1% of its weights, the very smallest, are exact and none overflow, and float16 computes with more precision at the same speed on Apple GPUs. It stays closest to the float32 answers, so there is no bfloat16 export. The quantized exports keep their unquantized parts in float16, which cut the 8-bit drift by more than half compared with bfloat16. 8-bit moves probabilities by up to about 0.015. 4-bit moves them by up to about 0.2, so prefer it only where memory matters more than calibration. The top answers that changed were near ties, with the float32 runner-up within 0.1. The vision tower and projector are never quantized. This check is a smoke test of agreement, not an accuracy benchmark.
🧪 Recipe
Converted from d1-3B at revision 051bcc464b01 with mlx-vlm at commit 952d4f6bc65b:
python -m mlx_vlm convert --hf-path LiquidAI/d1-3B --mlx-path d1-3B-MLX-fp16 --dtype float16
The upstream PyTorch .py files were removed after conversion; config.json keeps its auto_map entry, which mlx-vlm uses to select d1.
Citation
@article{liquidAI2026opend1,
author = {Liquid AI},
title = {Open d1: Edge decision models for text, vision, and audio},
journal = {Liquid AI Blog},
year = {2026},
note = {https://www.liquid.ai/blog/d1-open},
}
@article{liquidai2025lfm2,
title = {LFM2 Technical Report},
author = {Liquid AI},
journal = {arXiv preprint arXiv:2511.23404},
year = {2025}
}
📄 License
This model is released under the LFM 1.0 License, as is the original checkpoint.
- Downloads last month
- 6
Quantized