AlayaNeW/GLM-5.2-DSpark
GLM-5.2-DSpark
This repository releases a DSpark draft model for GLM-5.2, trained and published by AlayaNeW. It is a speculator, not a standalone LLM: pair it with a GLM-5.2 target (BF16 or FP8) in SGLang or vLLM.
- Hugging Face: `AlayaNeW/GLM-5.2-DSpark`
- Target model: `zai-org/GLM-5.2` / `zai-org/GLM-5.2-FP8`
- Algorithm: DSpark (parallel block draft + Markov head + confidence head)
Architecture
The training data is a mixture of code, reasoning, Chinese alignment, and long-context corpora. Answers were regenerated by GLM-5.2 to build the target cache. The draft was trained from scratch at 8k sequence length using DeepSpec。
Quick Start
Requires a recent SGLang or vLLM build with native DSpark support. This draft is for GLM-5.2 only.
Serve with SGLang
export SGLANG_ENABLE_SPEC_V2=1
sglang serve \
--model-path zai-org/GLM-5.2-FP8 \
--trust-remote-code \
--tp-size 8 \
--reasoning-parser glm45 \
--tool-call-parser glm47 \
--context-length 202752 \
--mem-fraction-static 0.85 \
--cuda-graph-max-bs 256 \
--disable-shared-experts-fusion \
--host 0.0.0.0 \
--port 8100 \
--speculative-algorithm DSPARK \
--speculative-draft-model-path AlayaNeW/GLM-5.2-DSpark \
--speculative-dspark-block-size 8Serve with vLLM
vllm serve zai-org/GLM-5.2-FP8 \
--trust-remote-code \
--tensor-parallel-size 8 \
--tool-call-parser glm47 \
--enable-auto-tool-choice \
--reasoning-parser glm45 \
--max-model-len 202752 \
--max-num-seqs 256 \
--gpu-memory-utilization 0.85 \
--max-cudagraph-capture-size 256 \
--host 0.0.0.0 \
--port 8100 \
--served-model-name GLM-5.2 \
--speculative-config '{
"method": "dspark",
"model": "AlayaNeW/GLM-5.2-DSpark",
"num_speculative_tokens": 8,
"draft_sample_method": "probabilistic"
}'This draft includes a confidence head. vLLM can enable adaptive verification (load-aware verify budget; losslessness unchanged):
--speculative-config '{
"method": "dspark",
"model": "AlayaNeW/GLM-5.2-DSpark",
"num_speculative_tokens": 8,
"draft_sample_method": "probabilistic",
"enable_adaptive_verification": true
}'Call the server
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8100/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="GLM-5.2",
messages=[{"role": "user", "content": "Write a Python function that checks if a number is prime."}],
max_tokens=1024,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
print(resp.choices[0].message.content)Evaluation
- Runtime: SGLang on 8 NVIDIA B200 GPUs (TP8)
- Speculation block size: 8 (
--speculative-dspark-block-size 8,--speculative-num-draft-tokens 9= block size + 1) - Sampling: temperature 0.7, top-p 0.95 (thinking disabled)
Acceptance length is the per-request mean of completion tokens divided by verification steps. Higher is better.
Speed-Bench: Low Entropy
Speed-Bench: Qualitative
Citation
If you use this draft model, please cite AlayaNeW/GLM-5.2-DSpark:
@misc{alayanew2026glm52dspark,
title={GLM-5.2-DSpark},
author={AlayaNeW},
year={2026},
howpublished={\url{https://huggingface.co/AlayaNeW/GLM-5.2-DSpark}}
}