STree: Speculative Tree Decoding for Hybrid State-Space Models
Paper • 2505.14969 • Published • 1
How to use ycwu97/mamba2-distilled-small with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ycwu97/mamba2-distilled-small") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ycwu97/mamba2-distilled-small")
model = AutoModelForCausalLM.from_pretrained("ycwu97/mamba2-distilled-small")How to use ycwu97/mamba2-distilled-small with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ycwu97/mamba2-distilled-small"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ycwu97/mamba2-distilled-small",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/ycwu97/mamba2-distilled-small
How to use ycwu97/mamba2-distilled-small with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ycwu97/mamba2-distilled-small" \
--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": "ycwu97/mamba2-distilled-small",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "ycwu97/mamba2-distilled-small" \
--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": "ycwu97/mamba2-distilled-small",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use ycwu97/mamba2-distilled-small with Docker Model Runner:
docker model run hf.co/ycwu97/mamba2-distilled-small
2 layer mamba2 models distilled from JunxiongWang/Llama3.2-Mamba2-3B-distill. Early stop at 48000 step.
Used in STree: Speculative Tree Decoding for Hybrid State-Space Models as a draft model for speculative decoding for hybrid models.
For more details on installation, training, and evaluation, please refer to the GitHub repository.
Base model
JunxiongWang/Llama3.2-Mamba2-3B-distill