Free tools / LLM memory calculator / Qwen 2.5 7B

Qwen 2.5 7B VRAM and RAM requirements

Qwen 2.5 7B needs about 5.9 GB of VRAM in Q4_K_M, the quantization Ollama downloads by default, at a 4K context, and about 7.5 GB at its full 32K context. The weights take about 4.6 GB and the rest is the context cache plus about 1 GB for the GPU runtime. On a CPU server without a GPU it needs about 6.4 GB of RAM at 4K.

Qwen 2.5 7B is Alibaba's general purpose model, released under the Apache 2.0 license. DeepSeek R1 7B has the same parameter count and context cache size, so at the same context the two need the same memory.

Open Qwen 2.5 7B in the calculator

Qwen 2.5 7B memory by quantization and context

Memory Qwen 2.5 7B needs for each quantization at 4K, 32K tokens of context. VRAM total adds about 1 GB for the GPU runtime, RAM total about 1.5 GB for the system and Ollama on a CPU server.

QuantizationContextWeightsKV cacheVRAM totalRAM total (CPU)
Q4_K_M4K4.6 GB0.2 GB5.9 GB6.4 GB
32K4.6 GB1.9 GB7.5 GB8.0 GB
Q5_K_M4K5.4 GB0.2 GB6.7 GB7.2 GB
32K5.4 GB1.9 GB8.3 GB8.8 GB
Q6_K4K6.2 GB0.2 GB7.5 GB8.0 GB
32K6.2 GB1.9 GB9.1 GB9.6 GB
Q8_04K8.1 GB0.2 GB9.3 GB9.8 GB
32K8.1 GB1.9 GB11 GB11 GB
FP164K15 GB0.2 GB16 GB17 GB
32K15 GB1.9 GB18 GB19 GB

Weights are the parameter count times the bits per weight of each quantization, the KV cache comes from the layer and attention head counts in the model config at FP16, as Ollama stores it by default. The sizes match Ollama downloads within a few percent.

GPUs that fit Qwen 2.5 7B

In Q4_K_M at 4K, the cheapest GPU server that holds Qwen 2.5 7B is the A16 (16 GB) at about $0.658 an hour, generating about 37 tokens per second. A 24 GB card such as the L4 or A10 holds it in Q4_K_M even at the full 32K context. Unquantized FP16 needs about 16 GB, which starts at the RTX 4000 Ada (20 GB).

Qwen 2.5 7B setupVRAM neededCheapest GPU servers that fit
Q4_K_M at 4K5.9 GB
  • A16 16 GB, $0.658/hr, about 37 tok/s
  • RTX 4000 Ada 20 GB, $0.726/hr, about 66 tok/s
  • L4 24 GB, $1.16/hr, about 55 tok/s
Q4_K_M at 32K7.5 GB
  • A16 16 GB, $0.658/hr, about 37 tok/s
  • RTX 4000 Ada 20 GB, $0.726/hr, about 66 tok/s
  • L4 24 GB, $1.16/hr, about 55 tok/s
Q8_0 at 4K9.3 GB
  • A16 16 GB, $0.658/hr, about 21 tok/s
  • RTX 4000 Ada 20 GB, $0.726/hr, about 38 tok/s
  • L4 24 GB, $1.16/hr, about 31 tok/s
FP16 at 4K16 GB
  • RTX 4000 Ada 20 GB, $0.726/hr, about 20 tok/s
  • L4 24 GB, $1.16/hr, about 17 tok/s
  • A10 24 GB, $1.17/hr, about 27 tok/s

Prices are for the cheapest city of each card, billed by the hour. Speed is generation with Ollama, estimated from memory bandwidth and our runs on the LLM speed benchmark. All cards are on the GPU servers page.

Running Qwen 2.5 7B on a CPU server

Yes, a CPU-only server with 8 GB of RAM holds Qwen 2.5 7B in Q4_K_M at 4K, since it needs about 6.4 GB. On 2 dedicated vCPU expect about 4 tokens per second, slower than reading speed, fine for short answers and batch jobs. On 4 shared vCPU it makes about 4 tokens per second. At the full 32K context the RAM need grows to about 8.0 GB.

CPU serverRAMTokens/s in Q4_K_MPrice
4 shared vCPUHetzner8 GBabout 4$18/mo$0.025/hr
2 dedicated vCPUOVHcloud16 GBabout 4$83/mo$0.114/hr

Qwen 2.5 7B in Ollama

ollama run qwen2.5:7b downloads the Q4_K_M build. Every quantization in the table has its own tag, listed next to its row.

  • Q4_K_Mollama run qwen2.5:7b
  • Q5_K_Mollama run qwen2.5:7b-instruct-q5_K_M
  • Q6_Kollama run qwen2.5:7b-instruct-q6_K
  • Q8_0ollama run qwen2.5:7b-instruct-q8_0
  • FP16ollama run qwen2.5:7b-instruct-fp16

What to know about Qwen 2.5 7B

  • Qwen 2.5 7B holds up to 32K tokens, so the table stops at 32K.
  • At 32K the context cache adds about 1.9 GB on top of about 4.6 GB of Q4_K_M weights.

Frequently asked questions

How much VRAM does Qwen 2.5 7B need?

About 5.9 GB in Q4_K_M at a 4K context, about 9.3 GB in Q8_0 and about 16 GB in FP16. The cheapest GPU that holds it in Q4_K_M is the A16 (16 GB). A longer context adds more: about 7.5 GB in Q4_K_M at 32K.

Can Qwen 2.5 7B run on a CPU without a GPU?

Yes, a CPU-only server with 8 GB of RAM holds Qwen 2.5 7B in Q4_K_M at 4K, since it needs about 6.4 GB. On 2 dedicated vCPU expect about 4 tokens per second, slower than reading speed, fine for short answers and batch jobs. On 4 shared vCPU it makes about 4 tokens per second. At the full 32K context the RAM need grows to about 8.0 GB.

How much memory does Qwen 2.5 7B need for a 32K context?

About 7.5 GB of VRAM or 8.0 GB of RAM in Q4_K_M. The context cache alone takes about 1.9 GB at 32K tokens, next to about 4.6 GB of weights. Ollama uses a 4K context unless you raise num_ctx, so the cache stays small by default.

Similar models

Further reading

VRAM and RAM for other models

Another model, quantization or context? Use the LLM VRAM and RAM calculator