Instructions to use Rybib/rytability-gemma4-vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Rybib/rytability-gemma4-vision with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Rybib/rytability-gemma4-vision") config = load_config("Rybib/rytability-gemma4-vision") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 1,596 Bytes
1f85279 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ---
license: gemma
base_model: google/gemma-4-E2B-it-qat-q4_0-unquantized
tags:
- mlx
- vision
- gemma4
- image-text-to-text
library_name: mlx
---
# Rytability Gemma 4 Vision Tower
The vision tower for Rytability's Gemma 4 E2B model, published as a separate
download so the app can ship the text weights alone and fetch image support
only for users who want it.
| | |
|---|---|
| File | `model-vision.safetensors` |
| Size | 337,171,954 bytes |
| Tensors | 659 (`vision_tower.*`, `embed_vision.*`) |
| Precision | BF16 (unquantized) |
| sha256 | `5b322b050d1f32f0d52203376c04dfe1fbbcd5e41f743d10cf0febf273fec293` |
| Source | `google/gemma-4-E2B-it-qat-q4_0-unquantized` |
## Why BF16
The tower is downloaded rather than bundled, so it does not count against the
app's on-device size budget. Keeping it at full precision is close to free and
it matters for OCR quality: quantizing to 4-bit costs roughly 17 points of OCR
accuracy to save about 220 MB, which is a bad trade for an app whose scanning
feature reads receipts, handwriting and notes.
## Not interchangeable with the Gemma 3 tower
Gemma 4's vision tower is a different architecture with different tensor names
and shapes. It cannot be paired with Gemma 3 text weights, and Gemma 3 vision
weights cannot be paired with Gemma 4 text weights. The two halves of a model
must be swapped together.
## Usage
The file is loaded alongside matching Gemma 4 E2B text weights in a single
directory; MLX reads every `*.safetensors` in that directory as one model.
## License
Gemma Terms of Use: https://ai.google.dev/gemma/terms
|