Skip to main content
Back

Alibaba Squeezes Qwen2.5 32B Into a Single 24 GB GPU

Alibaba's Qwen team packages its 32B instruction-tuned model into a 4-bit AWQ build, cutting VRAM needs while preserving long-context and coding strengths.

Pro

Model, Full Access
  • Qwen2.5-32B-Instruct-AWQ is a 4-bit quantized build of Alibaba's 32B instruction-tuned model, Apache-2.0 licensed.
  • Fits on a single 24GB GPU while preserving coding, math, and instruction-following gains from Qwen2.5.
  • Supports 128K context via YaRN scaling, with 32K as the default window.
  • Works out of the box with Transformers, vLLM, and SGLang; not a reasoning model.
  • Multilingual coverage spans 29+ languages including Chinese, English, Arabic, Japanese and Korean.
  • Free to self-host; strong choice for local coding, JSON extraction, and RAG workloads.

Alibaba’s Qwen team packages its 32.5-billion-parameter instruction model for single-GPU inference in Qwen2.5 32B AWQ. Activation-aware Weight Quantization compresses most weights to 4 bits, allowing the model to load on a 24 GB GPU while preserving most of the full-precision checkpoint’s accuracy.

The hardware claim needs one qualification: 24 GB accommodates the weights and a modest inference cache, not the model’s entire advertised 128K-token context. Context length, concurrent requests, serving framework, and cache precision determine the final VRAM requirement.

A 32B model inside 24 GB

Specification Qwen2.5-32B-Instruct-AWQ
Architecture Dense, decoder-only causal transformer
Parameters 32.5B total, 31.0B excluding embeddings
Transformer layers 64
Attention 40 query heads, 8 key/value heads
Core components RoPE, SwiGLU, RMSNorm, and QKV bias
Quantization 4-bit AWQ
Default context 32,768 tokens
Extended context 131,072 tokens through YaRN
Maximum generation 8,192 tokens
License Apache 2.0

Raw 16-bit storage for 32.5 billion parameters requires about 65 GB before runtime overhead. Four-bit storage reduces the theoretical weight footprint to roughly 16.3 GB, although quantization metadata, unquantized tensors, CUDA allocations, and the KV cache increase live memory use.

AWQ calibrates the model against sample activations and identifies weight channels that contribute disproportionately to output quality. It scales those channels before quantization, reducing rounding damage compared with uniform 4-bit conversion. Grouped-query attention also lowers memory traffic by sharing eight key/value heads across 40 query heads.

Where Qwen 2.5 gained ground

Qwen’s model card attributes the 2.5 generation’s gains to broader training and stronger post-training across several practical areas:

  • Improved coding and mathematics performance informed by specialist models
  • More reliable instruction following across varied system prompts
  • Long-form generation beyond 8,000 tokens
  • Better handling of tables, structured data, and JSON output
  • Support for more than 29 languages, including Chinese, English, French, Spanish, German, Japanese, Korean, and Arabic

These capabilities still require workload-specific evaluation. JSON responses should be schema-validated, long outputs need checks for consistency, and multilingual quality can vary by language and domain. The checkpoint produces direct responses and lacks the dedicated reasoning training used by newer reasoning models.

Serving without surprises

vLLM can expose the checkpoint through an OpenAI-compatible API. A 24 GB card usually needs a conservative context cap so the remaining memory can hold the KV cache and temporary CUDA allocations:

pip install vllm

vllm serve Qwen/Qwen2.5-32B-Instruct-AWQ \
  --max-model-len 8192 \
  --gpu-memory-utilization 0.95

The server listens on port 8000 and provides endpoints such as /v1/chat/completions. The maximum stable context varies with the vLLM release, cache data type, request concurrency, and other processes using the GPU.

Transformers 4.37.0 or later recognizes the Qwen2 architecture. Earlier releases raise KeyError: 'qwen2'. An AWQ-compatible backend and Accelerate are also required for the following example:

pip install "transformers>=4.37.0" accelerate autoawq
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Qwen/Qwen2.5-32B-Instruct-AWQ"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto",
)

messages = [
    {
        "role": "system",
        "content": "You are Qwen, a helpful assistant.",
    },
    {
        "role": "user",
        "content": "Write a SQL query for monthly active users.",
    },
]

prompt = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
generated = model.generate(
    **inputs,
    max_new_tokens=512,
    do_sample=False,
)

new_tokens = generated[:, inputs.input_ids.shape[1]:]
response = tokenizer.batch_decode(
    new_tokens,
    skip_special_tokens=True,
)[0]

print(response)

Why 128K changes the hardware math

The repository’s default config.json supports up to 32,768 tokens. Qwen extends that window to 131,072 tokens with YaRN, a RoPE-scaling method for extrapolating beyond the original training window. The model card specifies this configuration:

{
  "rope_scaling": {
    "factor": 4.0,
    "original_max_position_embeddings": 32768,
    "type": "yarn"
  }
}

vLLM supports static YaRN, which applies the same scaling factor to every request. That fixed scaling can reduce quality on shorter prompts, so Qwen recommends enabling it only for workloads that need the extended window.

KV-cache memory grows with context length, batch size, layer count, and concurrent sequences. AWQ compresses model weights, while the cache retains its serving engine’s configured precision. A full 128K window will generally require additional GPUs, cache quantization, CPU offload, or lower concurrency.

Workloads that fit

The checkpoint suits inference workloads that benefit from a capable general model while keeping deployment under local control:

  • Local coding assistants and refactoring tools that keep source code inside controlled infrastructure
  • Document extraction pipelines that combine model-generated JSON with schema validation
  • Multilingual chatbots and internal assistants across the supported languages
  • Retrieval-augmented generation and summarization within the available KV-cache budget
  • Batch classification, rewriting, and content-generation jobs without provider token billing

The AWQ artifact targets inference. Adapter training should start from the original non-AWQ checkpoint, allowing the training framework to apply its own QLoRA-compatible quantization and preserve trainable components correctly.

Reasoning-heavy mathematics, branching agent workflows, and specialized coding tasks require comparison with newer Qwen3 models or the dedicated Qwen2.5 Coder family. Those checkpoints target workloads beyond the general instruction model’s direct-response design.

The case for this checkpoint

Qwen2.5-32B-Instruct-AWQ lowers the hardware floor for running a 32B dense model to one high-memory desktop GPU at modest context lengths. Its Apache 2.0 license permits commercial use and modification subject to the license’s notice requirements, while local serving provides control over data handling, latency, and infrastructure costs.

The practical boundary remains memory. A 24 GB GPU can hold the quantized weights and a limited cache, while long contexts and high concurrency require more capacity. Within that constraint, the checkpoint offers a mature deployment path through Transformers, vLLM, and SGLang.