Image-Text-to-Text
Transformers
Safetensors
lfm2_vl
liquid
lfm2.5
edge
decision
classification
calibration
system-one
multimodal
decision-model
conversational
custom_code
4-bit precision
auto-round
Instructions to use Vishva007/d1-3B-W4A16-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vishva007/d1-3B-W4A16-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Vishva007/d1-3B-W4A16-AutoRound", 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("Vishva007/d1-3B-W4A16-AutoRound", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("Vishva007/d1-3B-W4A16-AutoRound", 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 Vishva007/d1-3B-W4A16-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vishva007/d1-3B-W4A16-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vishva007/d1-3B-W4A16-AutoRound", "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/Vishva007/d1-3B-W4A16-AutoRound
- SGLang
How to use Vishva007/d1-3B-W4A16-AutoRound 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 "Vishva007/d1-3B-W4A16-AutoRound" \ --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": "Vishva007/d1-3B-W4A16-AutoRound", "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 "Vishva007/d1-3B-W4A16-AutoRound" \ --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": "Vishva007/d1-3B-W4A16-AutoRound", "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 Vishva007/d1-3B-W4A16-AutoRound with Docker Model Runner:
docker model run hf.co/Vishva007/d1-3B-W4A16-AutoRound
d1-3B-W4A16-AutoRound
This repository contains a 4-bit W4A16 quantized version of LiquidAI/d1-3B, optimized using AutoRound.
d1-3B is a multimodal decision model built on LFM2.5-VL-3B. It evaluates states (text, images, or JSON) against typed questions in a single forward pass with zero autoregressive output tokens.
Quantization Details
- Method: AutoRound (
W4A16) - Group Size: 32 (
group_size=32,sym=True) - Calibration: 512 samples, 800 tuning iterations, sequence length 2048
- Vision Tower: Retained in unquantized precision (
quant_nontext_module=False) to preserve full visual feature fidelity - Format: Compatible with
auto_roundand AutoGPTQ backends
Quickstart
Installation
pip install --upgrade "transformers>=5.14" torch torchvision pillow auto-round
# Optional for optimized kernels:
pip install auto-round-lib
Inference Example
import torch
from transformers import AutoModel
from transformers.image_utils import load_image
device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
# Load quantized model
model = AutoModel.from_pretrained(
"Vishva007/d1-3B-W4A16-AutoRound",
trust_remote_code=True,
dtype=dtype,
device_map="auto"
)
# 1. Text Classification / Decision
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",
},
},
}
prompt = "I was charged twice this month, please refund one of them."
res_text = model.system_one(prompt, questions)
print("Text Decision:", res_text)
# 2. Multimodal / Image Evaluation
image = load_image("[http://images.cocodataset.org/val2017/000000039769.jpg](http://images.cocodataset.org/val2017/000000039769.jpg)")
cats_q = {
"type": "choice",
"instructions": "How many cats are there?",
"criteria": {"one": "One", "two": "Two", "more": "Three or more"},
}
res_image = model.system_one(None, {"cats": cats_q}, images=[image])
print("Vision Decision:", res_image)
Intended Use
- Single-pass decision classification (Yes/No
noul, multi-choicechoice, and calibrated scalesscore) - Triage, routing, intent detection, content moderation, agent safety guards
- Zero-token generation latency overhead at reduced VRAM footprint
🚀 Deploy on RunPod
One-click launch environments pre-configured with PyTorch, CUDA, and dependencies for fine-tuning or quantization.
🎁 Need GPU compute? Sign up via RunPod and get $5–$500 in free credits when you add your first $10.
PyTorch 2.14
PyTorch 2.13
PyTorch 2.12
Acknowledgements
- Downloads last month
- -
Model tree for Vishva007/d1-3B-W4A16-AutoRound
Collection including Vishva007/d1-3B-W4A16-AutoRound
Collection
Quantized LiquidAI's d1-3B models for efficient image-text decision models (AutoRound W4A16) • 1 item • Updated