Text Generation
Transformers
Safetensors
qwen3
speculative-decoding
dflash
draft-model
glm
z.ai
text-generation-inference
Run this model with HF Jobs
Run Dariusfar/GLM-4.7-Flash-DFlash 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 and TRL to fine-tune https://huggingface.co/Dariusfar/GLM-4.7-Flash-DFlash. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/Dariusfar/GLM-4.7-Flash-DFlash on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/Dariusfar/GLM-4.7-Flash-DFlash. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Dariusfar/GLM-4.7-Flash-DFlash with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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 files44 unmodified lines45464748495051525344 unmodified linesserving engine). It requires the target model plus a DFlash runtime and does not generate texton its own.## TrainingTrained on NERSC Perlmutter; exported from training checkpoint `step_2916`.## License44 unmodified lines4546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959644 unmodified linesserving engine). It requires the target model plus a DFlash runtime and does not generate texton its own.## Method note: decoupling draft width from verification depthA DFlash-style drafter normally uses a **single width `k`** for both the draft pass *and* thenumber of proposals the target verifies. In this work those two knobs are **decoupled** intoindependent, fixed-shape controls:- **`draft_width`** — the non-causal DFlash draft-query width. Because mask rows attend to oneanother, a *wider* draft pass shifts the **acceptance** profile at early positions.- **`verify_k`** — how many of those proposals are actually sent to the target for verification.On a **fine-grained MoE target** like GLM-4.7-Flash, each verified token is expensive, so thisis the real cost driver.The technique runs the proposer at a **wide** `draft_width`, keeps only the first `verify_k`proposals, and verifies just that prefix — discarding the tail *before it ever enters thetarget's KV / sequence state*. Draft and verify graphs stay fixed-shape (CUDA-graphcapturable), and target output semantics are preserved (the DeepSpec `prediction_shifted` rowcontract), so the accelerated path is numerically faithful to the target.**Why it helps.** A wide draft raises the number of committed tokens at early positions(≈3.1 committed through position 4 at width-8, vs ≈2.1 at width-4), while a short verify avoidspaying MoE verification cost on the low-probability tail. The two optima are genuinelydifferent, so tying them together leaves throughput on the table.### ResultsThe sweet spot was **wide draft (8) / short verify (3)**. On a fixed same-node benchmark itdelivered **~1.16× throughput vs. an MTP-1 baseline** and **~+3% over the matched coupledsetting** (mean accepted length 2.50 vs 2.40) at **flat p95 latency**. The gain is strongly**workload-dependent** (≈0.97×–1.54× across code / reasoning / numerical-optimization prompts),which motivates **workload-aware / request-level routing** rather than one static configuration.*Draft-width × verify-depth matrix: acceptance and throughput across the swept configurations.Wide-draft / short-verify (e.g. 8/3) sits at the throughput optimum.**Full-domain throughput vs. baselines (MTP-1 and coupled DFlash). Note the strong per-workloadvariation — the motivation for request-level routing.*## TrainingTrained on NERSC Perlmutter (4×A100-40GB); exported from training checkpoint `step_2916`.Draft config: block 16, 8-layer draft (hidden 2048), auxiliary hidden states from targetlayers [1, 12, 23, 33, 44].## License
README.md+44-1