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
Run this model with HF Jobs
Run OpenTensorLab/d1-3B-W4A16-AutoRound on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/OpenTensorLab/d1-3B-W4A16-AutoRound. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenTensorLab/d1-3B-W4A16-AutoRound on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/OpenTensorLab/d1-3B-W4A16-AutoRound. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenTensorLab/d1-3B-W4A16-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenTensorLab/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="OpenTensorLab/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("OpenTensorLab/d1-3B-W4A16-AutoRound", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("OpenTensorLab/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 OpenTensorLab/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 "OpenTensorLab/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": "OpenTensorLab/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/OpenTensorLab/d1-3B-W4A16-AutoRound
- SGLang
How to use OpenTensorLab/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 "OpenTensorLab/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": "OpenTensorLab/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 "OpenTensorLab/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": "OpenTensorLab/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 OpenTensorLab/d1-3B-W4A16-AutoRound with Docker Model Runner:
docker model run hf.co/OpenTensorLab/d1-3B-W4A16-AutoRound
Vishva R commited on
Create README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128---library_name: transformerslicense: otherlicense_name: lfm1.0license_link: LICENSElanguage:- ar- zh- en- fr- de- hi- id- it- ja- ko- pl- pt- ru- es- th- vipipeline_tag: image-text-to-textbase_model: LiquidAI/LFM2.5-VL-3Btags:- liquid- lfm2.5- edge- decision- classification- calibration- system-one- multimodal- decision-model---
# d1-3B-W4A16-AutoRound
This repository contains a **4-bit W4A16** quantized version of [LiquidAI/d1-3B](https://huggingface.co/LiquidAI/d1-3B), optimized using [AutoRound](https://github.com/intel/auto-round).
`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_round` and AutoGPTQ backends
---
## Quickstart
### Installation
```bashpip install --upgrade "transformers>=5.14" torch torchvision pillow auto-round# Optional for optimized kernels:pip install auto-round-lib
```
### Inference Example
```pythonimport torchfrom transformers import AutoModelfrom 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 modelmodel = AutoModel.from_pretrained( "Vishva007/d1-3B-W4A16-AutoRound", trust_remote_code=True, dtype=dtype, device_map="auto")
# 1. Text Classification / Decisionquestions = { "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 Evaluationimage = 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-choice `choice`, and calibrated scales `score`)* Triage, routing, intent detection, content moderation, agent safety guards* Zero-token generation latency overhead at reduced VRAM footprint
## Acknowledgements
* Base model by [Liquid AI](https://huggingface.co/LiquidAI).* Quantized using Intel's [AutoRound](https://github.com/intel/auto-round).README.mdAdded+128