Text Generation
Transformers
Safetensors
Trellis
qwen3_5_moe
feature-extraction
qtip
quantization
Mixture of Experts
mixed-precision
conversational
custom_code
Instructions to use Sayankotor/qwen35-122b-a10b-k4e2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sayankotor/qwen35-122b-a10b-k4e2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sayankotor/qwen35-122b-a10b-k4e2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("Sayankotor/qwen35-122b-a10b-k4e2", trust_remote_code=True) model = AutoModel.from_pretrained("Sayankotor/qwen35-122b-a10b-k4e2", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Trellis
How to use Sayankotor/qwen35-122b-a10b-k4e2 with Trellis:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sayankotor/qwen35-122b-a10b-k4e2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sayankotor/qwen35-122b-a10b-k4e2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sayankotor/qwen35-122b-a10b-k4e2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sayankotor/qwen35-122b-a10b-k4e2
- SGLang
How to use Sayankotor/qwen35-122b-a10b-k4e2 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 "Sayankotor/qwen35-122b-a10b-k4e2" \ --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": "Sayankotor/qwen35-122b-a10b-k4e2", "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 "Sayankotor/qwen35-122b-a10b-k4e2" \ --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": "Sayankotor/qwen35-122b-a10b-k4e2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Sayankotor/qwen35-122b-a10b-k4e2 with Docker Model Runner:
docker model run hf.co/Sayankotor/qwen35-122b-a10b-k4e2
| import torch | |
| #@torch.compile | |
| def decode_compressed(L, S, R, V, m, k, compressed, expanded_lut): | |
| if compressed.dtype != torch.uint16: | |
| compressed = compressed.view(torch.uint16) | |
| assert compressed.shape == (R * m * k // 16, ) | |
| BITS_PER_BLOCK = R * 16 * 16 # R bits * f16 mma tile A size | |
| # unswizzle interleaved blocks | |
| BLOCK_SIZE = 16 * 16 | |
| BITS_PER_BLOCK = R * 16 * 16 # R bits * f16 mma tile A size | |
| compressed = (compressed.view(torch.uint8).reshape( | |
| m // 16 // 2, k // 16 // 2, BLOCK_SIZE // 8, 2, 2, | |
| R).permute(0, -2, 1, -3, 2, -1).flip( | |
| (-1, )).reshape(m // 16, k // 16, BITS_PER_BLOCK // 16, 2).flip( | |
| (-1, )).view(torch.uint16).reshape(m // 16, k // 16, | |
| BITS_PER_BLOCK // 16)) | |
| # decode block | |
| assert L <= 16 | |
| blocked = compressed.reshape(R * m * k // BITS_PER_BLOCK, | |
| BITS_PER_BLOCK // 16, 1) | |
| blocked_roll = torch.roll(blocked.to(torch.int32), -1, | |
| -2).to(blocked.dtype) | |
| blocked32 = torch.cat((blocked_roll, blocked), | |
| dim=-1).reshape(blocked.shape[0], | |
| -1).contiguous().view(torch.uint32) | |
| # blocked32 is 16bits[-1]||16bits[0] 16bits[0]||16bits[1] ... 16bits[-2]||16bits[-1] | |
| expanded32 = blocked32.reshape(*blocked32.shape, | |
| 1).expand(*blocked32.shape, | |
| 16).view(torch.int32) | |
| shifts = (torch.arange(0, 16, dtype=torch.int32, | |
| device=blocked.device)).to(torch.int32).reshape( | |
| 1, 1, -1).expand(expanded32.shape) | |
| shifted = expanded32 >> (16 - shifts) | |
| indices = torch.bitwise_and( | |
| shifted.reshape(shifted.shape[0], -1)[:, 16 - L::R << V], (1 << L) - 1) | |
| # decode lut | |
| mma_swizzled = expanded_lut[indices] | |
| # deswizzle m16n8k16 mma pattern | |
| decompressed = (mma_swizzled.reshape(m // 16, k // 16, 16, 16).reshape( | |
| m // 16, k // 16, 8, 4, 2, 2, 2).permute(0, -2, 2, 1, -3, 3, | |
| -1).reshape(m, k)) | |
| return decompressed | |