Phi-3-medium-4k-instruct GGUF size and VRAM requirements

General Purpose LLM License: mit ⬇ 5,935 ❤ 39
Parameters13.96B
Context4,096

Phi-3-medium-4k-instruct is a 13.96 billion parameter AI model designed for instruction-following tasks, part of the Phi-3 family developed by Microsoft. It operates under the MIT license, allowing broad usage and modification. The model is optimized for general-purpose reasoning and interactive applications, as indicated by its name and intended deployment scenarios.

Under the hood it uses 40 transformer layers, a hidden size of 5,120, 40 attention heads. It uses grouped-query attention (40 query heads sharing 10 key/value heads), which already trims KV-cache memory compared with full multi-head attention.

To run bartowski/Phi-3-medium-4k-instruct-GGUF locally at a 4,096-token context, its quantized versions need between 5.97 GB (IQ2_M, lowest quality) and 53.59 GB (F32, highest quality) of memory, weights plus KV cache and a system margin included.

For most users the best balance is IQ3_M, needing about 7.61 GB. That means bartowski/Phi-3-medium-4k-instruct-GGUF fits entirely in the VRAM of a 6 GB GPU or larger, running fully on the GPU.

Available GGUF quantizations for bartowski/Phi-3-medium-4k-instruct-GGUF include IQ2_M, Q2_K, Q2_K_L, IQ3_XS, Q3_K_S, IQ3_M, Q3_K_M, IQ4_XS, Q3_K_L, Q3_K_XL, Q4_K_S, Q4_K_M, Q4_K_L, Q5_K_S, Q5_K_M, Q5_K_L, Q6_K, Q6_K_L, Q8_0, F32. The model supports a native context length of up to 4,096 tokens; a longer context grows the KV cache and the memory needed.

→ Guide: How much VRAM do you need?

General Purpose LLM

Recommended Use Cases & Local Setup

General Purpose & Instruction

Ideal for: General knowledge, document summarization, email drafting, language translation, and multi-turn conversational chat.

Ollama

Simple one-line CLI installation running silently in the background

LM Studio

Polished desktop client with one-click model downloads and GPU offloading

Jan.ai

Open-source privacy-focused desktop assistant

Prompting & Sampling Tip: Runs optimally with standard chat templates (ChatML or Llama 3 format). A context window of 4,096 to 8,192 tokens balances memory usage and conversational memory.

GGUF file size and memory by quantization

Compare real GGUF weight sizes, estimated KV cache and total memory for Q4, Q5, Q8 and every quantization published in this repository.

Quant.Bits QualityWeights KVTotal Speed~Verdict
IQ2_M 2.7 Low 4.39 GB 0.78 GB 5.97 GB 91.1 t/s Fits in VRAM
Q2_K 2.95 Low 4.79 GB 0.78 GB 6.37 GB 83.5 t/s Fits in VRAM
Q2_K_L 3.04 Low 4.94 GB 0.78 GB 6.52 GB 81.0 t/s Fits in VRAM
IQ3_XS 3.33 Fair 5.41 GB 0.78 GB 6.99 GB 74.0 t/s Fits in VRAM
Q3_K_S 3.48 Fair 5.65 GB 0.78 GB 7.23 GB 70.8 t/s Fits in VRAM
IQ3_M 3.71 Fair 6.03 GB 0.78 GB 7.61 GB 66.3 t/s Fits in VRAM
Q3_K_M 3.97 Fair 6.45 GB 0.78 GB 8.03 GB 7.8 t/s Offload
IQ4_XS 4.28 Good 6.95 GB 0.78 GB 8.53 GB 7.2 t/s Offload
Q3_K_L 4.29 Good 6.98 GB 0.78 GB 8.56 GB 7.2 t/s Offload
Q3_K_XL 4.37 Good 7.11 GB 0.78 GB 8.69 GB 7.0 t/s Offload
Q4_K_S 4.56 Good 7.41 GB 0.78 GB 8.99 GB 6.7 t/s Offload
Q4_K_M 4.91 Good 7.98 GB 0.78 GB 9.56 GB 6.3 t/s Offload
Q4_K_L 4.98 Good 8.09 GB 0.78 GB 9.67 GB 6.2 t/s Offload
Q5_K_S 5.51 Very good 8.96 GB 0.78 GB 10.54 GB 5.6 t/s Offload
Q5_K_M 5.77 Very good 9.38 GB 0.78 GB 10.96 GB 5.3 t/s Offload
Q5_K_L 5.83 Very good 9.48 GB 0.78 GB 11.06 GB 5.3 t/s Offload
Q6_K 6.56 Excellent 10.67 GB 0.78 GB 12.25 GB 4.7 t/s Offload
Q6_K_L 6.61 Excellent 10.74 GB 0.78 GB 12.32 GB 4.7 t/s Offload
Q8_0 8.5 Excellent 13.82 GB 0.78 GB 15.4 GB 3.6 t/s Offload
F32 32.0 Excellent 52.01 GB 0.78 GB 53.59 GB Insufficient

KV cache computed from the model's exact architecture. Speed is a rough estimate bounded by memory bandwidth.

Frequently asked questions

What kind of model is bartowski/Phi-3-medium-4k-instruct-GGUF?

bartowski/Phi-3-medium-4k-instruct-GGUF is an instruction-tuned chat model with 13.96 billion parameters, based on the phi3 architecture. It is released under the mit license and distributed as GGUF files for local inference.

How much VRAM do you need to run bartowski/Phi-3-medium-4k-instruct-GGUF?

You need about 5.97 GB of VRAM to run bartowski/Phi-3-medium-4k-instruct-GGUF entirely on the GPU using the IQ2_M quantization (at a 4,096-token context). Smaller quantizations lower the requirement at the cost of quality.

Can I run bartowski/Phi-3-medium-4k-instruct-GGUF on an 8 GB GPU?

Yes. With 8 GB of VRAM you can run bartowski/Phi-3-medium-4k-instruct-GGUF fully on the GPU using IQ3_M (about 7.61 GB).

Can I run bartowski/Phi-3-medium-4k-instruct-GGUF on a 16 GB GPU?

Yes. With 16 GB of VRAM you can run bartowski/Phi-3-medium-4k-instruct-GGUF fully on the GPU using Q8_0 (about 15.4 GB).

Can I run bartowski/Phi-3-medium-4k-instruct-GGUF on a 24 GB GPU?

Yes. With 24 GB of VRAM you can run bartowski/Phi-3-medium-4k-instruct-GGUF fully on the GPU using Q8_0 (about 15.4 GB).

What context length does bartowski/Phi-3-medium-4k-instruct-GGUF support?

bartowski/Phi-3-medium-4k-instruct-GGUF supports a native context length of up to 4,096 tokens. A longer context grows the KV cache, so it increases the memory needed to run the model.

What is the best quantization for bartowski/Phi-3-medium-4k-instruct-GGUF?

For bartowski/Phi-3-medium-4k-instruct-GGUF, a strong default is Q4_K_M, which needs about 9.56 GB and keeps most of the quality while roughly halving the memory versus 8-bit. With VRAM to spare, Q5_K_M or Q6_K add a little more quality; if you are tight on memory, a smaller quantization still runs. Pick the highest quantization that fits your VRAM.