7B Models: Llama, Mistral, Gemma RAM Footprint Compared

At 4-bit quantization (Q4_K_M), Llama 7B, Mistral 7B, and Gemma 7B models typically require about 4-5 GB of RAM/VRAM for inference. Mistral 7B is notably efficient, needing approximately 4 GB, while Llama 7B and Gemma 7B generally operate closer to 4.5-5 GB.

The top 3

  1. 7B Models' 4-bit RAM Footprint: Llama, Mistral, Gemma: Comparing 4-bit quantized versions with `llama.cpp`, Llama 2 7B typically requires around 5GB of RAM, Mistral 7B (Q4_K_M) needs approximately 4.37GB on disk and up to 6.87GB max in RAM, while Gemma 7B (Q4_K_M) uses about 4.5GB of RAM.
  2. Quantization's RAM Revolution: 7B Models' Savings: Quantization dramatically reduces the memory footprint of 7B LLMs; for instance, Llama 2 7B's full-precision size of 13.5GB (or 14GB in half-precision) can shrink to approximately 3.5GB to 5GB when quantized to 4-bits, a reduction of 70-75%, making them accessible on less powerful hardware.
  3. Minimum RAM for 7B LLMs: Low-Resource Device Viability: Thanks to `llama.cpp` and aggressive quantization (e.g., 4-bit), 7B parameter models can run on devices with as little as 4-6GB of RAM, enabling local inference even on older laptops, small servers, and even a 4GB RAM Raspberry Pi, though performance varies.

Sources

Open the full topic