Text Generation
Transformers
Safetensors
Chinese
English
qwen3
speculative-decoding
dflash2
glm-5.3
draft-model
text-generation-inference
Instructions to use AlayaNeW/GLM-5.3-DFlash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlayaNeW/GLM-5.3-DFlash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AlayaNeW/GLM-5.3-DFlash2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("AlayaNeW/GLM-5.3-DFlash2") model = AutoModel.from_pretrained("AlayaNeW/GLM-5.3-DFlash2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AlayaNeW/GLM-5.3-DFlash2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlayaNeW/GLM-5.3-DFlash2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlayaNeW/GLM-5.3-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AlayaNeW/GLM-5.3-DFlash2
- SGLang
How to use AlayaNeW/GLM-5.3-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 "AlayaNeW/GLM-5.3-DFlash2" \ --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": "AlayaNeW/GLM-5.3-DFlash2", "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 "AlayaNeW/GLM-5.3-DFlash2" \ --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": "AlayaNeW/GLM-5.3-DFlash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AlayaNeW/GLM-5.3-DFlash2 with Docker Model Runner:
docker model run hf.co/AlayaNeW/GLM-5.3-DFlash2
Download config.json from AlayaNeW/GLM-5.3-DFlash2: direct link, hf CLI and curl.
- Browser
- Download file 2.03 kB
-
https://huggingface.co/AlayaNeW/GLM-5.3-DFlash2/resolve/main/config.json
- Command line
-
hf download hf://AlayaNeW/GLM-5.3-DFlash2/config.json
-
curl -L -o config.json https://huggingface.co/AlayaNeW/GLM-5.3-DFlash2/resolve/main/config.json
2.03 kB
| { | |
| "_name_or_path": "", | |
| "architectures": [ | |
| "DFlash2DraftModel" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": null, | |
| "chunk_size_feed_forward": 0, | |
| "deepspec_dflash2": { | |
| "dpace_alpha": 0.5, | |
| "flatten_frozen_head": true, | |
| "kl_decay": 1.0, | |
| "kl_scale": 1.0, | |
| "lk_loss_type": "lambda", | |
| "loss_decay_gamma": 7.0, | |
| "loss_type": "dpace", | |
| "num_anchors": 128, | |
| "objective_checkpoint": false, | |
| "objective_chunk_blocks": 32, | |
| "prediction_only_head": true, | |
| "selector_loss_alpha": 1.0, | |
| "selector_stop_gradient": false, | |
| "version": 1 | |
| }, | |
| "dflash_config": { | |
| "block_size": 12, | |
| "conv_group_size": 16, | |
| "conv_kernel_size": 2, | |
| "mask_token_id": 154821, | |
| "selector_rank": 256, | |
| "selector_top_k": 16, | |
| "target_layer_ids": [ | |
| 1, | |
| 20, | |
| 38, | |
| 56, | |
| 75 | |
| ] | |
| }, | |
| "dspark_loss_profile": "legacy", | |
| "dtype": "bfloat16", | |
| "eos_token_id": [ | |
| 154820, | |
| 154827, | |
| 154829 | |
| ], | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 6144, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 1048576, | |
| "max_window_layers": 28, | |
| "model_type": "qwen3", | |
| "num_attention_heads": 64, | |
| "num_hidden_layers": 5, | |
| "num_key_value_heads": 16, | |
| "num_target_layers": 78, | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "pad_token_id": 154820, | |
| "problem_type": null, | |
| "return_dict": true, | |
| "rms_norm_eps": 1e-05, | |
| "rope_parameters": { | |
| "rope_theta": 8000000.0, | |
| "rope_type": "default" | |
| }, | |
| "sliding_window": 2048, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.17.0", | |
| "use_cache": false, | |
| "use_sliding_window": true, | |
| "vocab_size": 154880 | |
| } |