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
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?"
}
]
}'Qwen3.5-122B-A10B — QTIP K4/K2 quantized
QTIP (trellis-coded) quantization of Qwen/Qwen3.5-122B-A10B (hybrid DeltaNet /
full-attention MoE, 256 routed experts, moe_intermediate=1024, hidden=3072).
Mixed precision
- Model body (attention q/k/v/o and DeltaNet
in_proj_*/out_proj, plus each layer'sshared_expertMLP) — quantized at K = 4 bit. - Routed experts (256 per layer,
gate_up_proj/down_proj) — quantized at K = 2 bit (expert_bits). - Router gates,
q/k_norm, conv1d, RMSNorms,embed_tokens,lm_headand the whole vision tower are kept in the original fp16/bf16 (never quantized). - 62 "dead" routed experts (no usable calibration factor) are kept as their
original bf16 weights (
dead_expertsinconfig.json → quip_params).
Compression: 234 GB (bf16) → **34 GB** (~6.9×).
Evaluation (perplexity, ctx 4096)
| dataset | this model (K4 body / K2 experts) | bf16 baseline |
|---|---|---|
| wikitext2 | 5.469 | 4.839 |
| c4 | 8.871 | 8.411 |
Compression degradation: +0.630 wikitext2 / +0.460 c4. The kernel (CUDA) decode
path reproduces the manifest (torch) decode exactly — full-wikitext2 kernel PPL =
5.4687 vs manifest 5.469.
How to load
This is a custom quantized checkpoint — it needs the bundled modeling code (shipped
in this repo, modeling_qwen3_5_moe_quantized.py + qtip_*.py) and two runtime
dependencies that are NOT part of the checkpoint:
qtip_kernels— the QTIP CUDA trellis-decode extension (a compiled.so; build it from the QTIP kernels source). Without it the code falls back to a much slower pure-torch decode.- A
transformersbuild that provides the baseqwen3_5_moemodel (transformers.models.qwen3_5_moe.modeling_qwen3_5_moe).
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"Sayankotor/qwen35-122b-a10b-k4e2",
trust_remote_code=True,
torch_dtype="bfloat16",
device_map="auto", # ~34 GB; fits comfortably on 2–4x 80 GB
)
# The Hadamard buffers are non-persistent; rebuild them after load:
from modeling_qwen3_5_moe_quantized import materialize_hadK
materialize_hadK(model)
tok = AutoTokenizer.from_pretrained("Sayankotor/qwen35-122b-a10b-k4e2")
Speed / memory trade-off
The trellis is decoded on every forward pass, so kernel-mode inference trades speed for memory. On 4×A100-80GB, wikitext2 (seqlen 4096, batch 1):
| this model (kernel-mode) | bf16 baseline | |
|---|---|---|
| s / 4096-token block | ~22.8 s | ~1.2 s |
| peak GPU memory |
i.e. ~7× smaller, ~18× slower than dense bf16. Use it when memory — not latency — is the constraint.
License
Inherits the license of the base model Qwen/Qwen3.5-122B-A10B. Refer to the base model card for terms.
- Downloads last month
- 113
Model tree for Sayankotor/qwen35-122b-a10b-k4e2
Base model
Qwen/Qwen3.5-122B-A10B
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?" } ] }'