Skip to content
localllm

Qwen

Qwen2-7B-Instruct

Parameters
7.6B
Max context length
32,768
Architecture
qwen2

About Qwen2-7B-Instruct

Qwen2-7B-Instruct is a GGUF model based on Qwen/Qwen2-7B-Instruct on Hugging Face. GGUF files are published by MaziyarPanahi/Qwen2-7B-Instruct-GGUF. It has about 7.6B parameters, the qwen2 architecture, a maximum context length of 32,768 tokens (values written in the GGUF).

There are 16 quantizations, with file sizes from 1.90 GB (IQ1_S) to 15.2 GB (F16) (actual sizes on Hugging Face).

Running Q4_K_M (4.68 GB) with an 8,192-token context needs an estimated 6.00 GB of memory, and an estimated 7.41 GB at 32,768 tokens. For 8,192 tokens, a GPU with 6 GB or more of VRAM (such as Arc A380, GeForce RTX 4050 Laptop GPU), or a Mac with 6 GB or more of unified memory, is a rough guide (macOS caps how much memory the GPU can use, so leave some headroom). The smallest, IQ1_S (1.90 GB), needs an estimated 3.22 GB at 8,192 tokens.

The original model is licensed under Apache License 2.0, which allows commercial use (keep the license text and copyright notice when redistributing). Check the original license for the terms of use.

File size and estimated memory per quantization

  • Up to 8 GB
  • Up to 16 GB
  • Up to 24 GB
  • Up to 48 GB
  • Up to 128 GB
  • More

File sizes are the actual values on Hugging Face. Memory is estimated for each context length (KV cache f16). The formula is in How memory is calculated.

All memory figures are Estimated (KV cache f16). It should run on a setup with at least this much VRAM (or Mac unified memory). Click a value to see the devices and models that fit that amount (Find by GPU / Mac).

About the "quality guide" (how far a quantization drifts from the original)

For each quantization type, how far the output drifts from the original model, grouped into six levels from values llama.cpp measured on Llama-3-8B.

The value is mean KLD (the difference between the original and quantized model in next-token probabilities); smaller means closer to the original. Quantizations made with an imatrix (importance data) come out slightly smaller. Levels use the value without an imatrix (or with one, for types that only have that).

These values were not measured on this model. Larger models and MoE models tend to drift less with the same type. Distributor-specific mixed types (such as UD-Q4_K_XL) cannot be matched by type name alone, so they show "-".

Quantization Quality guide KLD (no imatrix) KLD (imatrix) Size (Llama-3-8B)
Q8_0 Nearly identical 0.0014 - 7.96 GiB
Q6_K Very small 0.0055 - 6.14 GiB
Q5_K_M Very small 0.0108 - 5.33 GiB
Q5_K_S Small 0.0166 - 5.21 GiB
Q5_1 Small 0.0180 - 5.65 GiB
Q5_0 Small 0.0222 - 5.21 GiB
Q4_K_M Small 0.0313 0.0282 4.58 GiB
Q4_K_S Medium 0.0431 0.0320 4.37 GiB
IQ4_NL Small - 0.0357 4.35 GiB
IQ4_XS Small - 0.0363 4.14 GiB
Q4_1 Medium 0.0717 - 4.78 GiB
Q4_0 Medium 0.0719 - 4.34 GiB
Q3_K_L Medium 0.0872 0.0731 4.03 GiB
Q3_K_M Medium 0.1019 0.0844 3.74 GiB
IQ3_M Medium - 0.1025 3.53 GiB
IQ3_S Medium - 0.1113 3.42 GiB
IQ3_XS Large - 0.1387 3.28 GiB
IQ3_XXS Large - 0.1836 3.05 GiB
Q3_K_S Large 0.2282 0.1998 3.41 GiB
IQ2_M Large - 0.3260 2.74 GiB
Q2_K Very large 0.4451 0.3322 2.96 GiB
Q2_K_S Very large - 0.4034 2.96 GiB
IQ2_S Very large - 0.4392 2.56 GiB
IQ2_XS Very large - 0.5463 2.43 GiB
IQ2_XXS Very large - 0.8120 2.24 GiB
IQ1_M Very large - 1.3931 2.01 GiB
IQ1_S Very large - 2.2546 1.88 GiB

Source: llama.cpp (MIT), measured on Llama-3-8B against FP16, Wikitext-2, revision f364eb6f. Original table · Reading and choosing quantizations

GGUF source

MaziyarPanahi/Qwen2-7B-Instruct-GGUF

Converted and published by a third party About this label

Last checked: Nov 5, 2026

