Highlights
  • New model family: Gemma 4 (Google DeepMind, released April 2026) joins as the fifth family — E2B, E4B, and 12B Instruct, bringing the registry to 24 checkpoints
  • Breaking change, done honestly: UVLM now requires Transformers ≥ 5.15; all four existing families were re-validated on GPU before release, and v3.2.0 remains installable for Transformers 4.x environments
  • Measured, not guessed: Gemma 4’s “effective parameters” hide ~10–16 GB raw checkpoints — this release documents exactly what runs on an 8 GB GPU, and how

Why a major version?

UVLM has followed one rule since the package release: a new model family is a minor version, because it breaks nothing. v4.0.0 breaks that streak for a reason we could not code around: Gemma 4 does not exist in any Transformers 4.x release. We verified this empirically — 4.57.6 is the final version of the 4.x line, and it does not register the gemma4 architecture; support begins in the 5.x line. Adopting the family therefore means lifting the transformers < 5.0.0 cap that UVLM has carried since v3.0.1.

That cap was not decoration. It existed because early Transformers 5.x releases crashed Qwen2.5-VL at load time with a weight-conversion error. So before this release, all four existing families — LLaVA-NeXT, Qwen2.5-VL, Qwen3-VL, InternVL3.5 — were re-validated on GPU under Transformers 5.15, in 4-bit, on real inference tasks. The historical Qwen2.5-VL crash is confirmed fixed: the 7B model loads and answers correctly at full speed. That validation is what makes this a release rather than a gamble.

If your environment must stay on Transformers 4.x, nothing is taken from you: pip install git+https://github.com/perezjoan/UVLM.git@v3.2.0 pins the last 4.x-compatible release, permanently.

What is Gemma 4?

Gemma 4 is Google DeepMind’s latest open multimodal generation, released in April 2026 under Apache 2.0. UVLM v4.0.0 integrates three Instruct checkpoints:

Model  Parameters  Raw checkpoint  Runs on
Gemma 4 E2B Instruct  ~2B effective  ~10 GB  8 GB GPU in FP16 with CPU offload
Gemma 4 E4B Instruct  ~4B effective  ~16 GB Larger-VRAM environments (Colab A100/L4)
Gemma 4 12B Instruct  12B  ~24 GB Larger-VRAM environments (Colab A100/L4)

Notice the third column, because it is this release’s most useful finding. E2B and E4B are “effective”-parameter models: Per-Layer Embeddings give them the compute profile of a 2B/4B model, but the embedding tables push the raw checkpoint far beyond what the name suggests. A “2B” model that downloads 10 GB of weights behaves very differently from Qwen3-VL 2B’s genuinely small footprint — and honest benchmarking infrastructure should say so, with numbers.

Technically, Gemma 4 shares the tokenizing-chat-template pipeline introduced with InternVL3.5, with one addition: Gemma 4 models other than E2B/E4B wrap their output in thought-channel tags even when thinking is disabled, and the backend strips them automatically. As always, the family appeared in the notebook selector with zero interface changes.

What actually runs on a laptop GPU

We validated Gemma 4 on an 8 GB RTX 5060, and the result inverts the usual intuition: FP16 is the low-memory mode. In FP16, the compute-heavy layers stay on the GPU while the PLE embedding tables — lookup-only structures designed to live off-accelerator — offload to system RAM in half precision. Measured: about 17 seconds per image. Slow, but fully functional.

4-bit quantization — normally the memory-saver — fails here, for a subtle reason: offloaded modules are kept in FP32, roughly doubling the RAM requirement, and any further spill to disk is unsupported by bitsandbytes. Rather than leave users with a 200-line traceback, v4.0.0 detects this case and raises a two-sentence error recommending FP16. To support all of this, the loader gained general CPU-offload capability for oversized checkpoints — a change that only permits offload: models that fit entirely on the GPU are placed exactly as before.

Also in this release

A failed model load in the notebooks now invalidates the previously loaded model, so a batch run after a failed load errors out loudly instead of silently benchmarking the wrong checkpoint — a trap we fell into ourselves during validation, and one that the per-model output filenames from v3.2.0 caught. InternVL3.5 users on Transformers 5 will see a harmless “tied weights” warning caused by an upstream config inconsistency; Transformers resolves it correctly.

Getting started

pip install --upgrade --force-reinstall git+https://github.com/perezjoan/UVLM.git

Note: no --no-deps this time — the whole point of the upgrade is that pip pulls Transformers 5.15 for you. Colab users get v4.0.0 automatically on their next session, since the notebook always installs the latest version; the re-validation above is what makes that automatic jump safe. The three-block workflow, consensus validation, chain-of-thought mode, and truncation detection all work with Gemma 4 out of the box.

Where UVLM stands

Five months ago, UVLM was a two-family package. It now supports five families and 24 checkpoints from 1B to 110B parameters — LLaVA-NeXT, Qwen2.5-VL, Qwen3-VL, InternVL3.5, Gemma 4 — behind one interface, one prompt format, one evaluation protocol. Three families were added in three releases without a single notebook edit, each validated on hardware before shipping. That is the registry we will be benchmarking against in upcoming applied work — more on that soon.

Full change log in VERSIONS.txt · Source and releases on GitHub · If you use UVLM in research, please cite our Software paper.

Table of contents