Instructions to use Qwen/Qwen3-Next-80B-A3B-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-Next-80B-A3B-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen3-Next-80B-A3B-Thinking") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-Next-80B-A3B-Thinking") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Next-80B-A3B-Thinking", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-Next-80B-A3B-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-Next-80B-A3B-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3-Next-80B-A3B-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3-Next-80B-A3B-Thinking
- SGLang
How to use Qwen/Qwen3-Next-80B-A3B-Thinking 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 "Qwen/Qwen3-Next-80B-A3B-Thinking" \ --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": "Qwen/Qwen3-Next-80B-A3B-Thinking", "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 "Qwen/Qwen3-Next-80B-A3B-Thinking" \ --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": "Qwen/Qwen3-Next-80B-A3B-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen3-Next-80B-A3B-Thinking with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-Next-80B-A3B-Thinking
Add files using upload-large-folder tool
Browse files- config.json +46 -0
- merges.txt +0 -0
- model-00004-of-00041.safetensors +3 -0
- model-00006-of-00041.safetensors +3 -0
- model-00015-of-00041.safetensors +3 -0
- model-00016-of-00041.safetensors +3 -0
- model-00022-of-00041.safetensors +3 -0
- model-00037-of-00041.safetensors +3 -0
config.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"apply_layernorm_1p": true,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Qwen3NextForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 151643,
|
| 8 |
+
"decoder_sparse_step": 1,
|
| 9 |
+
"eos_token_id": 151643,
|
| 10 |
+
"full_attention_interval": 4,
|
| 11 |
+
"head_dim": 256,
|
| 12 |
+
"hidden_act": "silu",
|
| 13 |
+
"hidden_size": 2048,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 5120,
|
| 16 |
+
"linear_conv_kernel_dim": 4,
|
| 17 |
+
"linear_expand_v": 1,
|
| 18 |
+
"linear_key_head_dim": 128,
|
| 19 |
+
"linear_num_key_heads": 16,
|
| 20 |
+
"linear_num_value_heads": 32,
|
| 21 |
+
"linear_value_head_dim": 128,
|
| 22 |
+
"max_position_embeddings": 65536,
|
| 23 |
+
"mlp_only_layers": [],
|
| 24 |
+
"model_type": "qwen3_next",
|
| 25 |
+
"moe_intermediate_size": 512,
|
| 26 |
+
"norm_topk_prob": true,
|
| 27 |
+
"num_attention_heads": 16,
|
| 28 |
+
"num_experts": 512,
|
| 29 |
+
"num_experts_per_tok": 10,
|
| 30 |
+
"num_hidden_layers": 48,
|
| 31 |
+
"num_key_value_heads": 2,
|
| 32 |
+
"output_router_logits": false,
|
| 33 |
+
"partial_rotary_factor": 0.25,
|
| 34 |
+
"qkv_bias": false,
|
| 35 |
+
"rms_norm_eps": 1e-06,
|
| 36 |
+
"rope_scaling": null,
|
| 37 |
+
"rope_theta": 10000000,
|
| 38 |
+
"router_aux_loss_coef": 0.001,
|
| 39 |
+
"shared_expert_intermediate_size": 512,
|
| 40 |
+
"tie_word_embeddings": false,
|
| 41 |
+
"torch_dtype": "bfloat16",
|
| 42 |
+
"transformers_version": "4.56.0.dev0",
|
| 43 |
+
"use_cache": true,
|
| 44 |
+
"use_sliding_window": false,
|
| 45 |
+
"vocab_size": 151936
|
| 46 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model-00004-of-00041.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91feebaeec4a30451d186c63a939331671f67c7b8f54fdfa443ae1e942e6bb74
|
| 3 |
+
size 3999842000
|
model-00006-of-00041.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4240714401dfc448b7d271c21f57d3e37e94fdb4cfe61fc52bc53b7a99157bd7
|
| 3 |
+
size 3999853216
|
model-00015-of-00041.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8690ccb1eb05c2ca89004aca4fcd61166720d9010bf87245fec9779b39964772
|
| 3 |
+
size 4000181736
|
model-00016-of-00041.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62c8c923584aa3aef52e09eb602a2157596c6a794bf83fe200eb1d674a6ec1b0
|
| 3 |
+
size 3999517256
|
model-00022-of-00041.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3bafdaf9fb67877586bc9def63f1084f629ebb59ea26221c71548671be1ddc0
|
| 3 |
+
size 3999843880
|
model-00037-of-00041.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9739e815e66d118bbf21f47ae7d0552cd0b7086d6ada460883edfdea87e90162
|
| 3 |
+
size 3999843872
|