Skip to content
ModelListedExternal
Download

Gemma 4 E4B RotorQuant GGUF Q8 0

> [!WARNING] > Fork compatibility (2026-07-07): the llama-cpp-turboquant fork is currently based on a llama.cpp revision that predates gemma4 architecture support — it fails with unknown model architecture: 'gemma4'...

KindOtherBase modelgoogle/gemma-4-E4BVersionRevision b11a982

Model source

Kind
Other
File size
7.48 GB
Base model
google/gemma-4-E4B
Version
vRevision b11a982
Updated
Sep 18, 2026
Downloads
136
Tasks
Captioning
Source
Hugging Face

Source description

[!WARNING] Fork compatibility (2026-07-07): the llama-cpp-turboquant fork is currently based on a llama.cpp revision that predates gemma4 architecture support — it fails with unknown model architecture: 'gemma4' and cannot run this model at all. Until the fork rebases, use mainline llama.cpp (which loads this GGUF fine with standard KV-cache types); the RotorQuant/TurboQuant KV-cache options are not usable with gemma-4 yet.

[!TIP] KV-cache quantization without any fork (recommended, 2026): upstream llama.cpp/Ollama now cover this natively — use -ctk q8_0 -ctv q8_0 (~half KV memory, negligible quality loss: perplexity +0.002–0.05) or -ctk q4_0 -ctv q4_0 (~quarter memory, ≈7.6% perplexity increase). In Ollama: OLLAMA_KV_CACHE_TYPE=q8_0 with OLLAMA_FLASH_ATTENTION=1. Keep K and V types symmetric to stay on the fast fused Flash-Attention path. Since April 2026, mainline llama.cpp also applies Hadamard rotation to KV activations (PR #21038), which greatly improves low-bit KV quality (opt-out: LLAMA_ATTN_ROT_DISABLE=1).

The RotorQuant/TurboQuant fork flow below is experimental/legacy: the TurboQuant llama.cpp PR was closed without merging (June 2026) and the fork is unmaintained relative to mainline. It is NOT required to use this model.

gemma-4-E4B-RotorQuant-GGUF-Q8_0

GGUF Q8_0 weight-quantized variant of google/gemma-4-E4B optimised for use with RotorQuant KV cache compression via a dedicated llama.cpp fork.

Important: RotorQuant KV cache types (planar3, iso3) are not available in upstream llama.cpp, standard Ollama, or LM Studio. They require a specific llama.cpp fork. The GGUF file itself is a standard GGUF and works with any llama.cpp-compatible runtime using normal KV cache types (f16, q8_0, q4_0, etc.).

Hardware compatibility

DeviceVRAM / RAMRecommendation
CPU host with ≥8 GB RAM~4.4 GBworks via llama.cpp; slower than GPU but no accelerator required
Apple Silicon (Metal)~4.8 GBllama.cpp Metal backend; fast on M-series unified memory
NVIDIA GPU (partial offload)split between GPU + RAMoffload as many layers as VRAM allows; rest on CPU

Overview

This model combines two independent compression techniques:

TechniqueWhat it doesRequirement
GGUF Q8_0 weight quantizationReduces model size from ~8 GB (BF16) to ~4.0 GBAny llama.cpp-compatible runtime
RotorQuant KV cache compression — block-diagonal Clifford-algebra rotors for 3-bit KV cache (--cache-type-k iso3 --cache-type-v iso3)Block-diagonal rotations / random rotation for compressed KV cachellama-cpp-turboquant fork only

Quickstart

Option A — RotorQuant KV cache (experimental fork — not required)

You must build from the RotorQuant-enabled llama.cpp fork:

# Clone and build the fork
git clone https://github.com/johndpope/llama-cpp-turboquant.git
cd llama-cpp-turboquant && git checkout feature/planarquant-kv-cache

# CUDA (Windows/Linux)
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j

# Metal (Apple Silicon)
cmake -B build -DGGML_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j

# Run with RotorQuant KV cache
./build/bin/llama-cli -m gemma-4-E4B-RotorQuant-GGUF-Q8_0.gguf \
  --cache-type-k iso3 --cache-type-v iso3 \
  -ngl 99 -fa \
  -p "Explain quantum computing"

# Or run as a server
./build/bin/llama-server -m gemma-4-E4B-RotorQuant-GGUF-Q8_0.gguf \
  --cache-type-k iso3 --cache-type-v iso3 \
  -ngl 99 -fa --jinja

Option B — With standard llama.cpp / LM Studio / Ollama

The GGUF works as a normal quantised model. You won't get RotorQuant-specific KV cache benefits, but standard KV cache quantization (q8_0, q4_0) still reduces VRAM significantly.

llama.cpp (upstream)

llama-cli -m gemma-4-E4B-RotorQuant-GGUF-Q8_0.gguf \
  --cache-type-k q8_0 --cache-type-v q8_0 \
  -ngl 99 -fa \
  -p "Explain quantum computing"

LM Studio

  1. Download the GGUF file and load in LM Studio.
  2. Enable Developer Mode (Settings → Developer).
  3. In the model loader's advanced settings, set Flash Attention to ON.
  4. Set K Cache Quantization and V Cache Quantization to q8_0 (or q4_0 for more aggressive VRAM savings).
  5. Note: LM Studio does not currently support RotorQuant's iso3 cache types. Track this feature request for updates.

Ollama

# Standard Ollama does not support RotorQuant cache types.
# Use with default or q8_0 KV cache via OLLAMA_KV_CACHE_TYPE=q8_0
OLLAMA_KV_CACHE_TYPE=q8_0 OLLAMA_FLASH_ATTENTION=1 ollama run majentik/gemma-4-E4B-RotorQuant-GGUF-Q8_0

Specifications

PropertyValue
Base Modelgoogle/gemma-4-E4B
ArchitectureDense transformer (Edge optimised)
Parameters~4B
Context Length128K
Weight QuantizationGGUF Q8_0 (near-lossless 8-bit, reference quality)
Original Size (BF16)~8 GB
Quantized File Size~4.0 GB
KV Cache (RotorQuant)3-bit via --cache-type-k iso3 --cache-type-v iso3 (fork only)
KV Cache (standard)q8_0, q4_0, f16, etc. (any llama.cpp runtime)
Licenseapache-2.0
ModalitiesText + Image + Audio
Compatible Runtimesllama.cpp, LM Studio, Ollama, koboldcpp

What is RotorQuant?

RotorQuant is a KV cache compression method based on Clifford algebra (Cl(3,0)) rotors. It was developed as a faster, more parameter-efficient alternative to Google's TurboQuant (ICLR 2026).

Instead of applying a dense d×d random orthogonal rotation matrix (as TurboQuant does), RotorQuant uses lightweight block-diagonal rotations — independent 2D/4D rotations per pair/quartet — achieving O(d) complexity instead of O(d log d), fully parallelisable with no inter-element dependencies.

Benchmarks from the RotorQuant repository (Llama 3.1 8B, RTX 5090 — results will vary by model and hardware):

MetricRotorQuant (iso3)TurboQuantStandard q4_0
Prefill Speed3,822 tok/s722 tok/s—
Decode Speed119 tok/s93 tok/s—
Perplexity (PPL)6.917.07—
KV Compression~5× vs FP16~5× vs FP16~4× vs FP16
Rotation Parameters4 per rotor16,384 per matrixN/A

Note: These benchmarks are from the RotorQuant repository using Llama 3.1 8B on an RTX 5090. Performance on gemma-4-E4B will differ. Independent benchmarks for this specific model are welcome — please open a discussion if you have results to share.

Current Status of RotorQuant in the Ecosystem

RuntimeRotorQuant SupportStandard KV Quant
llama.cpp (upstream)❌ Not merged✅ q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1
llama-cpp-turboquant fork✅ planar3, iso3✅ All standard types
LM Studio❌ Requested✅ Via advanced settings
Ollama❌ Not supported✅ Via OLLAMA_KV_CACHE_TYPE
koboldcpp❌ Not supported✅ Standard types

Recommended Settings

For VRAM-constrained setups, standard q8_0 KV cache quantization already halves KV cache memory with negligible quality impact. Flash Attention should always be enabled — it is required for V cache quantization and improves memory efficiency regardless.

VRAMSuggested Configuration
24 GB (RTX 4090)Q8_0 + q8_0 KV cache + Flash Attention, 8K–16K context
16 GBQ8_0 + q4_0 KV cache + Flash Attention, 4K–8K context
48+ GBQ8_0 + f16 KV cache, full 32K+ context

See Also

Quant trade-off (GGUF lane)

QuantApprox sizeUse caseRecommendation
Q2_K~2.2 GBLossy, low-RAM CPU/edgeResource-constrained inference
Q3_K_M~2.4 GBSmaller-than-Q4, modest quality dropEdge devices with ~16 GB RAM
IQ4_XS~2.1 GBImportance-quant 4-bit, smaller than Q4_K_MBest size/quality at 4-bit
Q4_K_M~3.0 GBBalanced defaultRecommended for most users
Q5_K_M~3.1 GBHigher fidelity than Q4Quality-sensitive applications
Q6_K~3.6 GBApproaching FP16 qualityHigh-fidelity CPU/edge
Q8_0~4.1 GBNear-lossless referenceFidelity-critical work
MXFP4_MOE~2.2 GBMicroscaling FP4 (MoE-aware)vLLM / transformers users

(Current variant — Q8_0 — is bolded.)

Variants in this family

(Showing 14 sibling variants under majentik/gemma-4-e4b-*. The current variant — RotorQuant-GGUF-Q8_0 — is bolded.)

VariantRuntimeApprox sizeUse case
RotorQuantruntime modifiern/aKV-cache root (weight-agnostic)
RotorQuant-GGUF-IQ4_XSllama.cpp~3.4 GBLossy 4-bit, low-RAM CPU/edge
RotorQuant-GGUF-Q2_Kllama.cpp~2.4 GBLossy, low-RAM CPU/edge
RotorQuant-GGUF-Q3_K_Mllama.cpp~3.1 GBSmaller 3-bit, CPU-friendly
RotorQuant-GGUF-Q4_K_Mllama.cpp~4.4 GBBalanced default
RotorQuant-GGUF-Q5_K_Mllama.cpp~5.3 GBHigher fidelity, more RAM
RotorQuant-GGUF-Q8_0llama.cpp~8.4 GBNear-lossless reference
RotorQuant-MLX-2bitmlx-lm~1.3 GBApple Silicon, smallest
RotorQuant-MLX-4bitmlx-lm~2.5 GBApple Silicon balanced
RotorQuant-MLX-8bitmlx-lm~4.7 GBApple Silicon reference
TurboQuantruntime modifiern/aKV-cache root (weight-agnostic)
TurboQuant-MLX-2bitmlx-lm~1.3 GBApple Silicon, smallest
TurboQuant-MLX-4bitmlx-lm~2.5 GBApple Silicon balanced
TurboQuant-MLX-8bitmlx-lm~4.7 GBApple Silicon reference

Sources

1 source
Hugging FacePrimaryVersion b11a982f5da431113af62e7a2749c0b399787af6
huggingface.co/majentik/gemma-4-E4B-RotorQuant-GGUF-Q8_0/tree/b11a982f5da431113af62e7a2749c0b399787af6

Verified Sep 18

Model artifacts

1 artifact

gemma-4-E4B-RotorQuant-Q8_0.gguf

gguf · 7.48 GB · SHA-256 6ce4efb80568…5b07 · Hugging Face

Download

Source excerpts

2 excerpts

--- license: apache-2.0 base_model: google/gemma-4-E4B tags: - gguf - rotorquant - kv-cache-quantization - gemma - gemma4 - edge - llama-cpp - quantized library_name: gguf pipeline_tag: image-text-to-text --- > [!WARNING] > **Fork compatibility (2026-07-07):** the `llama-cpp-turboquant` fork is currently based on a llama.cpp revision that **predates `gemma4` architecture support** — it fails with `unknown model architecture: 'gemma4'` and cannot run this model at all. Until the fork rebases, use **mainline llama.cpp** (which loads this GGUF fine with standard KV-cache types); the RotorQuant/TurboQuant KV-cache options are not usable with gemma-4 yet. <!-- gemma4-fork-note --> > [!TIP] > **KV-cache quantization without any fork (recommended, 2026):** upstream > llama.cpp/Ollama now cover this natively — use `-ctk q8_0 -ctv q8_0` > (~half KV memory, negligible quality loss: perplexity +0.002–0.05) or > `-ctk q4_0 -ctv q4_0` (~quarter memory, ≈7.6% perplexity increase). In > Ollama: `OLLAMA_KV_CACHE_TYPE=q8_0` with `OLLAMA_FLASH_ATTENTION=1`. Keep > K and V types symmetric to stay on the fast fused Flash-Attention path. > Since April 2026, mainline llama.cpp also applies Hadamard rotation to > KV activations ([PR #21038](https://github.com/ggml-org/llama.cpp/pull/21038)), > which greatly improves low-bit KV quality (opt-out: > `LLAMA_ATTN_ROT_DISABLE=1`). > > The RotorQuant/TurboQuant fork flow below is **experimental/legacy**: the > TurboQuant llama.cpp PR was closed without merging (June 2026) and the fork > is unmaintained relative to mainline. It is NOT required to use this model. <!-- kv-upstream-note --> # gemma-4-E4B-RotorQuant-GGUF-Q8_0 GGUF Q8_0 weight-quantized variant of [google/gemma-4-E4B](https://huggingface.co/google/gemma-4-E4B) optimised for use with **RotorQuant** KV cache compression via a dedicated llama.cpp fork. > **Important:** RotorQuant KV cache types (`planar3`, `iso3`) are **not** available in upstream llama.cpp, standard Ollama, or LM Studio. > They require a [specific llama.cpp fork](https://github.com/johndpope/llama-cpp-turboquant/tree/feature/planarquant-kv-cache). > The GGUF file itself is a standard GGUF and works with any llama.cpp-compatible runtime using normal KV cache types (f16, q8_0, q4_0, etc.). ## Hardware compatibility | Device | VRAM / RAM | Recommendation | | --- | --- | --- | | CPU host with ≥8 GB...

Source context: 136 downloads · 0 likes · Pipeline image-text-to-text · Library gguf · Repo majentik/gemma-4-E4B-RotorQuant-GGUF-Q8_0