Instructions to use SparseLLM/DECO-0.2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SparseLLM/DECO-0.2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SparseLLM/DECO-0.2B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SparseLLM/DECO-0.2B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SparseLLM/DECO-0.2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SparseLLM/DECO-0.2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SparseLLM/DECO-0.2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SparseLLM/DECO-0.2B
- SGLang
How to use SparseLLM/DECO-0.2B 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 "SparseLLM/DECO-0.2B" \ --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": "SparseLLM/DECO-0.2B", "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 "SparseLLM/DECO-0.2B" \ --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": "SparseLLM/DECO-0.2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SparseLLM/DECO-0.2B with Docker Model Runner:
docker model run hf.co/SparseLLM/DECO-0.2B
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# DECO-0.2B
|
| 10 |
+
This is the 0.2B DECO checkpoint introduced by the paper *DECO: Sparse Mixture-of-Experts with Dense-Comparable Performance on End-Side Devices*. DECO is an improved version of our previous [BlockFFN](https://arxiv.org/pdf/2507.08771) architecture, with dense-comparable performance given the same budget of total parameters.
|
| 11 |
+
|
| 12 |
+
Links: [[Paper](https://arxiv.org/pdf/2605.10933)] [[Code](https://github.com/thunlp/DECO)]
|
| 13 |
+
|
| 14 |
+
### Quick start
|
| 15 |
+
|
| 16 |
+
You can load and use this model with `AutoTokenizer` and `AutoModelForCausalLM` from `transformers`.
|
| 17 |
+
|
| 18 |
+
```python
|
| 19 |
+
import torch
|
| 20 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 21 |
+
model_id = "SparseLLM/DECO-0.2B"
|
| 22 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 23 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 24 |
+
model_id,
|
| 25 |
+
torch_dtype=torch.bfloat16,
|
| 26 |
+
trust_remote_code=True,
|
| 27 |
+
).to("cuda").eval()
|
| 28 |
+
prompt = "Mixture-of-Experts models are useful because"
|
| 29 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 30 |
+
with torch.no_grad():
|
| 31 |
+
output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
|
| 32 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
### Citation
|
| 36 |
+
If you find our work useful for your research, please kindly cite our paper as follows:
|
| 37 |
+
```
|
| 38 |
+
@article{song2026deco,
|
| 39 |
+
title={{DECO}: Sparse Mixture-of-Experts with Dense-Comparable Performance on End-Side Devices},
|
| 40 |
+
author={Chenyang Song, Weilin Zhao, Xu Han, Chaojun Xiao, Yingfa Chen, Zhiyuan Liu},
|
| 41 |
+
journal={arXiv preprint arXiv:2605.10933},
|
| 42 |
+
year={2026},
|
| 43 |
+
url={https://arxiv.org/pdf/2605.10933},
|
| 44 |
+
}
|
| 45 |
+
```
|