Text Generation
Transformers
Safetensors
English
llada
diffusion-language-model
dllm
conversational
custom_code
Instructions to use MSALab/LLaDA-8B-Instruct-HF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MSALab/LLaDA-8B-Instruct-HF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MSALab/LLaDA-8B-Instruct-HF", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("MSALab/LLaDA-8B-Instruct-HF", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MSALab/LLaDA-8B-Instruct-HF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MSALab/LLaDA-8B-Instruct-HF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MSALab/LLaDA-8B-Instruct-HF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MSALab/LLaDA-8B-Instruct-HF
- SGLang
How to use MSALab/LLaDA-8B-Instruct-HF 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 "MSALab/LLaDA-8B-Instruct-HF" \ --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": "MSALab/LLaDA-8B-Instruct-HF", "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 "MSALab/LLaDA-8B-Instruct-HF" \ --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": "MSALab/LLaDA-8B-Instruct-HF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MSALab/LLaDA-8B-Instruct-HF with Docker Model Runner:
docker model run hf.co/MSALab/LLaDA-8B-Instruct-HF
| license: mit | |
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: | |
| - GSAI-ML/LLaDA-8B-Instruct | |
| tags: | |
| - diffusion-language-model | |
| - dllm | |
| - llada | |
| # LLaDA-8B-Instruct-HF | |
| This repository hosts a re-formatted version of [GSAI-ML/LLaDA-8B-Instruct](https://huggingface.co/GSAI-ML/LLaDA-8B-Instruct), a large language **diffusion** model (LLaDA). Specifically, we convert the original LLaDA weights into the **LLM-part format used by LLaDA-V** (the LLaVA-style multimodal LLaDA), so the checkpoint can be directly plugged in as the language backbone of our [PerceptionDLM](https://github.com/MSALab-PKU/PerceptionDLM) training and inference pipeline. | |
| The weights are functionally identical to the original LLaDA-8B-Instruct; only the parameter-key naming and index/config files are adapted to match the LLaDA-V LLM module. It is used as the **diffusion language backbone** for [PerceptionDLM-Base](https://huggingface.co/MSALab/PerceptionDLM-Base) and [PerceptionDLM](https://huggingface.co/MSALab/PerceptionDLM). | |
| <p align="center"> | |
| π <a href="https://arxiv.org/abs/2606.19534">PerceptionDLM Paper</a> | | |
| π» <a href="https://github.com/MSALab-PKU/PerceptionDLM">Code</a> | | |
| π <a href="https://huggingface.co/GSAI-ML/LLaDA-8B-Instruct">Original LLaDA-8B-Instruct</a> | |
| </p> | |
| ## What is different from the original? | |
| - β Same model weights and behavior as `GSAI-ML/LLaDA-8B-Instruct`. | |
| - π§ Weights re-formatted from the original LLaDA layout into the **LLaDA-V LLM-part format** (parameter-key renaming + regenerated safetensors index/config). | |
| - π¦ Ready to be used directly as `language_model.name_or_path` in our training configs. | |
| You can also reproduce this conversion yourself: | |
| ```bash | |
| python scripts/convert.py \ | |
| --model_path /path/to/LLaDA-8B-Instruct \ | |
| --output /path/to/LLaDA-8B-Instruct-HF | |
| ``` | |
| ## Usage | |
| This checkpoint is primarily intended to be consumed by the PerceptionDLM pipeline. Please refer to the [GitHub repository](https://github.com/MSALab-PKU/PerceptionDLM) for setup and usage. For standalone LLaDA usage and generation details, see the [original LLaDA repository](https://github.com/ML-GSAI/LLaDA). | |
| ## Citation | |
| If you use this checkpoint, please cite both LLaDA and PerceptionDLM: | |
| ```bibtex | |
| @article{nie2025llada, | |
| title = {Large Language Diffusion Models}, | |
| author = {Nie, Shen and Zhu, Fengqi and You, Zebin and Zhang, Xiaolu and Ou, Jingyang and Hu, Jun and Zhou, Jun and Lin, Yankai and Wen, Ji-Rong and Li, Chongxuan}, | |
| journal = {arXiv preprint arXiv:2502.09992}, | |
| year = {2025} | |
| } | |
| @article{sun2026perceptiondlm, | |
| title = {PerceptionDLM: Parallel Region Perception with Multimodal Diffusion Language Models}, | |
| author = {Sun, Yueyi and Wang, Yuhao and Li, Jason and Tian, Ye and Zhang, Tao and Mai, Jacky and Wang, Yihan and Wang, Haochen and Bai, Jinbin and Yang, Ling and Tong, Yunhai}, | |
| journal = {arXiv preprint arXiv:2606.19534}, | |
| year = {2026} | |
| } | |
| ``` | |
| ## License | |
| This conversion follows the license of the original **GSAI-ML/LLaDA-8B-Instruct** release. Please consult the [original model card](https://huggingface.co/GSAI-ML/LLaDA-8B-Instruct) for the authoritative license terms before use. | |