SiliGemma-4-E2B-FormA
an efficient quantized version of Google's language model
2 min readupdated
The SiliGemma-4-E2B-FormA model is an optimized and quantized (compressed) version of the google/gemma-4-E2B-it language model in a special siliquant-hf-v1 format. Most of the weights are compressed using Extended Hamming lattice coding (a mathematical data compression method with error protection), and the embedding table is offloaded to CPU system RAM to save GPU VRAM. The model maintains high text generation accuracy and is suitable for running on consumer hardware with limited video memory, such as laptops with discrete GPUs.
Key features
- A_16-BlockH4 quantization: 276 linear layers are compressed using Extended Hamming lattices with zero parity errors.
- VRAM savings: The token table (Per-Layer Embedding) is kept in system CPU memory, consuming 0 bytes of video memory.
- Custom loader: Running the model requires a custom loading script, as standard transformers do not unpack this format automatically.
- Apache 2.0 license: Inherited directly from the base Google Gemma 4 model.
What you can do
- Deploy locally: Run a text model on a GPU with limited memory (for example, an RTX 3080 Laptop with 8 GB VRAM).
- Verify integrity: Run built-in SHA256 verification scripts and lattice syndrome checks using the supplied manifest.
- Integrate into pipelines: Use the model for text generation, coding tasks, or logic problem-solving using the provided Python example.
Example
from pathlib import Path
import torch
from siligemma_forma_loader import encode_with_bos, load_gemma4_forma_text_model
device = "cuda" if torch.cuda.is_available() else "cpu"
model, tokenizer, receipt_info = load_gemma4_forma_text_model(Path("."), device=device)
prompt_ids = encode_with_bos(tokenizer, "Solve Countdown using +, -, *, /: [5, 7, 2, 3] -> 29")
input_ids = torch.tensor([prompt_ids], dtype=torch.long, device=device)
with torch.inference_mode():
out = model(input_ids=input_ids, use_cache=False)
print("Model loaded successfully")
Read more
DetailsModel archive size: ~6.7 GB (including quantized weights and packed layers).
VRAM usage: peak around 5 GB on the GPU.
Limitations: requires mandatory use of the start-of-sequence token bos_token_id = 2, otherwise generation quality drops.
Training and tracks: a product of Moissanite-Labs research using rigorous verification tests.










Comments