Run this model with HF Jobs
Run apple/dStreamer 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 to fine-tune https://huggingface.co/apple/dStreamer. 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/apple/dStreamer 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.
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
Commit ·
0d378ce
0
Parent(s):
DStreamer drafters for Qwen3-4B
Browse filesCo-authored-by: patricejaton <patricejaton@users.noreply.huggingface.co>
Files changed (8)
- .gitattributesAdded+35
- LICENSEAdded+88
- README.mdAdded+62
- qwen3-4b-gru-k16/adapter.ptAdded+3
- qwen3-4b-gru-k16/config.jsonAdded+19
- qwen3-4b-gru-k16/head.ptAdded+3
- qwen3-4b-k4/adapter.ptAdded+3
- qwen3-4b-k4/config.jsonAdded+20
1234567891011121314151617181920212223242526272829303132333435*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788Disclaimer: IMPORTANT: This Apple Machine Learning Research Model isspecifically developed and released by Apple Inc. ("Apple") for the sole purposeof scientific research of artificial intelligence and machine-learningtechnology. “Apple Machine Learning Research Model” means the model, includingbut not limited to algorithms, formulas, trained model weights, parameters,configurations, checkpoints, and any related materials (includingdocumentation).
This Apple Machine Learning Research Model is provided to You byApple in consideration of your agreement to the following terms, and your use,modification, creation of Model Derivatives, and or redistribution of the AppleMachine Learning Research Model constitutes acceptance of this Agreement. If Youdo not agree with these terms, please do not use, modify, create ModelDerivatives of, or distribute this Apple Machine Learning Research Model orModel Derivatives.
* License Scope: In consideration of your agreement to abide by the following terms, and subject to these terms, Apple hereby grants you a personal, non-exclusive, worldwide, non-transferable, royalty-free, revocable, and limited license, to use, copy, modify, distribute, and create Model Derivatives (defined below) of the Apple Machine Learning Research Model exclusively for Research Purposes. You agree that any Model Derivatives You may create or that may be created for You will be limited to Research Purposes as well. “Research Purposes” means non-commercial scientific research and academic development activities, such as experimentation, analysis, testing conducted by You with the sole intent to advance scientific knowledge and research. “Research Purposes” does not include any commercial exploitation, product development or use in any commercial product or service.
* Distribution of Apple Machine Learning Research Model and Model Derivatives: If you choose to redistribute Apple Machine Learning Research Model or its Model Derivatives, you must provide a copy of this Agreement to such third party, and ensure that the following attribution notice be provided: “Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement.” Additionally, all Model Derivatives must clearly be identified as such, including disclosure of modifications and changes made to the Apple Machine Learning Research Model. The name, trademarks, service marks or logos of Apple may not be used to endorse or promote Model Derivatives or the relationship between You and Apple. “Model Derivatives” means any models or any other artifacts created by modifications, improvements, adaptations, alterations to the architecture, algorithm or training processes of the Apple Machine Learning Research Model, or by any retraining, fine-tuning of the Apple Machine Learning Research Model.
* No Other License: Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent, trademark, and similar intellectual property rights worldwide that may be infringed by the Apple Machine Learning Research Model, the Model Derivatives or by other works in which the Apple Machine Learning Research Model may be incorporated.
* Compliance with Laws: Your use of Apple Machine Learning Research Model must be in compliance with all applicable laws and regulations.
* Term and Termination: The term of this Agreement will begin upon your acceptance of this Agreement or use of the Apple Machine Learning Research Model and will continue until terminated in accordance with the following terms. Apple may terminate this Agreement at any time if You are in breach of any term or condition of this Agreement. Upon termination of this Agreement, You must cease to use all Apple Machine Learning Research Models and Model Derivatives and permanently delete any copy thereof. Sections 3, 6 and 7 will survive termination.
* Disclaimer and Limitation of Liability: This Apple Machine Learning Research Model and any outputs generated by the Apple Machine Learning Research Model are provided on an “AS IS” basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE MACHINE LEARNING RESEARCH MODEL OR OUTPUTS GENERATED BY THE APPLE MACHINE LEARNING RESEARCH MODEL. You are solely responsible for determining the appropriateness of using or redistributing the Apple Machine Learning Research Model and any outputs of the Apple Machine Learning Research Model and assume any risks associated with Your use of the Apple Machine Learning Research Model and any output and results. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE MACHINE LEARNING RESEARCH MODEL AND ANY OUTPUTS OF THE APPLE MACHINE LEARNING RESEARCH MODEL, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Governing Law: This Agreement will be governed by and construed under the laws of the State of California without regard to its choice of law principles. The Convention on Contracts for the International Sale of Goods shall not apply to the Agreement except that the arbitration clause and any arbitration hereunder shall be governed by the Federal Arbitration Act, Chapters 1 and 2.
Copyright (C) 2026 Apple Inc. All Rights Reserved.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162---license: otherlicense_name: apple-amlrlicense_link: LICENSEbase_model: Qwen/Qwen3-4Btags: - 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 targetmodel's KV cache and drafts a whole window in one pass, with no separate draft model or draft KVcache. DStreamer trains it in three stages: diffusion initialization, consistency distillation,and acceptance-aligned reinforcement learning that rewards drafts the target accepts. Output isidentical 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:
```bashgit clone https://github.com/apple-aiml-research/ml-dStreamer && cd ml-dStreamerhuggingface-cli download apple/dStreamer --local-dir checkpoints```
**vLLM:**
```bashbash vllm-port/setup.shbash vllm-port/scripts/run_dstreamer_vllm.sh --adapter checkpoints/qwen3-4b-k4/adapter.pt --cudagraphs```
**Apple silicon (MLX):**
```bashpip install mlx mlx-lmPYTHONPATH=. 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.123version https://git-lfs.github.com/spec/v1oid sha256:a2a59b3abb0aebdafcf4cf729ac687f28e6529287ea9b8aa8464f7b4773a5617size 14686231212345678910111213141516171819{ "model": "Qwen/Qwen3-4B", "n_adapter_layers": 4, "adapter_q_heads": 8, "adapter_mlp_rank": 1024, "adapter_depth_map": [ 0, 9, 18, 27 ], "window_size": 16, "n_mask": 16, "attn_window": 0, "gru_hidden": 2048, "feedback": "token", "mask_id": 151935, "step": 100000}123version https://git-lfs.github.com/spec/v1oid sha256:730504ae769b5652d4b87418a10803874a73db98bb0a8060d5cc4415732cf055size 197183928123version https://git-lfs.github.com/spec/v1oid sha256:a75c77033b78280e1bd251fa5b55c5a1c711da5e9f99be1c7b821edf70d9cc77size 3986670561234567891011121314151617181920{ "model": "Qwen/Qwen3-4B", "n_adapter_layers": 8, "adapter_q_heads": 8, "adapter_mlp_rank": 256, "adapter_depth_map": [ 0, 4, 8, 12, 16, 20, 24, 28 ], "window_size": 4, "n_mask": 4, "attn_window": 0, "prompt_style": "auto"}.gitattributesAdded+35
LICENSEAdded+88
README.mdAdded+62
qwen3-4b-gru-k16/adapter.ptAdded+3
qwen3-4b-gru-k16/config.jsonAdded+19
qwen3-4b-gru-k16/head.ptAdded+3
qwen3-4b-k4/adapter.ptAdded+3
qwen3-4b-k4/config.jsonAdded+20