Instructions to use apple/dStreamer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use apple/dStreamer with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download apple/dStreamer --local-dir dStreamer
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
DStreamer drafters for Qwen3-4B
Drafter checkpoints for DStreamer, a lossless, diffusion-based speculative decoding method. The drafter is a small adapter that reads the target model's KV cache and drafts a whole window in one pass, with no separate draft model or draft KV cache. DStreamer trains it in three stages: diffusion initialization, consistency distillation, and acceptance-aligned reinforcement learning that rewards drafts the target accepts. Output is identical to the target model's own decoding.
| folder | contents | use with |
|---|---|---|
qwen3-4b-k4/ |
adapter.pt, config.json: 8-layer adapter, 4-token window |
vLLM serving, PyTorch decoding, RLVR (--mode frozen / online) |
qwen3-4b-gru-k16/ |
adapter.pt, head.pt, config.json: 4-layer adapter with a GRU draft head, 16-token window |
MLX on Apple silicon |
Target model: Qwen/Qwen3-4B, non-thinking chat format.
Usage
Download into the code repository:
git clone https://github.com/apple-aiml-research/ml-dStreamer && cd ml-dStreamer
huggingface-cli download apple/dStreamer --local-dir checkpoints
vLLM:
bash vllm-port/setup.sh
bash vllm-port/scripts/run_dstreamer_vllm.sh --adapter checkpoints/qwen3-4b-k4/adapter.pt --cudagraphs
Apple silicon (MLX):
pip install mlx mlx-lm
PYTHONPATH=. python mlx_port/inference/benchmark_rnn_head.py --model Qwen/Qwen3-4B \
--ckpt-dir checkpoints/qwen3-4b-gru-k16 --prompts data/toy/gsm8k_qwen3_4b_greedy.jsonl --limit 4
See the repository for training, benchmarks and RLVR.
Citation
Paper: DStreamer: Acceptance-Aligned Diffusion Streaming for High-Throughput Serving and Online RLVR (link to follow).
License
The model weights are released under the Apple Machine Learning Research Model License; see LICENSE. The code in the GitHub repository is under the Apple Sample Code License.