Skip to main content
Gemma-3 vision models are Google’s family of open-source multi-modal models that combine visual understanding with powerful language capabilities. Available in multiple sizes, Gemma-3 vision models offer flexibility for different deployment scenarios.

Model Sizes

Gemma-3 vision is available in three parameter sizes:

4B Parameters

Lightweight model for resource-constrained environments

12B Parameters

Balanced model for production deployments

27B Parameters

Largest model for maximum performance

Features

  • Multi-image support: Process multiple images simultaneously
  • High-quality vision encoding: Advanced image understanding capabilities
  • Flexible precision: Support for FP32, FP16, and BF16
  • Efficient architecture: Optimized for both quality and performance
  • Open source: Fully open-source with commercial license

Prerequisites

Gemma-3 vision requires nightly versions of ONNX Runtime and specific dependency versions.

Install Dependencies

1

Install ONNX Runtime GenAI Nightly

2

Install PyTorch and Dependencies

Building Gemma-3 Vision Models

1

Download Base Model

Choose your desired model size and download from Hugging Face:
2

Download Modified ONNX Files

3

Replace Modeling Files

Replace the original files with ONNX-compatible versions:
4

Build ONNX Models

Build INT4 quantized models for optimal performance:
5

Add Configuration Files

Download the required configuration files based on your model size:

Using Gemma-3 Vision Models

Basic Image Understanding

Multi-Image Analysis

Gemma-3 vision can analyze multiple images simultaneously:

Interactive Chat with Vision

Advanced Usage

Batch Processing

Process multiple image-text pairs efficiently:

Structured Output

Generate structured responses (e.g., JSON):

Performance Optimization

Model Size Selection

Choose the right model size for your use case:
Best for:
  • Edge devices
  • Real-time applications
  • Resource-constrained environments
  • Quick prototyping
Performance:
  • Fastest inference
  • Lowest memory usage (~8GB GPU)
  • Good quality for most tasks

Precision Comparison

INT4 quantization is applied automatically during the build process and offers the best trade-off between speed, memory, and quality.

Execution Provider Tips

Example Application: Image Captioning Service

Troubleshooting

If unsure which model size to use:
Ensure configuration files match your model size:

Next Steps

Phi Vision Models

Explore Microsoft’s Phi vision models

Qwen Vision Models

Learn about Qwen’s advanced capabilities

Deployment Guide

Deploy models to production

API Reference

Explore the full API documentation