Instructions to use Qwen/Qwen3-235B-A22B-GPTQ-Int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-235B-A22B-GPTQ-Int4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen3-235B-A22B-GPTQ-Int4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-235B-A22B-GPTQ-Int4") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-235B-A22B-GPTQ-Int4", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-235B-A22B-GPTQ-Int4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-235B-A22B-GPTQ-Int4" # 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-235B-A22B-GPTQ-Int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3-235B-A22B-GPTQ-Int4
- SGLang
How to use Qwen/Qwen3-235B-A22B-GPTQ-Int4 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-235B-A22B-GPTQ-Int4" \ --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-235B-A22B-GPTQ-Int4", "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-235B-A22B-GPTQ-Int4" \ --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-235B-A22B-GPTQ-Int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen3-235B-A22B-GPTQ-Int4 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-235B-A22B-GPTQ-Int4
feihu.hf commited on
Commit ·
1d5ada7
1
Parent(s): 44823bd
update README
Browse files- LICENSE +0 -0
- README.md +5 -5
- generation_config.json +12 -5
- tokenizer_config.json +0 -1
LICENSE
CHANGED
|
File without changes
|
README.md
CHANGED
|
@@ -322,10 +322,10 @@ YaRN is currently supported by several inference frameworks, e.g., `transformers
|
|
| 322 |
|
| 323 |
| Mode | QUANTIZATION TYPE | LiveBench 2024-11-25 | GPQA | MMLU-Redux | AIME24 |
|
| 324 |
| --- | --- | --- | --- | --- | --- |
|
| 325 |
-
| Thinking | bf16 |
|
| 326 |
-
| Thinking | GPTQ-int4 |
|
| 327 |
-
| Non-Thinking | bf16 |
|
| 328 |
-
| Non-Thinking | GPTQ-int4 |
|
| 329 |
|
| 330 |
## Best Practices
|
| 331 |
|
|
@@ -356,4 +356,4 @@ If you find our work helpful, feel free to give us a cite.
|
|
| 356 |
month = {April},
|
| 357 |
year = {2025}
|
| 358 |
}
|
| 359 |
-
```
|
|
|
|
| 322 |
|
| 323 |
| Mode | QUANTIZATION TYPE | LiveBench 2024-11-25 | GPQA | MMLU-Redux | AIME24 |
|
| 324 |
| --- | --- | --- | --- | --- | --- |
|
| 325 |
+
| Thinking | bf16 | 77.1 | 71.1 | 92.7 | - |
|
| 326 |
+
| Thinking | GPTQ-int4 | 75.1 | 71.9 | 92.0 | - |
|
| 327 |
+
| Non-Thinking | bf16 | 62.5 | 62.9 | 89.2 | - |
|
| 328 |
+
| Non-Thinking | GPTQ-int4 | 61.1 | 62.8 | 89.0 | - |
|
| 329 |
|
| 330 |
## Best Practices
|
| 331 |
|
|
|
|
| 356 |
month = {April},
|
| 357 |
year = {2025}
|
| 358 |
}
|
| 359 |
+
```
|
generation_config.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
151645,
|
| 6 |
+
151643
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 151643,
|
| 9 |
+
"temperature": 0.6,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
+
"transformers_version": "4.51.0"
|
| 13 |
+
}
|
tokenizer_config.json
CHANGED
|
@@ -231,7 +231,6 @@
|
|
| 231 |
"clean_up_tokenization_spaces": false,
|
| 232 |
"eos_token": "<|im_end|>",
|
| 233 |
"errors": "replace",
|
| 234 |
-
"extra_special_tokens": {},
|
| 235 |
"model_max_length": 131072,
|
| 236 |
"pad_token": "<|endoftext|>",
|
| 237 |
"split_special_tokens": false,
|
|
|
|
| 231 |
"clean_up_tokenization_spaces": false,
|
| 232 |
"eos_token": "<|im_end|>",
|
| 233 |
"errors": "replace",
|
|
|
|
| 234 |
"model_max_length": 131072,
|
| 235 |
"pad_token": "<|endoftext|>",
|
| 236 |
"split_special_tokens": false,
|