microsoft · text

Phi-3-mini-128k-instruct

microsoft/Phi-3-mini-128k-instruct

Phi-3-mini-128k-instruct at Q4_K_M is exactly 2,393,232,000 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,3441.762qwp4w3hyb
IQ2_XXS0.97 GiB1,042,935,9362.183qwp4w3hyb
IQ2_XS1.07 GiB1,153,036,4162.414qwp4w3hyb
IQ2_XS1.07 GiB1,153,036,5442.414bartowski
IQ2_S1.13 GiB1,215,731,3282.545qwp4w3hyb
IQ2_S1.13 GiB1,215,731,4562.545bartowski
IQ2_M1.23 GiB1,316,394,6242.756qwp4w3hyb
IQ2_M1.23 GiB1,316,395,2642.756bartowski
Q2_K1.32 GiB1,416,204,5442.965bartowski
Q2_K_L1.41 GiB1,512,396,5443.166bartowski
IQ3_XXS1.41 GiB1,513,002,6243.168qwp4w3hyb
IQ3_XXS1.41 GiB1,513,002,7523.168bartowski
IQ3_XS1.51 GiB1,625,175,1683.402qwp4w3hyb
IQ3_XS1.51 GiB1,625,175,8083.402bartowski
IQ3_S1.57 GiB1,681,798,2723.521qwp4w3hyb
Q3_K_S1.57 GiB1,681,798,9123.521bartowski
IQ3_M1.73 GiB1,855,599,7443.885qwp4w3hyb
IQ3_M1.73 GiB1,855,600,3843.885bartowski
IQ3_M1.73 GiB1,855,600,3843.885lmstudio-community
Q3_K_M1.82 GiB1,955,477,2484.094bartowski
IQ4_XS1.92 GiB2,059,852,4164.313qwp4w3hyb
IQ4_XS1.92 GiB2,059,853,0564.313bartowski
IQ4_XS1.92 GiB2,059,853,0564.313lmstudio-community
Q3_K_L1.94 GiB2,087,597,8244.371bartowski
Q3_K_L1.94 GiB2,087,597,8244.371lmstudio-community
IQ4_NL2.03 GiB2,176,176,7684.556qwp4w3hyb
Q4_02.03 GiB2,182,468,2244.569qwp4w3hyb
Q4_K_S2.04 GiB2,188,759,6804.582qwp4w3hyb
Q4_K_S2.04 GiB2,188,760,3204.582bartowski
Q4_K_M2.23 GiB2,393,232,0005.011qwp4w3hyb
Q4_K_M2.23 GiB2,393,232,6405.011lmstudio-community
Q4_K_M2.23 GiB2,393,232,6405.011bartowski
Q4_K_L2.30 GiB2,466,338,5605.164bartowski
Q5_K_S2.46 GiB2,641,474,1765.530qwp4w3hyb
Q5_K_S2.46 GiB2,641,474,8165.530bartowski
Q5_K_M2.62 GiB2,815,275,6485.894qwp4w3hyb
Q5_K_M2.62 GiB2,815,276,2885.894bartowski
Q5_K_M2.62 GiB2,815,276,2885.894lmstudio-community
Q5_K_L2.68 GiB2,876,069,6326.021bartowski
Q6_K2.92 GiB3,135,852,6726.565qwp4w3hyb

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-mini-128k-instruct need?
Q4_K_M is exactly 2,393,232,000 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-mini-128k-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-mini-128k-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.