d1-2B
LiquidAI/d1-2B
- 作者
- LiquidAI
- 任务
- 多模态
- 下载量
- 5,952
- 点赞数
- 201
- 趋势分
- 134
- 许可证
- other
- 收录时间
- 2026/11/4
library_name: transformers license: other license_name: lfm1.0 license_link: LICENSE pipeline_tag: image-text-to-text base_model: LiquidAI/LFM3-VL-2B tags:
- liquid
- lfm3
- edge
- decision
- classification
- extraction
- calibration
- system-one
- multimodal
- decision-model
- custom_code language:
- en
- ar
- zh
- fr
- de
- it
- ja
- ko
- pt
- es
- vi
- th
- id
- hi
- ru
- pl
d1-2B
d1-2B is a decision model for text, pictures, and video, built on LFM3-VL-2B. It returns calibrated answers in one forward pass, without generating tokens.
- Best-in-class: it leads the open d1 models on average and on our board of over a hundred decision benchmarks, ahead of d1-3B at under two thirds of its size.
- Beyond classification: it also extracts text, numbers, and dates with their span, locates objects in pictures, and estimates quantities with an interval.
- Millisecond decisions: 5.7 ms per decision on an NVIDIA H100 and 3.8 ms on an AMD MI325X, with any number of questions about one state in one call.
Find more information about open d1 in our release blog post.
Model details
The LFM3 family includes base, text, vision, audio, omni, and decision models. d1-2B decides over text, pictures, and video, and d1-Omni-2B adds audio.
d1-2B is designed for any pipeline step that needs a decision: routing and triage, moderation and guardrails, intent and topic classification, extraction from documents and forms, judging and reranking, and visual inspection. It is not a chat model.
Knowledge-heavy questions favor larger models, and answers get less reliable past about 64K tokens of state. Estimates are reliable on counts and scores, less so on free quantities.
Inference
d1-2B runs in Transformers with its own model code. It reads its answers from a single forward pass, so there are no sampling parameters to set.
Transformers quick start:
pip install "transformers>=5.19" torch torchvision pillow
import torch
from transformers import AutoModel
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
dtype = torch.float32 if device == "cpu" else torch.bfloat16
model = AutoModel.from_pretrained("LiquidAI/d1-2B", trust_remote_code=True, dtype=dtype).to(device)
# Several named questions over one state, answered in one pass
questions = {
"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"}, # yes/no: P(yes)
"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"]},
}
out = model.system_one("I was charged twice and my parcel never arrived. Please refund one charge.", questions)
a = out["answers"]
urgency = a["urgency"]["legend"][str(int(a["urgency"]["score"]))]
print(round(a["refund"]["noul"], 2), a["team"]["choice"], a["topics"]["choices"], urgency)
# 1.0 billing ['billing', 'delivery'] medium
invoice = "ACME SA\nInvoice 2026-117\nTotal due: 1 234,50 EUR\nPay before 03/04/2026 (day/month/year)"
out = model.system_one(invoice, {
"payee": {"type": "text", "instructions": "Who issued the invoice?"},
"total": {"type": "number", "instructions": "How much is due?"},
"due": {"type": "date", "instructions": "By when must it be paid?"},
"vat": {"type": "number", "instructions": "How much VAT is charged?"},
})
a = out["answers"]
print(a["payee"]["text"], a["total"]["number"], a["due"]["date"], a["vat"]["number"])
# ACME SA 1234.5 2026-04-03 None
Count, locate one object, or list every instance (max reads at most that many):
from transformers.image_utils import load_image
image = load_image("http://images.cocodataset.org/val2017/000000039769.jpg") # two cats on a sofa
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?"},
"every_cat": {"type": "boxes", "instructions": "Every cat.", "max": 4},
}, media=[image])
a = out["answers"]
print(a["cats"]["number"], a["every_cat"]["count"], {k: round(v, 2) for k, v in a["remote"]["box"].items()})
# 2.0 2 {'top': 0.15, 'bottom': 0.24, 'left': 0.06, 'right': 0.28}
tickets = ["Where is my parcel? It was due Monday.", "The app crashes when I open settings."]
for out in model.system_one_batch([(t, {"team": questions["team"]}) for t in tickets]):
print(out["answers"]["team"]["choice"])
# shipping
# technical
A state is a string, any JSON value, or None when the media are the whole state. Each call returns {"answers": {name: answer}, "usage": {"input_tokens": n, "output_tokens": 0}}.
A value or a box is missing when found is under 0.5, and it is then None. Calibrate any decision threshold on data from your own use.
Performance
Benchmarks
d1-2B leads the open d1 models on our decision board, on average, and on most single benchmarks, ahead of d1-3B with under two thirds of its parameters.
Speed
Warm calls after model.compile() in bf16, median of 20 calls, and best of three runs on the H100 and the M5 Pro. Compiling takes about a minute on the first calls.
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/open-d1},
}
@article{liquidAI2026LFM3,
author = {Liquid AI},
title = {Introducing LFM3: Every Modality for Specialized Intelligence},
journal = {Liquid AI Blog},
year = {2026},
note = {https://www.liquid.ai/blog/lfm3},
}
For questions and feedback, join Discord. For custom deployment and fine-tuning support, contact Liquid AI.
内容来源:Hugging Face 模型卡
在 Hugging Face 查看