Text Generation
Transformers
Safetensors
qwen3
dflash2
speculative-decoding
block-diffusion
draft-model
sglang
text-generation-inference
Run this model with HF Jobs
Run OrbitLabsCo/Inkling-2-Mini-DFlash2 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/OrbitLabsCo/Inkling-2-Mini-DFlash2. 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/OrbitLabsCo/Inkling-2-Mini-DFlash2 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/OrbitLabsCo/Inkling-2-Mini-DFlash2. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/OrbitLabsCo/Inkling-2-Mini-DFlash2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use OrbitLabsCo/Inkling-2-Mini-DFlash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OrbitLabsCo/Inkling-2-Mini-DFlash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OrbitLabsCo/Inkling-2-Mini-DFlash2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("OrbitLabsCo/Inkling-2-Mini-DFlash2") model = AutoModel.from_pretrained("OrbitLabsCo/Inkling-2-Mini-DFlash2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OrbitLabsCo/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 "OrbitLabsCo/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": "OrbitLabsCo/Inkling-2-Mini-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OrbitLabsCo/Inkling-2-Mini-DFlash2
- SGLang
How to use OrbitLabsCo/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 "OrbitLabsCo/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": "OrbitLabsCo/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 "OrbitLabsCo/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": "OrbitLabsCo/Inkling-2-Mini-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OrbitLabsCo/Inkling-2-Mini-DFlash2 with Docker Model Runner:
docker model run hf.co/OrbitLabsCo/Inkling-2-Mini-DFlash2
File size: 4,660 Bytes
2b39795 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | ---
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
base_model:
- thinkingmachines/Inkling-2-Mini
inference: false
tags:
- dflash2
- speculative-decoding
- block-diffusion
- draft-model
- sglang
---
# Inkling-2-Mini-DFlash2
[Blog](https://inco.ai/blog/dflash2/) | [GitHub](https://github.com/z-lab/dflash)
This repository contains the DFlash 2 draft model for
[`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/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.
<div align="center">
<img src="assets/dflash2-figure.png" alt="DFlash 2: parallel block drafting with a candidate path selector" width="100%">
</div>
## Quick Start
Use the official `lmsysorg/sglang:inkling-2-mini` image with the included
[Inkling DFlash 2 compatibility patch](sglang_inkling_dflash2.py):
```bash
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`](https://github.com/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:
```bibtex
@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:
```bibtex
@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}
}
```
|