microsoft · text

Phi-3.5-mini-instruct

microsoft/Phi-3.5-mini-instruct

Phi-3.5-mini-instruct at Q4_K_M is exactly 2,393,232,384 bytes (2.23 GiB / 2.39 GB) — an effective 5.011 bits per weight, not the nominal 4. Its KV cache at 32K is 12.00 GiB.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
3.8B
Architecture
phi3
32 layers
Context
131,072
native (config.json)
License
mit

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ1_S0.78 GiB841,609,9521.762MaziyarPanahi
IQ1_M0.85 GiB917,107,4241.920MaziyarPanahi
IQ2_XS1.07 GiB1,153,037,0242.414MaziyarPanahi
IQ2_M1.23 GiB1,316,395,2962.756bartowski
Q2_K1.32 GiB1,416,204,5122.965MaziyarPanahi
Q2_K1.32 GiB1,416,204,5762.965bartowski
Q2_K_L1.41 GiB1,512,396,5763.166bartowski
IQ3_XS1.51 GiB1,625,175,7763.402MaziyarPanahi
IQ3_XS1.51 GiB1,625,175,8403.402bartowski
Q3_K_S1.57 GiB1,681,798,8803.521MaziyarPanahi
Q3_K_S1.57 GiB1,681,798,9443.521bartowski
IQ3_M1.73 GiB1,855,600,4163.885bartowski
Q3_K_M1.82 GiB1,955,477,2164.094197MaziyarPanahi
Q3_K_M1.82 GiB1,955,477,2804.094197bartowski
IQ4_XS1.92 GiB2,059,853,0244.313197MaziyarPanahi
IQ4_XS1.92 GiB2,059,853,0884.313197bartowski
Q3_K_L1.94 GiB2,087,597,7924.371MaziyarPanahi
Q3_K_L1.94 GiB2,087,597,8564.371bartowski
Q4_02.03 GiB2,182,468,8964.569197bartowski
Q4_K_S2.04 GiB2,188,760,2884.582MaziyarPanahi
Q4_K_S2.04 GiB2,188,760,3524.582bartowski
Q4_K_M2.23 GiB2,393,232,3845.011197cowoho
Q4_K_M2.23 GiB2,393,232,6085.011MaziyarPanahi
Q4_K_M2.23 GiB2,393,232,6725.011197bartowski
Q4_K_L2.30 GiB2,466,338,5925.164bartowski
Q5_K_S2.46 GiB2,641,474,7845.530MaziyarPanahi
Q5_K_S2.46 GiB2,641,474,8485.530bartowski
Q5_K_M2.62 GiB2,815,276,2565.894197MaziyarPanahi
Q5_K_M2.62 GiB2,815,276,3205.894197bartowski
Q5_K_L2.68 GiB2,876,069,6646.021bartowski
Q6_K2.92 GiB3,135,853,2806.565197MaziyarPanahi
Q6_K2.92 GiB3,135,853,3446.565197bartowski
Q6_K_L2.96 GiB3,183,564,5766.665bartowski
Q8_03.78 GiB4,061,222,6248.503197MaziyarPanahi
Q8_03.78 GiB4,061,222,6888.503197bartowski
F3214.24 GiB15,285,057,02432.002bartowski

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0961.50 GiB1.50 GiB32 / 0 / 0
8,1923.00 GiB3.00 GiB32 / 0 / 0
16,3846.00 GiB6.00 GiB32 / 0 / 0
32,76812.00 GiB12.00 GiB32 / 0 / 0
65,53624.00 GiB24.00 GiB32 / 0 / 0
131,07248.00 GiB48.00 GiB32 / 0 / 0

Compare with

same modality, comparable size

Will it run on your card?

full quant x context sweep

Why other calculators give a different number

A parameters × bits ÷ 8 estimate puts Q4_K_M at roughly 2.00 GiB. The real file is 2.23 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from config.json
Layers
32
Attention heads
32
KV heads
32
Head dim
96
Hidden size
3072
Vocab
32,064
Sliding window
262144
SWA period
1
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does Phi-3.5-mini-instruct need?
Q4_K_M is exactly 2,393,232,384 bytes (2.23 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is Phi-3.5-mini-instruct's KV cache?
12.00 GiB at 32K context with an f16 cache, computed per layer. Quantizing the cache to q8_0 roughly halves it, which is often the difference between a context length fitting and not.
Which quantization of Phi-3.5-mini-instruct should I use?
Q4_K_M is the usual default. Pick the largest quantization that fits your card at the context you actually need — the table above gives exact sizes for every one published.