Text Generation
Transformers
Safetensors
qwen3
feature-extraction
dflash2
speculative-decoding
draft-model
sglang
conversational
custom_code
text-generation-inference
Instructions to use HYHPING2023/checkpoint-draft-dflash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HYHPING2023/checkpoint-draft-dflash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HYHPING2023/checkpoint-draft-dflash2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("HYHPING2023/checkpoint-draft-dflash2", trust_remote_code=True) model = AutoModel.from_pretrained("HYHPING2023/checkpoint-draft-dflash2", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HYHPING2023/checkpoint-draft-dflash2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HYHPING2023/checkpoint-draft-dflash2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HYHPING2023/checkpoint-draft-dflash2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HYHPING2023/checkpoint-draft-dflash2
- SGLang
How to use HYHPING2023/checkpoint-draft-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 "HYHPING2023/checkpoint-draft-dflash2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HYHPING2023/checkpoint-draft-dflash2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "HYHPING2023/checkpoint-draft-dflash2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HYHPING2023/checkpoint-draft-dflash2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HYHPING2023/checkpoint-draft-dflash2 with Docker Model Runner:
docker model run hf.co/HYHPING2023/checkpoint-draft-dflash2
DFlash2 draft (epoch_3_step_35300) for Qwen3.5-35B-A3B VCLR3 target: 5-layer draft + two-tap dynamic convs + top-16 candidate selector, block 8
edfa72c verified | license: apache-2.0 | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| inference: false | |
| tags: | |
| - dflash2 | |
| - speculative-decoding | |
| - draft-model | |
| - sglang | |
| # checkpoint-draft-dflash2 (Qwen3.5-35B-A3B VCLR3 drafter) | |
| DFlash2 speculative-decoding **draft model** for the Qwen3.5-35B-A3B (VCLR3 game-video | |
| SFT) target. Not a standalone language model: it runs inside a speculative decoding | |
| server and drafts tokens for the target to verify (target weights NOT included; | |
| point `--model-path` at your own merged Qwen3.5-35B-A3B VCLR3 checkpoint). | |
| ## Architecture | |
| DFlash2 (Inco AI, [blog](https://inco.ai/blog/dflash2/); z-lab-compatible weight | |
| layout) with block_size 8: | |
| - 5-layer Qwen3-style dual-stream draft over the target's captured layer | |
| `{1, 10, 19, 28, 37}` hidden states, full 248k vocab (uses the target's | |
| embed_tokens / lm_head) | |
| - Two-tap grouped dynamic causal convolutions (kernel 2, group 16) around every | |
| attention/MLP sublayer β fixes block-end (suffix) decay | |
| - Top-16 candidate path selector (rank 256): `S_t(a,b) = U_t(b) + <A(a) β H(h_t), B(b)>` | |
| ## Serving (SGLang main, DFlash2-aware DFLASH worker) | |
| ```bash | |
| python -m sglang.launch_server \ | |
| --model-path /path/to/Qwen3.5-35B-A3B-vclr3-target \ | |
| --speculative-algorithm DFLASH \ | |
| --speculative-draft-model-path HYHPING2023/checkpoint-draft-dflash2 \ | |
| --speculative-num-draft-tokens 8 \ | |
| --trust-remote-code --tp 1 --enable-metrics | |
| ``` | |
| Notes: request `chat_template_kwargs: {"enable_thinking": false}` (the draft was | |
| trained on non-thinking answers); SGLang builds before DFlash2 support silently | |
| ignore the selector. | |
| ## Evaluation (temperature 0, greedy; block 8) | |
| | Metric | DFlash1 baseline | **DFlash2 (this)** | | |
| |---|---|---| | |
| | Offline accept length / cycle (12.1k blocks, mixed corpus) | 2.72 | **2.97** (+9%) | | |
| | β video blocks | β | **3.54** | | |
| | β text blocks | β | 2.89 | | |
| | SGLang serve accept length (single stream, text) | 1.80 | **2.15** (+19%) | | |
| Per-position conditional acceptance rises 0.63 β 0.72 toward the block end | |
| (DFlash1 stays flat ~0.60) β the convolution's suffix-decay fix. | |
| ## Training | |
| 4 epochs on the mixed video+zh+en corpus (70.6k samples), warm-started from the | |
| DFlash1 b8 mixed2 checkpoint, FSDP + frozen online 35B target. Teacher-forced | |
| selector CE. Checkpoint: `epoch_3_step_35300`. | |