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
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
Quantized
Model tree for Rybib/rytability-gemma4-vision
Base model
google/gemma-4-E2B