--- license: other license_name: apple-amlr license_link: LICENSE base_model: Qwen/Qwen3-4B tags: - speculative-decoding - vllm - mlx --- # DStreamer drafters for Qwen3-4B Drafter checkpoints for [DStreamer](https://github.com/apple-aiml-research/ml-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](https://huggingface.co/Qwen/Qwen3-4B), non-thinking chat format. ## Usage Download into the code repository: ```bash git clone https://github.com/apple-aiml-research/ml-dStreamer && cd ml-dStreamer huggingface-cli download apple/dStreamer --local-dir checkpoints ``` **vLLM:** ```bash bash vllm-port/setup.sh bash vllm-port/scripts/run_dstreamer_vllm.sh --adapter checkpoints/qwen3-4b-k4/adapter.pt --cudagraphs ``` **Apple silicon (MLX):** ```bash 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](https://github.com/apple-aiml-research/ml-dStreamer) 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](LICENSE). The code in the GitHub repository is under the Apple Sample Code License.