Instructions to use Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ") model = AutoModelForCausalLM.from_pretrained("Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ", 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 Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ
- SGLang
How to use Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ 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 "Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ" \ --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": "Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ", "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 "Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ" \ --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": "Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ with Docker Model Runner:
docker model run hf.co/Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ
Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ
Model Overview
This is the AWQ (Activation-aware Weight Quantization) version of 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, andTransformers.
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.
pip install vllm
from vllm import LLM, SamplingParams
model_id = "Vishva007/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
pip install autoawq transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Vishva007/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 |
Citation
@misc{qwen3technicalreport,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025},
eprint={2505.09388},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
- Downloads last month
- 11
Model tree for Vishva007/Qwen3-4B-Instruct-2507-W4A16-AutoRound-AWQ
Base model
Qwen/Qwen3-4B-Instruct-2507