Architecture
qwen2
Supported before llama.cpp b4409
Parameters
7.6B
Max context length
32,768
License
apache-2.0 Commercial OK
File size and memory per quantization for Qwen2-7B-Instruct (MaziyarPanahi/Qwen2-7B-Instruct-GGUF)
Quantization File size Measured Quality guide 4,096 8,192 16,384 32,768 max
IQ1_S 1.90 GB Very large 2.99 GB 3.22 GB 3.69 GB 4.63 GB
IQ1_M 2.04 GB Very large 3.13 GB 3.36 GB 3.83 GB 4.77 GB
IQ2_XS 2.47 GB Very large 3.55 GB 3.79 GB 4.26 GB 5.20 GB
Q2_K 3.02 GB Very large 4.10 GB 4.33 GB 4.80 GB 5.74 GB
IQ3_XS 3.35 GB Large 4.43 GB 4.66 GB 5.13 GB 6.07 GB
Q3_K_S 3.49 GB Large 4.58 GB 4.81 GB 5.28 GB 6.22 GB
Q3_K_M 3.81 GB Medium 4.89 GB 5.13 GB 5.60 GB 6.54 GB
Q3_K_L 4.09 GB Medium 5.17 GB 5.41 GB 5.88 GB 6.82 GB
IQ4_XS 4.22 GB Small 5.30 GB 5.54 GB 6.01 GB 6.95 GB
Q4_K_S 4.46 GB Medium 5.54 GB 5.78 GB 6.25 GB 7.19 GB
Q4_K_M 4.68 GB Small 5.77 GB 6.00 GB 6.47 GB 7.41 GB
Q5_K_S 5.32 GB Small 6.40 GB 6.63 GB 7.10 GB 8.04 GB
Q5_K_M 5.44 GB Very small 6.53 GB 6.76 GB 7.23 GB 8.17 GB
Q6_K 6.25 GB Very small 7.34 GB 7.57 GB 8.04 GB 8.98 GB
Q8_0 8.10 GB Nearly identical 9.18 GB 9.42 GB 9.89 GB 10.8 GB
F16 15.2 GB Original precision 16.3 GB 16.6 GB 17.0 GB 18.0 GB
Ollama  ollama run hf.co/MaziyarPanahi/Qwen2-7B-Instruct-GGUF:Q4_K_M
llama.cpp  llama-server -hf MaziyarPanahi/Qwen2-7B-Instruct-GGUF:Q4_K_M

Generation speed on common GPUs and Macs (estimated)

A rough guide to how fast Q4_K_M (4.68 GB) generates text. Each token reads the model weights once, so the upper limit is memory bandwidth ÷ file size. The guide is 60–80% of that, where most published measurements fall.

Device Memory bandwidth Guide (tokens/s) Estimated Upper limit
Arc A380 6 GB 186 GB/s 24–32 40
Arc A770M 16 GB 512 GB/s 66–87 109
GeForce RTX 5090 32 GB 1,792 GB/s 230–306 383
Apple M2 8 GB 100 GB/s 13–17 21
Apple M2 Pro 16 GB 200 GB/s 26–34 43
Apple M5 Ultra 96 GB 1,200 GB/s 154–205 256

Estimates only. Prompt processing speed (limited by compute) is not included. Longer contexts and offloading part of the model to the CPU make it slower. Macs are shown only when installed memory is at least 4/3 of what is needed. Devices without published bandwidth (some GeForce cards, etc.) are not shown.

License and commercial use

Apache License 2.0 Commercial OK

Allows commercial use, modification and redistribution. When redistributing, keep the license text and copyright notice, and note changes in modified files.

Based on the license on the original model's Hugging Face page. Original license text (checked Oct 18, 2026)

The summary states facts this site read from the original text and is not legal advice. Always check the original license and its latest terms before use. All licenses

How to run

Example commands using Q4_K_M. To use another quantization, replace the name with one from the table above. How to run local LLMs

Ollama

Run it by pointing directly at the GGUF on Hugging Face.

ollama run hf.co/MaziyarPanahi/Qwen2-7B-Instruct-GGUF:Q4_K_M

llama.cpp

Pass the repository and quantization name to llama-server (or llama-cli) with -hf.

llama-server -hf MaziyarPanahi/Qwen2-7B-Instruct-GGUF:Q4_K_M

LM Studio

Paste MaziyarPanahi/Qwen2-7B-Instruct-GGUF into the search box, download it, and choose the quantization from the file list.

Frequently asked questions

How much memory do I need to run Qwen2-7B-Instruct (Q4_K_M)?
The file size is 4.68 GB (measured). With a 8,192-token context, the estimated memory including the KV cache is 6.00 GB. The formula is published at https://localllm.az-arte.com/en/guide/memory-calculation.
Can Qwen2-7B-Instruct be used commercially?
The original model's license is Apache License 2.0 (Commercial use allowed).Allows commercial use, modification and redistribution. When redistributing, keep the license text and copyright notice, and note changes in modified files. Check the original license text before deciding.
Does Qwen2-7B-Instruct run in 8 GB, 12 GB, 16 GB or 24 GB of VRAM?
8 GB: up to Q6_K (est. 7.57 GB); 12 GB: up to Q8_0 (est. 9.42 GB); 16 GB: up to F16 (est. 16.6 GB); 24 GB: up to F16 (est. 16.6 GB) (estimated at 8,192 tokens with an f16 KV cache, files from the most-downloaded source).
What is the command to run Qwen2-7B-Instruct with Ollama?
Run "ollama run hf.co/MaziyarPanahi/Qwen2-7B-Instruct-GGUF:Q4_K_M" to use the GGUF on Hugging Face directly. To use another quantization, replace the name at the end.