d1-2B-MLX-fp16
FP16 MLX version of d1-2B for Apple Silicon. The weights take 3.84 GB.
d1-2B is a decision model for text, pictures, and video. It answers named, typed questions over a state with calibrated probabilities in one forward pass, without generating tokens.
Weights are stored in FP16, the recommended precision. It stays closest to the original checkpoint run in float32, so there is no BF16 export.
Find architecture and usage details in the original model card.
Use with MLX-VLM
Requires MLX-VLM 0.7.11 or later:
pip install -U "mlx-vlm>=0.7.11"
d1-2B answers questions without generating text, so chat apps and mlx_vlm.generate cannot run it. Use model.system_one or the decide command below.
from mlx_vlm import load
from mlx_vlm.utils import load_image
model, processor = load("LiquidAI/d1-2B-MLX-fp16")
# Text: several named questions over one state, answered in one pass
ticket = "I was charged twice and my parcel never arrived. Please refund one charge."
out = model.system_one(ticket, {
"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",
"shipping": "Delivery and parcels",
"technical": "App or site faults"}},
"topics": {"type": "choice", "multiple": True,
"instructions": "Which topics does the message raise?",
"criteria": {"billing": "Payments and charges",
"delivery": "Shipping and parcels",
"login": "Signing in to the account"}},
"urgency": {"type": "score", "instructions": "How urgent is this ticket?",
"criteria": ["low", "medium", "high"]},
})
a = out["answers"]
print(round(a["refund"]["noul"], 2), a["team"]["choice"], a["topics"]["choices"],
a["urgency"]["legend"][str(int(a["urgency"]["score"]))])
# 1.0 billing ['billing', 'delivery'] medium
print(out["usage"])
# {'input_tokens': 189, 'output_tokens': 0}
# Picture: the photo is the whole state
image = load_image("http://images.cocodataset.org/val2017/000000039769.jpg")
out = model.system_one(None, {
"cats": {"type": "number", "instructions": "How many cats are there?", "range": [0, 10], "step": 1},
"remote": {"type": "box", "instructions": "Where is the remote control on the left?"},
}, media=[image])
a = out["answers"]
print(a["cats"]["number"], {k: round(v, 2) for k, v in a["remote"]["box"].items()})
# 2.0 {'top': 0.15, 'bottom': 0.24, 'left': 0.06, 'right': 0.28}
model.system_one returns {"answers": {name: answer}, "usage": {...}}, and model.system_one_batch takes several requests. The original model card describes every question type and answer field.
From the command line, the answers print as JSON:
python -m mlx_vlm decide --model LiquidAI/d1-2B-MLX-fp16 \
--state "I was charged twice this month. Please refund one of the charges." \
--questions '{"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"}}'
More options in the MLX guide.