Text Generation
Transformers
Safetensors
llada2_moe
dllm
diffusion
llm
text_generation
conversational
custom_code
Instructions to use inclusionAI/LLaDA2.1-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/LLaDA2.1-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inclusionAI/LLaDA2.1-mini", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inclusionAI/LLaDA2.1-mini", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inclusionAI/LLaDA2.1-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/LLaDA2.1-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/LLaDA2.1-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inclusionAI/LLaDA2.1-mini
- SGLang
How to use inclusionAI/LLaDA2.1-mini 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 "inclusionAI/LLaDA2.1-mini" \ --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": "inclusionAI/LLaDA2.1-mini", "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 "inclusionAI/LLaDA2.1-mini" \ --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": "inclusionAI/LLaDA2.1-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inclusionAI/LLaDA2.1-mini with Docker Model Runner:
docker model run hf.co/inclusionAI/LLaDA2.1-mini
Commit History
-
Use create_bidirectional_mask for backend-agnostic attention mask handling (SDPA, FA2, flex)
Verified signature90c63c7
-
fix: align _init_weights with Qwen2Moe using nn.init API
Verified signatureUse @torch.no_grad() decorator, call super()._init_weights(), and only init MoE gate weights (nn.Linear/nn.Embedding handled by PreTrainedModel base class in transformers v5).92a5aa6 -
fix: call super()._init_weights() to match Qwen2Moe convention
Verified signature1f0d143 -
fix: align RotaryEmbedding with Qwen2Moe pattern for transformers compat
Verified signatureReplace custom rope_type handling with the standard Qwen2Moe pattern: use compute_default_rope_parameters for "default" type, only look up ROPE_INIT_FUNCTIONS for non-default types. Also adds partial_rotary_factor support.a0f450f -
fix: add default factor=1.0 for linear rope compat with newer transformers
Verified signature220496f -
fix: remap default rope_type to linear for newer transformers compat
Verified signature0435edb -
fix: use linear rope_type instead of removed default for transformers compat
Verified signatureThe "default" rope_type was removed in recent transformers versions. Using "linear" (with no scaling factor) is functionally equivalent.52747ba
-
Update README.md
Verified signaturebbb5715
-
Update README.md
Verified signaturec38df8b
-
Update modeling_llada2_moe.py
Verified signaturec60e761 -
Update README.md
Verified signature6d07958 -
Create README.md
Verified signaturec8ebb85 -
Update modeling_llada2_moe.py
Verified signaturec0b959e -
Create modeling_llada2_moe.py
Verified signature5430aaf -
Update configuration_llada2_moe.py
Verified signature276abc9 -
Add files using upload-large-folder tool
Verified signaturea8af0fb -
initial commit
Verified signature54d0b65