10.5K Downloads Updated 3 hours ago
ollama run d1:3b-q8_0
d1 is a 3B decision model from Liquid AI, built on LFM2.5-VL-3B. Give it a state (text, JSON, images, or a mix) and a set of typed questions, and it returns a calibrated probability for every answer in a single forward pass. It isn’t a chat model and doesn’t generate text.
It’s compatible with the Jev and System One APIs, so it works through Ollama’s /v1/systemone endpoint and ollama run --ask.
ollama pull d1
| Task | You define | You get back |
|---|---|---|
| Route or triage a request | The destinations and when each applies | The chosen destination and each destination’s probability |
| Moderate content | A policy as a yes or no question | True or false, and the probability of each |
| Judge an answer | A rubric of levels | The probability-weighted level and each level’s probability |
| Inspect an image | Questions about what’s in the frame | Typed answers with probabilities |
| Gate an agent step | A condition and the agent’s proposed action | Go or no-go, with the probability of each |
ollama run d1 --ask "Is a refund being requested?" < ticket.txt
ollama run d1 --ask "Which team should handle this?" \
--choice billing="Payments and refunds" \
--choice technical="Outages and errors" < ticket.txt
ollama run d1 --ask "How urgent is this?" \
--level "Routine" \
--level "Soon" \
--level "Immediate" < ticket.txt
The state can also follow the model name instead of coming from stdin.
Decision models use Ollama’s /v1/systemone endpoint, documented here. Put the text you want judged in state and your questions in questions. Ollama builds d1’s prompt for you.
| Field | Description |
|---|---|
model |
d1 |
state |
The text to judge. Use a string, or a JSON object or array for structured input. |
images |
Optional. Base64-encoded PNG, JPEG, or WebP images shared by all questions, in request order. |
questions |
1 to 64 named questions. Answers come back in the same order. |
keep_alive |
Optional. How long the model stays loaded after the request. |
Every question has a type, instructions, and usually criteria:
| Type | criteria |
Answer fields |
|---|---|---|
choice |
An object mapping each option to a description. Use null to let the option name describe itself. |
choice, probabilities, confidence |
noul |
Optional. {"true": "...", "false": "..."} to describe each side. |
noul, the probability that the answer is true |
score |
An array of 2 to 10 level descriptions, lowest first. Levels are numbered from 0. | score (the probability-weighted level), legend, probabilities, confidence |
confidence runs from 0 to 1 and shows how strongly the probabilities favor one answer. It isn’t the chance that the answer is right.
curl http://localhost:11434/v1/systemone -d '{
"model": "d1",
"state": "Our app crashes on launch for every user since this morning'\''s update. Please fix it now.",
"questions": {
"urgent": {"type": "noul", "instructions": "Is this support request urgent?"},
"team": {
"type": "choice",
"instructions": "Which team should handle this request?",
"criteria": {
"billing": "Payments, invoices, and refunds",
"technical": "Outages, errors, and configuration",
"sales": "Plans and upgrades"
}
},
"severity": {
"type": "score",
"instructions": "How severe is the customer impact?",
"criteria": ["No impact", "Minor", "Major", "Critical"]
}
}
}'
Response:
{
"model": "d1",
"answers": {
"urgent": {"type": "noul", "noul": 0.981},
"team": {
"type": "choice",
"choice": "technical",
"probabilities": {"billing": 0.012, "technical": 0.973, "sales": 0.015},
"confidence": 0.96
},
"severity": {
"type": "score",
"score": 2.582,
"legend": {"0": "No impact", "1": "Minor", "2": "Major", "3": "Critical"},
"probabilities": {"0": 0.015, "1": 0.012, "2": 0.35, "3": 0.623},
"confidence": 0.582
}
},
"usage": {"input_tokens": 175, "output_tokens": 0}
}
Use TypeSafe’s official Python SDK and point it at Ollama. The SDK requires an API key, but Ollama ignores it, so any value works.
pip install typesafe-sdk
export TYPESAFE_BASE_URL=http://localhost:11434
export TYPESAFE_API_KEY=ollama
export TYPESAFE_DEFAULT_MODEL=d1
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient
questions = {
"urgent": Noul(instructions="Is this support request urgent?"),
"team": Choice(
instructions="Which team should handle this request?",
criteria={"billing": "Payments, invoices, and refunds", "technical": "Outages, errors, and configuration", "sales": "Plans and upgrades"},
),
"severity": Score(instructions="How severe is the customer impact?", criteria=["No impact", "Minor", "Major", "Critical"]),
}
with TypeSafeClient(timeout=120) as client:
result = client.system_one(state="Our app crashes on launch for every user since this morning's update. Please fix it now.", questions=questions)
print(result.choices["team"].choice) # technical
Images are shared by all questions:
curl http://localhost:11434/v1/systemone -d '{
"model": "d1",
"state": "Photo from the returns desk.",
"images": ["<base64-encoded image>"],
"questions": {
"damaged": {"type": "noul", "instructions": "Is the product visibly damaged?"},
"item": {
"type": "choice",
"instructions": "What is in the photo?",
"criteria": {"shoes": null, "electronics": null, "clothing": null, "other": null}
}
}
}'
Results reported by Liquid AI. See the model card and blog post for details.
| d1 | Comparison | |
|---|---|---|
| Decision Index 0.2.1 | 48.57 | Decider 35B-A3B: 47.11 |
| 11 public image benchmarks (average) | 74.1 | LFM2.5-VL-3B base: 73.9 |