Zero-Shot Classification
Transformers
Safetensors
qwen3_5
feature-extraction
decision-model
classification
system-one
multimodal
vision
video
custom_code
Eval Results
Instructions to use vllm-sr/d3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vllm-sr/d3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="vllm-sr/d3", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("vllm-sr/d3", trust_remote_code=True) model = AutoModel.from_pretrained("vllm-sr/d3", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Card: add Run with vLLM
Browse files- MODEL_MANIFEST.json +2 -2
- README.md +57 -0
MODEL_MANIFEST.json
CHANGED
|
@@ -592,7 +592,7 @@
|
|
| 592 |
"files_sha256": {
|
| 593 |
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
|
| 594 |
"NOTICE": "61f4ea488e1fed0c3fce97171506a23152c2591116442f78f15827fb9e6af469",
|
| 595 |
-
"README.md": "
|
| 596 |
"assets/banner.png": "eb7ecc949232e1de544247899dd55ee629a36cfe276042d5795f65178b9c64c5",
|
| 597 |
"assets/example-receipt.png": "b9dbb8b103bacd45f1de824d844a3c07b81d57cb1a7466712ef060ad7dcb3926",
|
| 598 |
"assets/example-video.mp4": "f4968ef89d07e97f20df4fd8047510a7a8e9df5c2d07c35e363a97927f164ab9",
|
|
@@ -634,7 +634,7 @@
|
|
| 634 |
"files_bytes": {
|
| 635 |
"LICENSE": 11357,
|
| 636 |
"NOTICE": 100,
|
| 637 |
-
"README.md":
|
| 638 |
"assets/banner.png": 2233137,
|
| 639 |
"assets/example-receipt.png": 65918,
|
| 640 |
"assets/example-video.mp4": 26300,
|
|
|
|
| 592 |
"files_sha256": {
|
| 593 |
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
|
| 594 |
"NOTICE": "61f4ea488e1fed0c3fce97171506a23152c2591116442f78f15827fb9e6af469",
|
| 595 |
+
"README.md": "2642e6e7d6f2e12cdfc2e2dabf2ba5e13c0d40b146ac87c4435482c2b0df42bb",
|
| 596 |
"assets/banner.png": "eb7ecc949232e1de544247899dd55ee629a36cfe276042d5795f65178b9c64c5",
|
| 597 |
"assets/example-receipt.png": "b9dbb8b103bacd45f1de824d844a3c07b81d57cb1a7466712ef060ad7dcb3926",
|
| 598 |
"assets/example-video.mp4": "f4968ef89d07e97f20df4fd8047510a7a8e9df5c2d07c35e363a97927f164ab9",
|
|
|
|
| 634 |
"files_bytes": {
|
| 635 |
"LICENSE": 11357,
|
| 636 |
"NOTICE": 100,
|
| 637 |
+
"README.md": 21724,
|
| 638 |
"assets/banner.png": 2233137,
|
| 639 |
"assets/example-receipt.png": 65918,
|
| 640 |
"assets/example-video.mp4": 26300,
|
README.md
CHANGED
|
@@ -145,6 +145,63 @@ print(json.dumps(result["answers"], indent=2))
|
|
| 145 |
|
| 146 |
Images go before the text of the request, each read at up to 1.6 megapixels; videos follow the images, read at 2 frames per second (at most 32 frames spread over the whole video, each at up to 0.2 megapixels). Every question of the request sees all of them.
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
## Run with vLLM Semantic Router
|
| 149 |
|
| 150 |
[vLLM Semantic Router](https://github.com/vllm-project/semantic-router) serves Decision 3.0 natively in Engine mode, which runs one model behind the System One API on your own machine. Its answers matched this package's own `d3_server.py` exactly, for text, images and videos, with one request per forward, the former default (measured on AMD Instinct MI325X); with batching, now the default, a few near-tie decisions change ([Serving performance](#serving-performance)).
|
|
|
|
| 145 |
|
| 146 |
Images go before the text of the request, each read at up to 1.6 megapixels; videos follow the images, read at 2 frames per second (at most 32 frames spread over the whole video, each at up to 0.2 megapixels). Every question of the request sees all of them.
|
| 147 |
|
| 148 |
+
## Run with vLLM
|
| 149 |
+
|
| 150 |
+
[vLLM](https://github.com/vllm-project/vllm) serves d3 natively: `vllm serve` loads this repository as it is, with no conversion and no extra flags, and answers on vLLM's System One endpoint, `/v1/systemone`. The support is on vLLM's main branch since 2026-10-14 ([vllm-project/vllm#61565](https://github.com/vllm-project/vllm/pull/61565), commit [`89cab55`](https://github.com/vllm-project/vllm/commit/89cab550862e4b7f08d70c19682121362d7dd0c5)), and no vLLM release includes it yet (the latest is v0.31.0). Until one does, install a current nightly build with [uv](https://docs.astral.sh/uv/); vLLM's nightly indexes do not work with plain `pip`:
|
| 151 |
+
|
| 152 |
+
```bash
|
| 153 |
+
uv venv --python 3.12 --seed
|
| 154 |
+
source .venv/bin/activate
|
| 155 |
+
|
| 156 |
+
# NVIDIA GPUs (CUDA)
|
| 157 |
+
uv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly
|
| 158 |
+
|
| 159 |
+
# AMD GPUs (ROCm 7.2; glibc 2.39 or newer, as on Ubuntu 24.04)
|
| 160 |
+
sudo apt install -y libopenmpi3t64 libdw1t64
|
| 161 |
+
export VLLM_ROCM_VARIANT=$(curl -s https://wheels.vllm.ai/rocm/nightly | grep -oP 'rocm\d+' | head -1 | sed 's/%2B/+/g')
|
| 162 |
+
uv pip install --pre vllm --extra-index-url https://wheels.vllm.ai/rocm/nightly/${VLLM_ROCM_VARIANT} --index-strategy unsafe-best-match
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
The ROCm wheels load OpenMPI and libdw at import, hence the `apt` line (Ubuntu 24.04 package names). Start the server; the first start downloads the model. Then ask questions about a request:
|
| 166 |
+
|
| 167 |
+
```bash
|
| 168 |
+
vllm serve vllm-sr/d3
|
| 169 |
+
```
|
| 170 |
+
|
| 171 |
+
```bash
|
| 172 |
+
curl -s localhost:8000/v1/systemone -H 'content-type: application/json' -d '{
|
| 173 |
+
"model": "vllm-sr/d3",
|
| 174 |
+
"state": "Write a Python function that merges two sorted lists.",
|
| 175 |
+
"questions": {
|
| 176 |
+
"kind": {"type": "choice", "instructions": "What kind of work is this?",
|
| 177 |
+
"criteria": {"code": "Writing or fixing code", "math": "Mathematics", "chat": "Anything else"}},
|
| 178 |
+
"reasoning": {"type": "noul", "instructions": "Does answering this need multi-step reasoning?"}
|
| 179 |
+
}
|
| 180 |
+
}'
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
The reply gives each question its pick and each option a probability (d3 on one AMD Instinct MI300X; `id`, `created` and `diagnostics` left out, probabilities rounded):
|
| 184 |
+
|
| 185 |
+
```json
|
| 186 |
+
{
|
| 187 |
+
"object": "structured_decision",
|
| 188 |
+
"model": "vllm-sr/d3",
|
| 189 |
+
"answers": {
|
| 190 |
+
"kind": {"type": "choice", "choice": "code", "probabilities": {"code": 0.9996, "math": 0.0002, "chat": 0.0002}, "confidence": 0.9996},
|
| 191 |
+
"reasoning": {"type": "noul", "noul": 0.5808, "probabilities": {"yes": 0.5808, "no": 0.4192}, "confidence": 0.5808}
|
| 192 |
+
},
|
| 193 |
+
"usage": {"input_tokens": 213, "output_tokens": 0}
|
| 194 |
+
}
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
The probabilities are this package's, as `model.system_one()` gives them, and `confidence` is the chosen option's probability; a yes / no answer's `noul` is the probability of yes. The image and video requests of the next section work unchanged on port 8000: vLLM places the media before the text and reads them with this package's budgets. A top-level `instructions` field returns 400, since the prompt is fixed. vLLM reserves 92 % of the GPU's memory by default; lower `--gpu-memory-utilization` to share the GPU.
|
| 198 |
+
|
| 199 |
+
**Verified on AMD Instinct MI300X (ROCm).** These commands were run as written in a new Ubuntu 24.04 environment with ROCm 7.2 and the ROCm nightly of 2026-10-15 (`0.32.0rc1.dev190+g3f1bcfd82`). Against this package's runtime (AutoModel with the versions in `requirements.txt`), vLLM made the same decisions on the request above and on the image and video requests of the next section, and on 415 of 416 further questions (text, JSON, a 40-option choice, an image and a video); the other one is a near-tie whose two most likely answers are 0.002 apart. The median probability difference was 0.0025. The CUDA command installs a nightly that includes d3, but it has not been run on an NVIDIA GPU yet.
|
| 200 |
+
|
| 201 |
+
In the measurements of the vLLM pull request, on one AMD Instinct MI325X, vLLM changed none of the 416 decisions and served 1.4× and 1.8× the requests per second of this package's own server (`d3_server.py`) at 8 and 64 concurrent clients; one request at a time it was 3 % slower. It starts more slowly than AutoModel: 215 s to the first answer with empty caches, against 40 s; `--max-model-len 32768` brings that to 139 s.
|
| 202 |
+
|
| 203 |
+
Request fields and limits: [Decision 3.0 in the vLLM docs](https://docs.vllm.ai/en/latest/models/structured_decisions_models/#decision-30).
|
| 204 |
+
|
| 205 |
## Run with vLLM Semantic Router
|
| 206 |
|
| 207 |
[vLLM Semantic Router](https://github.com/vllm-project/semantic-router) serves Decision 3.0 natively in Engine mode, which runs one model behind the System One API on your own machine. Its answers matched this package's own `d3_server.py` exactly, for text, images and videos, with one request per forward, the former default (measured on AMD Instinct MI325X); with batching, now the default, a few near-tie decisions change ([Serving performance](#serving-performance)).
|