Text Generation
Transformers
Safetensors
qwen3
speculative-decoding
dflash
draft-model
glm
z.ai
text-generation-inference
Instructions to use Dariusfar/GLM-4.7-Flash-DFlash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dariusfar/GLM-4.7-Flash-DFlash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dariusfar/GLM-4.7-Flash-DFlash")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Dariusfar/GLM-4.7-Flash-DFlash") model = AutoModel.from_pretrained("Dariusfar/GLM-4.7-Flash-DFlash", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dariusfar/GLM-4.7-Flash-DFlash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dariusfar/GLM-4.7-Flash-DFlash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dariusfar/GLM-4.7-Flash-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Dariusfar/GLM-4.7-Flash-DFlash
- SGLang
How to use Dariusfar/GLM-4.7-Flash-DFlash 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 "Dariusfar/GLM-4.7-Flash-DFlash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dariusfar/GLM-4.7-Flash-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Dariusfar/GLM-4.7-Flash-DFlash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dariusfar/GLM-4.7-Flash-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Dariusfar/GLM-4.7-Flash-DFlash with Docker Model Runner:
docker model run hf.co/Dariusfar/GLM-4.7-Flash-DFlash
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
base_model:
|
| 4 |
+
- GLM-4.7-Flash
|
| 5 |
+
tags:
|
| 6 |
+
- speculative-decoding
|
| 7 |
+
- dflash
|
| 8 |
+
- draft-model
|
| 9 |
+
- qwen3
|
| 10 |
+
library_name: transformers
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# GLM-4.7-Flash-DFlash
|
| 15 |
+
|
| 16 |
+
A **DFlash** multi-token *draft model* for accelerating **GLM-4.7-Flash** inference via
|
| 17 |
+
speculative / block-parallel (draft-then-verify) decoding.
|
| 18 |
+
|
| 19 |
+
## What this is
|
| 20 |
+
|
| 21 |
+
This is **not** a standalone language model. It is a lightweight **draft head** trained to
|
| 22 |
+
predict blocks of future tokens for a frozen GLM-4.7-Flash *target* model, so a DFlash-capable
|
| 23 |
+
runtime can draft several tokens at once and verify them against the target — speeding up
|
| 24 |
+
generation **without changing the target model's output distribution**.
|
| 25 |
+
|
| 26 |
+
## Specs
|
| 27 |
+
|
| 28 |
+
| | |
|
| 29 |
+
|---|---|
|
| 30 |
+
| Architecture | `DFlashDraftModel` (Qwen3-style) |
|
| 31 |
+
| Target / base model | GLM-4.7-Flash (47 layers) |
|
| 32 |
+
| Draft block size | 16 tokens/step |
|
| 33 |
+
| Draft layers | 8 · hidden 2048 · 32 heads (4 KV) · head_dim 128 · intermediate 6144 |
|
| 34 |
+
| Parameters | ~1.1B (2.1 GB, bfloat16) |
|
| 35 |
+
| Auxiliary hidden states | from target layers [1, 12, 23, 33, 44] |
|
| 36 |
+
| Vocab | 154,880 |
|
| 37 |
+
| Max positions | 202,752 · RoPE θ = 1e6 |
|
| 38 |
+
| Precision | bfloat16 |
|
| 39 |
+
|
| 40 |
+
Full hyperparameters are in `config.json`.
|
| 41 |
+
|
| 42 |
+
## Intended use
|
| 43 |
+
|
| 44 |
+
Pair with **GLM-4.7-Flash** in a DFlash-capable inference stack (e.g. a speculative-decoding
|
| 45 |
+
serving engine). It requires the target model plus a DFlash runtime and does not generate text
|
| 46 |
+
on its own.
|
| 47 |
+
|
| 48 |
+
## Training
|
| 49 |
+
|
| 50 |
+
Trained on NERSC Perlmutter; exported from training checkpoint `step_2916`.
|
| 51 |
+
|
| 52 |
+
## License
|
| 53 |
+
|
| 54 |
+
Derived from **GLM-4.7-Flash** — usage is subject to the base model's license. Verify and comply
|
| 55 |
+
with the upstream terms before use.
|