Instructions to use LiquidAI/d1-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/d1-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LiquidAI/d1-2B", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LiquidAI/d1-2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/d1-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/d1-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/d1-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/LiquidAI/d1-2B
- SGLang
How to use LiquidAI/d1-2B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LiquidAI/d1-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/d1-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LiquidAI/d1-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/d1-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use LiquidAI/d1-2B with Docker Model Runner:
docker model run hf.co/LiquidAI/d1-2B
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.
| Property | Specification |
|---|---|
| Checkpoint | Post-trained decision model, built on LFM3-VL-2B |
| Parameters | 1.92B |
| Architecture | LFM3 backbone, 24 layers: 13 gated short convolutions, 5 sliding-window attention, 6 global attention |
| Context length | 128K tokens |
| Vocabulary | 128,000 tokens |
| Input | A state (text or JSON), pictures or a video, and any number of named questions |
| Output | Typed answers with their probabilities, with no generated tokens |
| Languages | English, Arabic, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish, Vietnamese, Thai, Indonesian, Hindi, Russian, Polish |
| License | LFM Open License v1.0 |
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
Values from a document
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
Pictures and boxes
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}
Many requests in one call
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
Calls
| Call | What it does |
|---|---|
system_one(state, questions, media=None) |
Named questions over one state, in one pass. media lists pictures (PIL images or {"type": "image", "path": ...}) and videos as their frames ({"type": "video", "video": [PIL images], "fps": 24}). |
system_one_batch([(state, questions[, media]), ...]) |
Many requests in one call, batched. |
set_size= (either call) |
Questions read together after the state. The default is the model's trained size (16). Larger is faster and costs some accuracy on text. |
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}}.
Question types
type |
Question | Answer |
|---|---|---|
noul |
Yes or no | noul: P(yes) |
choice |
One of the options criteria names ({name: description}) |
choice, confidence, probabilities |
choice with multiple: true |
Any of the options criteria names |
choices, probabilities (each option's own P(yes)) |
score |
One of 2 to 10 ordered levels, with criteria listing them lowest first |
score (the median level), confidence, probabilities, legend |
text, number, date |
A value to read from the state | The field of its type (a number with its unit, a date in ISO 8601), span, found |
number with range |
An estimate, step apart |
number (the median), interval (p10, p90) |
box, boxes |
One object, or every instance (16 at most, or max), in the one picture |
box (top, bottom, left, right as fractions of the picture), found, confidence, or boxes and count |
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.
| Benchmark | d1 2B |
d1-omni 600M |
d1-Omni 2B |
d1 3B |
|---|---|---|---|---|
| Decisions | ||||
| Decision Index public suite (v0.3) | 51.1 | 18.3 | 49.0 | 49.0 |
| DecisionBench (Hanno Labs) v1 | 77.1 | 58.7 | 76.4 | 73.1 |
| Decision Bench (decisionbench.ai) v4 | 85.2 | 57.9 | 84.7 | 83.6 |
| Fast Decisions | 58.8 | – | 56.8 | 59.3 |
| JevBench v1.4.1 | 77.9 | 58.0 | 75.3 | 76.2 |
| ImajevBench v2.0-lite | 75.5 | 21.7 | 72.3 | 64.0 |
| WorkflowEvals | 81.6 | 48.8 | 77.1 | 74.4 |
| Typed Decisions | 61.3 | 57.5 | 63.1 | 65.0 |
| Our board (over a hundred public and private benchmarks) | 63.2 | – | 61.8 | 58.8 |
| Vision | ||||
| AI2D | 76.7 | 37.1 | 71.5 | 79.9 |
| BLINK | 66.2 | 37.7 | 63.5 | 59.2 |
| CountQA | 51.4 | 26.8 | 45.4 | 42.6 |
| CV-Bench | 86.1 | 40.8 | 84.0 | 82.1 |
| ERQA | 45.8 | 27.3 | 42.5 | 39.8 |
| HallusionBench | 72.1 | 52.6 | 67.5 | 65.3 |
| MMBench | 87.9 | 54.2 | 85.2 | 84.9 |
| MME | 85.4 | 61.0 | 83.9 | 82.1 |
| MMMU-Pro | 26.4 | 11.9 | 24.1 | 18.5 |
| MMRB2 | 54.2 | 48.3 | 52.6 | 49.5 |
| MMStar | 67.5 | 31.9 | 61.3 | 59.9 |
| MMVP | 82.7 | 54.0 | 81.3 | 77.0 |
| NaturalBench | 81.5 | 58.8 | 80.0 | 79.8 |
| POPE | 88.7 | 82.7 | 89.9 | 88.6 |
| V* | 76.4 | 35.6 | 76.4 | 73.8 |
| VisualPuzzles | 29.9 | 26.2 | 26.9 | 29.5 |
| VisualWebBench | 96.2 | 14.9 | 88.6 | 71.4 |
| VL-RewardBench | 69.3 | 48.1 | 68.8 | 65.0 |
| Average | 70.2 | 42.8 | 67.7 | 65.4 |
Evaluation details
All four models are scored on the same items with the same scoring, so a few of d1-3B's and d1-omni-600M's numbers differ slightly from their own cards. d1-omni-600M has no Fast Decisions or board score. Average is the unweighted mean of the public benchmarks that all four models have, so it leaves out Fast Decisions and our board. Image benchmarks are read as decisions over each benchmark's options, on at most 1,000 rows each. Three of them are saturated: POPE, MME, and VisualWebBench.
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.
| Hardware | One question | 3 questions | 5K-token state | 384 px picture | Box | Boxes | 64 states in one call |
|---|---|---|---|---|---|---|---|
| NVIDIA H100 PCIe | 5.7 ms | 7.6 ms | 52 ms | 12.3 ms | 16.1 ms | 24.4 ms | 1,132 / s |
| AMD MI325X | 3.8 ms | 5.6 ms | 44 ms | 8.7 ms | 11.2 ms | 16.5 ms | 1,699 / s |
Apple M5 Pro (mps) |
18.6 ms | 26.5 ms | 753 ms | 45.2 ms | 53.5 ms | 100 ms | 109 / s |
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.
- Downloads last month
- 44
docker model run hf.co/LiquidAI/d1-2B