Domino
Collection
Domino: Decoupling Causal Modeling from Autoregressive Drafting in
Speculative Decoding • 4 items • Updated • 3
How to use Huang2020/Qwen3-4B-Domino-b16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Huang2020/Qwen3-4B-Domino-b16", trust_remote_code=True) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("Huang2020/Qwen3-4B-Domino-b16", trust_remote_code=True)
model = AutoModel.from_pretrained("Huang2020/Qwen3-4B-Domino-b16", trust_remote_code=True, device_map="auto")How to use Huang2020/Qwen3-4B-Domino-b16 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Huang2020/Qwen3-4B-Domino-b16"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Huang2020/Qwen3-4B-Domino-b16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Huang2020/Qwen3-4B-Domino-b16
How to use Huang2020/Qwen3-4B-Domino-b16 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Huang2020/Qwen3-4B-Domino-b16" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Huang2020/Qwen3-4B-Domino-b16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Huang2020/Qwen3-4B-Domino-b16" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Huang2020/Qwen3-4B-Domino-b16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Huang2020/Qwen3-4B-Domino-b16 with Docker Model Runner:
docker model run hf.co/Huang2020/Qwen3-4B-Domino-b16
This repository contains a Domino/DFlash draft model for speculative decoding with Qwen/Qwen3-4B. The draft model is not intended to be used as a standalone language model; it should be paired with the target model during generation.
Domino keeps draft generation block-parallel while adding a lightweight causal correction head. This preserves the low drafting cost of parallel speculative decoding and improves draft-token acceptance.
Qwen/Qwen3-4BHuang2020/Qwen3-4B-Domino-b1616spec_generate pathuv pip install "git+https://github.com/jianuo-huang/sglang.git@feat/domino-tensor-parallel#subdirectory=python"
sglang serve \
--model-path Qwen/Qwen3-4B \
--speculative-algorithm DFLASH \
--speculative-draft-model-path Huang2020/Qwen3-4B-Domino-b16
from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer
draft = AutoModel.from_pretrained(
"Huang2020/Qwen3-4B-Domino-b16",
trust_remote_code=True,
torch_dtype="auto",
device_map="cuda:0",
).eval()
target = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-4B",
torch_dtype="auto",
device_map="cuda:0",
).eval()
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B")
messages = [{
"role": "user",
"content": "How many positive whole-number divisors does 196 have?",
}]
input_ids = tokenizer.apply_chat_template(
messages,
return_tensors="pt",
return_dict=False,
add_generation_prompt=True,
enable_thinking=False,
).to(draft.device)
output = draft.spec_generate(
input_ids=input_ids,
target=target,
max_new_tokens=2048,
temperature=0.0,
stop_token_ids=[tokenizer.eos_token_id],
)
generated = output[:, input_ids.shape[1]:]
print(tokenizer.decode(generated[0], skip_special_tokens=True))
The source PDF is available at assets/speedup.pdf.
@article{huang2026domino,
title={Domino: Decoupling Causal Modeling from Autoregressive Drafting in Speculative Decoding},
author={Huang, Jianuo and Zhang, Yaojie and Zhang, Qituan and Lin, Hao and Xu, Hanlin and Zhang, Linfeng},
journal={arXiv preprint arXiv:2605.29707},
year={2026}
}