Instructions to use inference-optimization/Qwen3.6-35B-A3B-REAP20 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inference-optimization/Qwen3.6-35B-A3B-REAP20 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="inference-optimization/Qwen3.6-35B-A3B-REAP20") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("inference-optimization/Qwen3.6-35B-A3B-REAP20") model = AutoModelForMultimodalLM.from_pretrained("inference-optimization/Qwen3.6-35B-A3B-REAP20", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inference-optimization/Qwen3.6-35B-A3B-REAP20 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inference-optimization/Qwen3.6-35B-A3B-REAP20" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/Qwen3.6-35B-A3B-REAP20", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/inference-optimization/Qwen3.6-35B-A3B-REAP20
- SGLang
How to use inference-optimization/Qwen3.6-35B-A3B-REAP20 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 "inference-optimization/Qwen3.6-35B-A3B-REAP20" \ --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": "inference-optimization/Qwen3.6-35B-A3B-REAP20", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "inference-optimization/Qwen3.6-35B-A3B-REAP20" \ --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": "inference-optimization/Qwen3.6-35B-A3B-REAP20", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use inference-optimization/Qwen3.6-35B-A3B-REAP20 with Docker Model Runner:
docker model run hf.co/inference-optimization/Qwen3.6-35B-A3B-REAP20
Qwen3.6-35B-A3B-REAP20
Qwen/Qwen3.6-35B-A3B with 20% of its MoE experts structurally pruned with REAP (PRUNE method), produced with llmcompressor.
- Every one of the 40 MoE layers keeps its 205 most salient experts of the original 256 (51 pruned per layer, 8200 of 10240 retained)
- Expert selection is uniform across layers: each layer's 51 lowest-REAP-saliency experts were removed, and the routers were sliced to match
config.jsonrecords the new expert count (num_experts: 205); expert indices are remapped contiguously- The MTP layer (
mtp.layers.0) was not calibrated and is left untouched - All remaining weights (including attention, vision tower, embeddings and the shared experts) are untouched BF16
REAP scores each expert by the router-weighted mean of its output activation
norms over the calibration tokens routed to it,
S_j = mean(g_j * ||f_j||_2), using forward computation only (no gradients or
recovery training). This model was calibrated on all 2,048 samples of the
RazorCal
multi-domain calibration corpus; see the
REAP expert pruning example
for the calibration and pruning scripts.
Usage
from transformers import AutoProcessor, Qwen3_5MoeForConditionalGeneration
model = Qwen3_5MoeForConditionalGeneration.from_pretrained(
"inference-optimization/Qwen3.6-35B-A3B-REAP20", torch_dtype="bfloat16"
)
processor = AutoProcessor.from_pretrained(
"inference-optimization/Qwen3.6-35B-A3B-REAP20"
)
- Downloads last month
- 49
Model tree for inference-optimization/Qwen3.6-35B-A3B-REAP20
Base model
Qwen/Qwen3.6-35B-A3B