d1-2B-GGUF
GGUF version of d1-2B for local inference on CPUs and GPUs.
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.
Find architecture and usage details in the original model card.
Use with llama.cpp
llama.cpp answers noul, choice and score questions over a state (text or JSON), pictures or a video. Video input needs ffmpeg in PATH. Multiple choice ("multiple": true), extraction, estimates and boxes are not supported yet.
llama-server -hf LiquidAI/d1-2B-GGUF:Q8_0 -b 8192 -ub 8192
A question is read in one batch, so -b and -ub must hold its state and media. A picture takes at most half of -ub: 8192 keeps the full budget of 4096 tokens per picture, smaller values lower it.
Then send questions to the /v1/systemone endpoint.
Text
curl http://127.0.0.1:8080/v1/systemone -H "Content-Type: application/json" -d '{
"state": "I was charged twice this month, please refund one of them.",
"questions": {
"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", "technical": "App or site faults",
"fraud": "Suspected unauthorised use"}},
"urgency": {"type": "score", "instructions": "How urgent is this?",
"criteria": ["Can wait", "Today", "Blocking the customer now"]}
}
}'
Image + Text
curl -sL -o cats.jpg http://images.cocodataset.org/val2017/000000039769.jpg # two cats on a sofa
curl http://127.0.0.1:8080/v1/systemone -H "Content-Type: application/json" -d @- <<JSON
{
"state": "Photo attached to a pet-sitting request.",
"images": ["data:image/jpeg;base64,$(base64 < cats.jpg | tr -d '\n')"],
"questions": {
"pet": {"type": "choice", "instructions": "Which animals are in the photo?",
"criteria": {"cats": "Cats", "dogs": "Dogs", "birds": "Birds"}},
"sofa": {"type": "noul", "instructions": "Are the animals on a sofa?"}
}
}
JSON
Video + Text
curl -sL -o reading.mp4 https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/4cba700bd771f44d72b549253da025c32e944d42/sample_demo_1.mp4 # a child reading a book
curl http://127.0.0.1:8080/v1/systemone -H "Content-Type: application/json" -d @- <<JSON
{
"state": null,
"files": ["data:video/mp4;base64,$(base64 < reading.mp4 | tr -d '\n')"],
"questions": {
"activity": {"type": "choice", "instructions": "What is the child doing?",
"criteria": {"reading": "Reading a book", "eating": "Eating", "sleeping": "Sleeping"}},
"glasses": {"type": "noul", "instructions": "Is the child wearing glasses?"}
}
}
JSON
The state can be null when the pictures or the video are the whole state.