Image-Text-to-Text
Transformers
Safetensors
lfm2_vl
liquid
lfm2.5
edge
decision
classification
calibration
system-one
multimodal
decision-model
conversational
custom_code
Eval Results
Instructions to use LiquidAI/d1-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/d1-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LiquidAI/d1-3B", 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("LiquidAI/d1-3B", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("LiquidAI/d1-3B", trust_remote_code=True, device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/d1-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/d1-3B" # 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-3B", "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-3B
- SGLang
How to use LiquidAI/d1-3B 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-3B" \ --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-3B", "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-3B" \ --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-3B", "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-3B with Docker Model Runner:
docker model run hf.co/LiquidAI/d1-3B
Update weights and benchmark numbers
#4
by Aurelien-Lac - opened
- README.md +50 -64
- assets/d1-3b-smash.mp4 +3 -0
- assets/di_pareto.png +3 -0
- assets/ood_tasks.mp4 +3 -0
README.md
CHANGED
|
@@ -31,7 +31,6 @@ tags:
|
|
| 31 |
- calibration
|
| 32 |
- system-one
|
| 33 |
- multimodal
|
| 34 |
-
- decision-model
|
| 35 |
---
|
| 36 |
|
| 37 |
<div align="center">
|
|
@@ -50,18 +49,19 @@ tags:
|
|
| 50 |
# d1-3B
|
| 51 |
|
| 52 |
d1-3B is a 3B parameter **decision model** built on [LFM2.5-VL-3B](https://huggingface.co/LiquidAI/LFM2.5-VL-3B).
|
| 53 |
-
You give it a state (text, JSON, images, or a mix) and a set of questions. It returns calibrated,
|
| 54 |
-
typed answers in **one forward pass with zero output tokens**
|
|
|
|
| 55 |
|
| 56 |
-
- **Best decision model under 10B on the Decision Index 0.2.1**: 48.57, ahead
|
| 57 |
-
and of Decider 35B-A3B (47.11).
|
| 58 |
- **Multimodal**: images and text in the same state. It scores 74.1 on 11 public image benchmarks
|
| 59 |
(LFM2.5-VL-3B: 73.9).
|
| 60 |
- **Fast**: 8 ms a decision on an NVIDIA RTX 4090, 9 ms on an AMD MI325X, 30 ms on an Apple M5 Pro.
|
| 61 |
|
| 62 |
-
Find more information about open d1 in our [blog post](
|
| 63 |
|
| 64 |
-
 else "mps" if torch.backends.mps.is_available() else "cpu"
|
| 105 |
-
|
| 106 |
-
|
| 107 |
|
| 108 |
-
#
|
| 109 |
questions = {
|
| 110 |
-
"refund": {
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
"
|
| 115 |
-
|
| 116 |
-
"instructions": "Which team should handle this?",
|
| 117 |
-
"criteria": {
|
| 118 |
-
"billing": "Charges, refunds, invoices",
|
| 119 |
-
"technical": "App or site faults",
|
| 120 |
-
"fraud": "Suspected unauthorised use",
|
| 121 |
-
},
|
| 122 |
-
},
|
| 123 |
-
"urgency": {
|
| 124 |
-
"type": "score",
|
| 125 |
-
"instructions": "How urgent is this?",
|
| 126 |
-
"criteria": ["Can wait", "Today", "Blocking the customer now"],
|
| 127 |
-
},
|
| 128 |
}
|
| 129 |
print(model.system_one("I was charged twice this month, please refund one of them.", questions))
|
| 130 |
|
| 131 |
-
#
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
}
|
| 138 |
-
print(model.system_one(None, {"cats": cats}, images=[image]))
|
| 139 |
|
| 140 |
-
#
|
| 141 |
tickets = ["Where is my parcel? It was due Monday.", "The app crashes when I open settings."]
|
| 142 |
print(model.system_one_batch([(t, {"team": questions["team"]}) for t in tickets]))
|
| 143 |
```
|
|
@@ -163,32 +154,16 @@ Each call returns `{"answers": {name: answer}, "usage": {"input_tokens": n, "out
|
|
| 163 |
|
| 164 |
## ⚡ Speed
|
| 165 |
|
| 166 |
-
Warm calls
|
| 167 |
-
state and a 384 px image. The last column is throughput with 64 states packed into one pass.
|
| 168 |
-
|
| 169 |
-
### Edge Inference
|
| 170 |
-
|
| 171 |
-
We measure latency on an Apple M5 Pro and, in collaboration with NVIDIA, on an NVIDIA Jetson AGX Thor,
|
| 172 |
-
a Jetson AGX Orin 64 GB and a Jetson Orin Nano.
|
| 173 |
-
|
| 174 |
-
| | one question | 3 questions, one pass | 3.4k-token state | 384 px image | 64 states, packed |
|
| 175 |
-
|---|---:|---:|---:|---:|---:|
|
| 176 |
-
| Apple M5 Pro (`mps`) | 30 ms | 41 ms | 640 ms | 62 ms | 78 / s |
|
| 177 |
-
| NVIDIA Jetson AGX Thor | 16 ms | 20 ms | 220 ms | 35 ms | 262 / s |
|
| 178 |
-
| NVIDIA Jetson AGX Orin 64 GB | 26 ms | 35 ms | 560 ms | 83 ms | 110 / s |
|
| 179 |
-
| NVIDIA Jetson Orin Nano | 50 ms | 73 ms | 1640 ms | 202 ms | 38 / s |
|
| 180 |
-
|
| 181 |
-
### GPU Inference
|
| 182 |
-
|
| 183 |
-
We measure latency on an NVIDIA RTX 4090 and an AMD MI325X, in bf16, median of 20 runs.
|
| 184 |
|
| 185 |
| | one question | 3 questions, one pass | 3.4k-token state | 384 px image | 64 states, packed |
|
| 186 |
|---|---:|---:|---:|---:|---:|
|
| 187 |
-
| NVIDIA RTX 4090 | 8 ms | 21 ms | 102 ms | 17 ms | 475 / s |
|
| 188 |
-
| AMD MI325X | 9 ms | 14 ms | 44 ms | 18 ms | 1,106 / s |
|
|
|
|
| 189 |
|
| 190 |
-
On NVIDIA GPUs, `model.compile(mode="reduce-overhead")` runs single questions as CUDA graphs
|
| 191 |
-
row uses it
|
| 192 |
selection or compilation, so warm up the shapes you serve.
|
| 193 |
|
| 194 |
## 📊 Performance
|
|
@@ -197,7 +172,10 @@ All results are on public benchmarks.
|
|
| 197 |
|
| 198 |
### Decision Index 0.2.1
|
| 199 |
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
| Model | Size | Decision Index | Knowledge | Language | Retrieval | Tools | Arts |
|
| 203 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
|
@@ -214,7 +192,8 @@ We scored d1-3B with the official scorer (not a leaderboard submission). All oth
|
|
| 214 |
|
| 215 |
### Benchmarks as decisions
|
| 216 |
|
| 217 |
-
|
|
|
|
| 218 |
|
| 219 |
| Benchmark | d1-3B | Decider 4B | Decider 2B |
|
| 220 |
|---|---:|---:|---:|
|
|
@@ -255,6 +234,13 @@ compared with the base model:
|
|
| 255 |
|
| 256 |
With the images removed, the same questions score 45.1, so the answers come from the images.
|
| 257 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
## 📬 Contact
|
| 259 |
|
| 260 |
- Got questions or want to connect? [Join our Discord community](https://discord.com/invite/liquid-ai)
|
|
@@ -268,7 +254,7 @@ With the images removed, the same questions score 45.1, so the answers come from
|
|
| 268 |
title = {Open d1: Edge decision models for text, vision, and audio},
|
| 269 |
journal = {Liquid AI Blog},
|
| 270 |
year = {2026},
|
| 271 |
-
note = {
|
| 272 |
}
|
| 273 |
```
|
| 274 |
|
|
@@ -279,4 +265,4 @@ With the images removed, the same questions score 45.1, so the answers come from
|
|
| 279 |
journal = {arXiv preprint arXiv:2511.23404},
|
| 280 |
year = {2025}
|
| 281 |
}
|
| 282 |
-
```
|
|
|
|
| 31 |
- calibration
|
| 32 |
- system-one
|
| 33 |
- multimodal
|
|
|
|
| 34 |
---
|
| 35 |
|
| 36 |
<div align="center">
|
|
|
|
| 49 |
# d1-3B
|
| 50 |
|
| 51 |
d1-3B is a 3B parameter **decision model** built on [LFM2.5-VL-3B](https://huggingface.co/LiquidAI/LFM2.5-VL-3B).
|
| 52 |
+
You give it a state (text, JSON, images, or a mix) and a set of named questions. It returns calibrated,
|
| 53 |
+
typed answers in **one forward pass with zero output tokens**: every answer is read directly from the
|
| 54 |
+
model's distribution over the options, with no generation and no parsing.
|
| 55 |
|
| 56 |
+
- **Best decision model under 10B on the Decision Index 0.2.1** (leaderboard of 2026-09-28): 48.57, ahead
|
| 57 |
+
of every 4B and 9B model and of Decider 35B-A3B (47.11).
|
| 58 |
- **Multimodal**: images and text in the same state. It scores 74.1 on 11 public image benchmarks
|
| 59 |
(LFM2.5-VL-3B: 73.9).
|
| 60 |
- **Fast**: 8 ms a decision on an NVIDIA RTX 4090, 9 ms on an AMD MI325X, 30 ms on an Apple M5 Pro.
|
| 61 |
|
| 62 |
+
Find more information about open d1 in our [blog post](www.liquid.ai/blog/open-d1).
|
| 63 |
|
| 64 |
+

|
| 65 |
|
| 66 |
> [!NOTE]
|
| 67 |
> 💻 **Demos**: Try d1-3B in a Hugging Face space without any setup:
|
|
|
|
| 78 |
d1-3B is a multimodal decision model with the following features:
|
| 79 |
|
| 80 |
- **Total parameters**: 3.12B
|
| 81 |
+
- **LM backbone**: LFM2.5-2.6B, 30 layers (22 double-gated short convolution blocks + 8 GQA)
|
| 82 |
- **Vision encoder**: SigLIP2 NaFlex shape-optimized 400M
|
| 83 |
- **Context length**: 32,768 tokens
|
| 84 |
- **Vocabulary size**: 128,000
|
| 85 |
+
- **Output**: no generated tokens. Each answer is a probability distribution over the question's options.
|
| 86 |
|
| 87 |
We recommend d1-3B wherever a pipeline needs a yes/no, a pick from named options, or a rating:
|
| 88 |
routing and triage, moderation, intent and topic classification, extraction checks, reranking, LLM-as-a-judge
|
|
|
|
| 99 |
The model ships its own code, so load it with `trust_remote_code=True`:
|
| 100 |
|
| 101 |
```python
|
| 102 |
+
import io
|
| 103 |
+
import urllib.request
|
| 104 |
+
|
| 105 |
import torch
|
| 106 |
+
from PIL import Image
|
| 107 |
from transformers import AutoModel
|
|
|
|
| 108 |
|
| 109 |
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
|
| 110 |
+
model = AutoModel.from_pretrained("LiquidAI/d1-3B", trust_remote_code=True,
|
| 111 |
+
dtype=torch.float32 if device == "cpu" else torch.bfloat16).to(device)
|
| 112 |
|
| 113 |
+
# Several named questions over one text state, answered in one pass
|
| 114 |
questions = {
|
| 115 |
+
"refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"},
|
| 116 |
+
"team": {"type": "choice", "instructions": "Which team should handle this?",
|
| 117 |
+
"criteria": {"billing": "Charges, refunds, invoices", "technical": "App or site faults",
|
| 118 |
+
"fraud": "Suspected unauthorised use"}},
|
| 119 |
+
"urgency": {"type": "score", "instructions": "How urgent is this?",
|
| 120 |
+
"criteria": ["Can wait", "Today", "Blocking the customer now"]},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
}
|
| 122 |
print(model.system_one("I was charged twice this month, please refund one of them.", questions))
|
| 123 |
|
| 124 |
+
# An image as the whole state
|
| 125 |
+
url = "http://images.cocodataset.org/val2017/000000039769.jpg" # two cats on a sofa
|
| 126 |
+
photo = Image.open(io.BytesIO(urllib.request.urlopen(url).read()))
|
| 127 |
+
print(model.system_one(None, {"cats": {"type": "choice", "instructions": "How many cats are there?",
|
| 128 |
+
"criteria": {"one": "One", "two": "Two", "more": "Three or more"}}},
|
| 129 |
+
images=[photo]))
|
|
|
|
|
|
|
| 130 |
|
| 131 |
+
# Many requests, packed together with no padding
|
| 132 |
tickets = ["Where is my parcel? It was due Monday.", "The app crashes when I open settings."]
|
| 133 |
print(model.system_one_batch([(t, {"team": questions["team"]}) for t in tickets]))
|
| 134 |
```
|
|
|
|
| 154 |
|
| 155 |
## ⚡ Speed
|
| 156 |
|
| 157 |
+
Warm calls in bf16, median of 20 runs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
| | one question | 3 questions, one pass | 3.4k-token state | 384 px image | 64 states, packed |
|
| 160 |
|---|---:|---:|---:|---:|---:|
|
| 161 |
+
| NVIDIA RTX 4090 | **8.0 ms** | 21 ms | 102 ms | 17 ms | 475 / s |
|
| 162 |
+
| AMD MI325X | 9.2 ms | 14 ms | 44 ms | 18 ms | 1,106 / s |
|
| 163 |
+
| Apple M5 Pro (`mps`) | 30 ms | 41 ms | 0.64 s | 62 ms | 78 / s |
|
| 164 |
|
| 165 |
+
On NVIDIA GPUs, `model.compile(mode="reduce-overhead")` runs single questions as CUDA graphs. The RTX 4090
|
| 166 |
+
row uses it; without it a single question takes 16 ms. The first call with a new shape pays for kernel
|
| 167 |
selection or compilation, so warm up the shapes you serve.
|
| 168 |
|
| 169 |
## 📊 Performance
|
|
|
|
| 172 |
|
| 173 |
### Decision Index 0.2.1
|
| 174 |
|
| 175 |
+
The [Decision Index](https://huggingface.co/spaces/multimodalart/jev-decision-index) casts 38 public
|
| 176 |
+
benchmarks as 120,226 typed decisions, scored as chance-corrected skill. We scored d1-3B with the official
|
| 177 |
+
scorer; it is not a leaderboard submission. All other rows come from the public leaderboard
|
| 178 |
+
(snapshot 2026-09-28). Sizes are served parameters.
|
| 179 |
|
| 180 |
| Model | Size | Decision Index | Knowledge | Language | Retrieval | Tools | Arts |
|
| 181 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
|
|
|
| 192 |
|
| 193 |
### Benchmarks as decisions
|
| 194 |
|
| 195 |
+
Evaluation splits are cast as typed decisions, with the same rows for every model. These scores follow the
|
| 196 |
+
decision protocol, not each benchmark's own.
|
| 197 |
|
| 198 |
| Benchmark | d1-3B | Decider 4B | Decider 2B |
|
| 199 |
|---|---:|---:|---:|
|
|
|
|
| 234 |
|
| 235 |
With the images removed, the same questions score 45.1, so the answers come from the images.
|
| 236 |
|
| 237 |
+
## ⚠️ Limitations
|
| 238 |
+
|
| 239 |
+
- **Knowledge-heavy questions**: larger models stay ahead on hard knowledge (for example MMLU-Pro and GPQA).
|
| 240 |
+
- **Thresholds**: calibrate any threshold on data from your own deployment before gating on it.
|
| 241 |
+
- **No text output**: d1-3B answers questions over fixed options. Use [LFM2.5-VL-3B](https://huggingface.co/LiquidAI/LFM2.5-VL-3B)
|
| 242 |
+
for open-ended generation.
|
| 243 |
+
|
| 244 |
## 📬 Contact
|
| 245 |
|
| 246 |
- Got questions or want to connect? [Join our Discord community](https://discord.com/invite/liquid-ai)
|
|
|
|
| 254 |
title = {Open d1: Edge decision models for text, vision, and audio},
|
| 255 |
journal = {Liquid AI Blog},
|
| 256 |
year = {2026},
|
| 257 |
+
note = {www.liquid.ai/blog/open-d1},
|
| 258 |
}
|
| 259 |
```
|
| 260 |
|
|
|
|
| 265 |
journal = {arXiv preprint arXiv:2511.23404},
|
| 266 |
year = {2025}
|
| 267 |
}
|
| 268 |
+
```
|
assets/d1-3b-smash.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08f69b1a67bf32cd18fad32b5872519b580be9e94bafbe26a13d5cf0aaa49c1f
|
| 3 |
+
size 53062187
|
assets/di_pareto.png
ADDED
|
Git LFS Details
|
assets/ood_tasks.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b491dfa851157e12ba2bee33a394c9565408247cf0004e493730622c62878e42
|
| 3 |
+
size 8931625
|