How to run locally
gemma-4-E4B
google · 8.0B · install path for the weights on your own GPU
Quick start
Hugging Face
huggingface-cli download google/gemma-4-E4B
vLLM
vllm serve google/gemma-4-E4B
Prefer the full runbook below if this is your first local load. Specs and VRAM fit live on the listing.
How to run gemma-4-E4B locally without running into memory allocation crashes or broken reasoning outputs.
Verify Your GPU VRAM and Quantization
Before pulling any files, check your available video memory against the model variant you plan to run. If you have an 8GB card, download the Q5_K_M build (6.568 GB) or the official Q4_0 file (5.455 GB). Avoid standard, uncalibrated 4-bit community quants that degrade the Per-Layer Embedding layers.
Users on 12GB cards can safely run Q8_0 or FP8 at 9.737 GB. If you have a 24GB GPU, grab the full FP16 weights directly from the google/gemma-4-E4B repository for maximum fidelity.
Choose a Compatible Inference Engine
Choose an inference runner with explicit support for Gemma 4 architecture quirks, including its distributed embeddings. Ensure your backend is up to date, as older inference engines will fail to parse the vision and audio projection tensors properly.
If you use a modular runtime, verify that the multimodal projector file matches your base model quantization level. Mismatched projection weights will cause image inputs to output garbled tokens.
Execute Your Initial Clean Load
When starting the engine from your terminal, allocate all model layers to your GPU to prevent slow CPU offloading. Set your context limit to the native 4096 tokens to maintain stability during extended multi-turn chats.
Pass parameters into your launcher to establish baseline text execution. A typical configuration looks like this:
--model google-gemma-4-e4b
--ctx-size 4096
--temp 0.6
Run a quick reasoning verification prompt, such as asking the model to solve a step-by-step logic puzzle, before attempting to feed heavy image files.
Optimize Caches Before Ingesting Multimedia
Once text generation is verified, you can attach visual inputs. If your runner provides a flash attention or unified memory flag, enable it immediately. This prevents memory spikes when large image token matrices load into the KV cache.
Keep your input images under 1080p resolution to avoid bloating context memory. If you notice generation speeds dropping significantly during image analysis, reduce the context window allocation or switch to a slightly tighter quantization level like Q4_K_M.