Qwen3-4B
The Qwen3-4B model card says 4.0B parameters.
The model card says 32,768 tokens natively and 131,072 with YaRN. config.json max_position_embeddings is 40,960.
From the model card
Strengths
- The Qwen3 card describes one model with a thinking mode and a non-thinking mode.
- The card presents the family as stronger than Qwen2.5 on reasoning, math, coding, and agent tasks, and as covering 100+ languages.
Weaknesses
- This repository is a text model. Vision is a different Qwen checkpoint.
- Context past 32,768 needs the YaRN setup the card documents. It is not the default.
- Thinking mode changes how long a reply takes. The Frankenstein (HP ProLiant DL380p Gen8) rows used think=false.
Sources: Qwen3-4B model card · Qwen3 GitHub · config.json
Memory at 8,192 tokens
Computed, not measured. Weights use llama.cpp’s whole-file averages (Q4_K_M = 4.8944 bits/weight, Q8_0 = 8.5008) on the total parameter count. KV is fp16 and does not depend on the quant. The formula, including the sliding-window and latent-KV cases, is on the methodology page.
| Q4_K_M | Q8_0 | |
|---|---|---|
| Weights | 2.28 GiB | 3.96 GiB |
| KV at 8,192 | 1.13 GiB | 1.13 GiB |
| Total | 3.4 GiB Computed | 5.08 GiB Computed |
36 layers, 8 KV heads, head dim 128. Every layer stores the full context.
Tokens per second
These are the Frankenstein (HP ProLiant DL380p Gen8) rows whose model name matches this card. Generation tok/s is the median of three runs. Prompt tok/s is uncached prefill, or n/a when that pass was not captured. Thread-sweep rows are included and labeled in the notes. They are not the headline number in the tiers below.
| Device | Quant | Context | Gen tok/s | Prompt tok/s | Date |
|---|---|---|---|---|---|
| CPU | Q4_K_M | 2,048 | 12.36 Measured | n/a | 2026-11-18 |
| CPU | Q4_K_M | 8,192 | 6.62 Measured | 52.6 | 2026-11-18 |
| Tesla P40 (GDDR5) | Q4_K_M | 2,048 | 69.57 Measured | n/a | 2026-11-18 |
| Tesla P40 (GDDR5) | Q4_K_M | 8,192 | 60.03 Measured | 1100 | 2026-11-18 |
The full notes, including RSS and leftover models, are on the benchmark table.
Hardware tiers
Minimum is the smallest RAM that holds Q4_K_M plus 8k KV. Suggested does not name a second machine or a speed this lab has not run. Performance means a CUDA-class card with 12 GB or more of GDDR6 or GDDR6X and the weights fully on the card. The Tesla P40 is 24 GB of GDDR5, so a P40 speed is not the performance-tier number.
| Tier | Example hardware | Quant | Fit | tok/s |
|---|---|---|---|---|
| Minimum | CPU-only, with at least 5.4 GiB of system RAM for the Q4_K_M weights, 8k KV, and a 2 GiB planning allowance. | Q4_K_M | CPU-only, if the RAM is there | CPU: 6.62 gen tok/s, 52.6 prompt tok/s, context 8,192, 2026-11-18, measured |
| Suggested | A machine you are willing to wait on, or a GPU that can hold the quant. This lab has not measured a separate “comfortable” machine, so this row does not invent one. | Q4_K_M until a Q8 run exists | Whichever of the machines above actually holds the weights | not yet measured |
| Performance | A CUDA-class card with 12 GB or more of GDDR6 or GDDR6X, weights fully on the card. | Q4_K_M | Full VRAM on a 12 GB or larger GDDR6-class card | not yet measured |
Measured on the Tesla P40 in Frankenstein (HP ProLiant DL380p Gen8), which is not the performance tier: 60.03 gen tok/s at context 8,192, Q4_K_M, 2026-11-18. GDDR5, 24 GB.
Where it sits
Best-for is a judgment from the card’s stated jobs and the model’s size. It is not a speed ranking. The matching build is Cheap 8B chat. Score it against a machine you have on What can my rig run?