Instructions to use incoai/Inkling-2-Mini-DFlash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use incoai/Inkling-2-Mini-DFlash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="incoai/Inkling-2-Mini-DFlash2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("incoai/Inkling-2-Mini-DFlash2") model = AutoModel.from_pretrained("incoai/Inkling-2-Mini-DFlash2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use incoai/Inkling-2-Mini-DFlash2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "incoai/Inkling-2-Mini-DFlash2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "incoai/Inkling-2-Mini-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/incoai/Inkling-2-Mini-DFlash2
- SGLang
How to use incoai/Inkling-2-Mini-DFlash2 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 "incoai/Inkling-2-Mini-DFlash2" \ --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": "incoai/Inkling-2-Mini-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "incoai/Inkling-2-Mini-DFlash2" \ --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": "incoai/Inkling-2-Mini-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use incoai/Inkling-2-Mini-DFlash2 with Docker Model Runner:
docker model run hf.co/incoai/Inkling-2-Mini-DFlash2
Inkling-2-Mini-DFlash2
This repository contains the DFlash 2 draft model for
thinkingmachines/Inkling-2-Mini.
It is not a standalone language model: it runs inside a speculative
decoding server and drafts tokens for the target model to verify.
DFlash 2 is a block-diffusion drafter for speculative decoding. It predicts a whole block of tokens in a single pass and keeps the top candidates at every position. A lightweight selector then traces one coherent path through them. Two-tap dynamic convolutions in the backbone keep the draft from decaying toward the end of the block. Target verification preserves the target model's sampling distribution.
Quick Start
Use the official lmsysorg/sglang:inkling-2-mini image with the included
Inkling DFlash 2 compatibility patch:
hf download incoai/Inkling-2-Mini-DFlash2 sglang_inkling_dflash2.py --local-dir ./inkling-dflash2
python ./inkling-dflash2/sglang_inkling_dflash2.py
python -m sglang.launch_server \
--model-path thinkingmachines/Inkling-2-Mini \
--speculative-algorithm DFLASH \
--speculative-draft-model-path incoai/Inkling-2-Mini-DFlash2 \
--speculative-num-draft-tokens 8 \
--attention-backend fa4 \
--speculative-draft-attention-backend fa4
Evaluation
- Runtime: SGLang on one NVIDIA H200, with FlashAttention 4 for target and draft attention
- Speculation block size: 8 (7 draft tokens per verification step)
- Sampling: Inkling-2-Mini's official defaults (temperature 1.0, top-p 1.0, top-k disabled), with default reasoning effort
- Maximum new tokens: 4096
- Prompts: benchmark formatting from
z-lab/dflash
We compare autoregressive decoding, Inkling's built-in MTP (DSpark), and DFlash 2. All speculative methods propose seven draft tokens per verification step.
Acceptance Length
Acceptance length is the per-request mean of completion tokens divided by verification steps. Higher is better.
| Task | MTP (DSpark) | DFlash 2 |
|---|---|---|
| GSM8K | 3.52 | 4.96 |
| MATH-500 | 3.47 | 4.97 |
| HumanEval | 3.66 | 4.80 |
| MBPP | 3.49 | 4.88 |
| MT-Bench | 2.95 | 3.90 |
Throughput
Throughput is total output tokens divided by end-to-end wall time.
Each cell shows output tok/s (speedup vs. autoregressive).
Concurrency 1
| Task | Autoregressive | MTP (DSpark) | DFlash 2 |
|---|---|---|---|
| GSM8K | 180.1 | 375.0 (2.08ร) | 482.1 (2.68ร) |
| MATH-500 | 190.5 | 375.7 (1.97ร) | 525.8 (2.76ร) |
| HumanEval | 190.2 | 374.7 (1.97ร) | 475.9 (2.50ร) |
| MBPP | 181.7 | 393.8 (2.17ร) | 503.4 (2.77ร) |
| MT-Bench | 190.7 | 297.6 (1.56ร) | 387.3 (2.03ร) |
Concurrency 8
| Task | Autoregressive | MTP (DSpark) | DFlash 2 |
|---|---|---|---|
| GSM8K | 851.1 | 1,100.8 (1.29ร) | 1,452.2 (1.71ร) |
| MATH-500 | 919.4 | 1,157.5 (1.26ร) | 1,522.3 (1.66ร) |
| HumanEval | 879.3 | 1,136.8 (1.29ร) | 1,425.4 (1.62ร) |
| MBPP | 845.1 | 1,160.3 (1.37ร) | 1,524.6 (1.80ร) |
| MT-Bench | 847.3 | 893.7 (1.05ร) | 1,158.3 (1.37ร) |
Concurrency 32
| Task | Autoregressive | MTP (DSpark) | DFlash 2 |
|---|---|---|---|
| GSM8K | 1,462.1 | 2,049.9 (1.40ร) | 2,582.1 (1.77ร) |
| MATH-500 | 1,577.1 | 2,173.1 (1.38ร) | 2,855.4 (1.81ร) |
| HumanEval | 1,522.0 | 2,120.9 (1.39ร) | 2,686.1 (1.76ร) |
| MBPP | 1,516.0 | 2,230.1 (1.47ร) | 2,908.4 (1.92ร) |
| MT-Bench | 1,494.8 | 1,713.7 (1.15ร) | 2,206.8 (1.48ร) |
Citation
If you find DFlash 2 useful, please cite:
@misc{inco2026dflash2,
title = {{DFlash 2: Keep Drafting Parallel}},
author = {{Inco AI}},
year = {2026},
month = {August},
url = {https://inco.ai/blog/dflash2/}
}
Please also cite the original DFlash paper:
@inproceedings{chen2026dflash,
title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
booktitle = {International Conference on Machine Learning (ICML)},
year = {2026}
}
- Downloads last month
- 93