--- base_model: Qwen/Qwen3-4B-Instruct-2507 library_name: transformers license: apache-2.0 tags: - awq - qwen - qwen3 - quantization - 4-bit - vllm pipeline_tag: text-generation model_type: qwen2 --- # Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ ## Model Overview This is the **AWQ (Activation-aware Weight Quantization)** version of **[Qwen/Qwen3-4B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507)**. It was generated using **Intel's AutoRound** algorithm, which optimizes the weight rounding to minimize quantization loss. This ensures superior accuracy compared to standard AWQ conversion methods. ### Key Features - **4-bit Inference**: Runs efficiently on Nvidia GPUs. - **High Accuracy**: Tuned for 1000 iterations using AutoRound. - **Broad Compatibility**: Works natively with `vLLM`, `TGI`, and `Transformers`. ## Specifications - **Scheme**: W4A16 (4-bit weights, 16-bit activations) - **Group Size**: 128 - **Symmetric**: True - **Calibration Data**: 512 samples - **Format**: AutoAWQ (Compatible with standard AWQ kernels) ## Usage ### Option A: Using vLLM (Recommended for Speed) This model is optimized for high-throughput serving with vLLM. ```bash pip install vllm ``` ```python from vllm import LLM, SamplingParams model_id = "OpenTensorLab/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ" llm = LLM( model=model_id, quantization="awq", dtype="half", max_model_len=8192, gpu_memory_utilization=0.90 ) prompts = ["What is the capital of France?"] sampling_params = SamplingParams(temperature=0.7, top_p=0.8) outputs = llm.generate(prompts, sampling_params) for output in outputs: print(output.outputs.text) ``` ### Option B: Using Hugging Face Transformers ```bash pip install autoawq transformers ``` ```python from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "OpenTensorLab/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ" model = AutoModelForCausalLM.from_pretrained( model_id, device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained(model_id) prompt = "Write a python function to reverse a string." messages = [{"role": "user", "content": prompt}] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) inputs = tokenizer(text, return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs, skip_special_tokens=True)) ``` ## Benchmark & Performance This model maintains the strong performance of the Qwen3-4B-Instruct-2507 base model, including its updated reasoning and coding capabilities. | Model | Format | VRAM (Est.) | | :--- | :--- | :--- | | Qwen3-4B-Instruct (BF16) | Original | ~9 GB | | **Qwen3-4B-Instruct (AWQ)** | **4-bit** | **~3.5 GB** | ### 🚀 Deploy on RunPod One-click launch environments pre-configured with PyTorch, CUDA, and dependencies for fine-tuning or quantization. > 🎁 **Need GPU compute?** Sign up via [RunPod](https://runpod.io?ref=iabrlp7z) and get **$5–$500 in free credits** when you add your first $10. #### PyTorch 2.15 | Template | CUDA Version | Docker Image | Template ID | Deploy | | :--- | :--- | :--- | :--- | :--- | | **PyTorch 2.15 (CUDA 13.2)** | 13.2 | `vishva123/cuda-13.2-pytorch-2.15-runpod` | `0rsw686010` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=0rsw686010&ref=iabrlp7z) | | **PyTorch 2.15 (CUDA 13.4)** | 13.4 | `vishva123/cuda-13.4-pytorch-2.15-runpod` | `0s0rhdfaqy` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=0s0rhdfaqy&ref=iabrlp7z) | #### PyTorch 2.14 | Template | CUDA Version | Docker Image | Template ID | Deploy | | :--- | :--- | :--- | :--- | :--- | | **PyTorch 2.14 (CUDA 12.6)** | 12.6 | `vishva123/cuda-12.6-pytorch-2.14-runpod` | `d7lxsa4w9m` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=d7lxsa4w9m&ref=iabrlp7z) | | **PyTorch 2.14 (CUDA 13.0)** | 13.0 | `vishva123/cuda-13.0-pytorch-2.14-runpod` | `yk0y6j6rpg` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=yk0y6j6rpg&ref=iabrlp7z) | | **PyTorch 2.14 (CUDA 13.2)** | 13.2 | `vishva123/cuda-13.2-pytorch-2.14-runpod` | `gsp4gwx0nw` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=gsp4gwx0nw&ref=iabrlp7z) | #### PyTorch 2.13 | Template | CUDA Version | Docker Image | Template ID | Deploy | | :--- | :--- | :--- | :--- | :--- | | **PyTorch 2.13 (CUDA 12.6)** | 12.6 | `vishva123/cuda-12.6-pytorch-2.13-runpod` | `gmlupxnxfk` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=gmlupxnxfk&ref=iabrlp7z) | | **PyTorch 2.13 (CUDA 13.0)** | 13.0 | `vishva123/cuda-13.0-pytorch-2.13-runpod` | `y3j8xvk4f4` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=y3j8xvk4f4&ref=iabrlp7z) | | **PyTorch 2.13 (CUDA 13.2)** | 13.2 | `vishva123/cuda-13.2-pytorch-2.13-runpod` | `vigpissn5w` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=vigpissn5w&ref=iabrlp7z) | #### PyTorch 2.12 | Template | CUDA Version | Docker Image | Template ID | Deploy | | :--- | :--- | :--- | :--- | :--- | | **PyTorch 2.12 (CUDA 12.6)** | 12.6 | `vishva123/cuda-12.6-pytorch-2.12-runpod` | `ctmz86zmf0` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=ctmz86zmf0&ref=iabrlp7z) | | **PyTorch 2.12 (CUDA 13.0)** | 13.0 | `vishva123/cuda-13.0-pytorch-2.12-runpod` | `qjko5yiwzi` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=qjko5yiwzi&ref=iabrlp7z) | | **PyTorch 2.12 (CUDA 13.2)** | 13.2 | `vishva123/cuda-13.2-pytorch-2.12-runpod` | `ifg6xmye0f` | [![Deploy to RunPod](https://img.shields.io/badge/RunPod-Deploy%20Pod-purple?logo=runpod&logoColor=white)](https://runpod.io/console/deploy?template=ifg6xmye0f&ref=iabrlp7z) | --- ## Citation ```bibtex @misc{qwen3technicalreport, title={Qwen3 Technical Report}, author={Qwen Team}, year={2025}, eprint={2505.09388}, archivePrefix={arXiv}, primaryClass={cs.CL} } ```