onnxruntime/Gemma-3-ONNX
By onnxruntime · ↓ 90 · ♥ 2 · Updated 2026-02-11
What's in this repo
This page lists the files in onnxruntime/Gemma-3-ONNX, including gemma-3-embedding.onnx, gemma-3-text.onnx, gemma-3-vision.onnx and more.
- 27 ONNX models (.onnx files)
- 117 files, including 49 .json, 27 .onnx, 27 .data, 9 .jinja, 3 .py, 1 .md
- Last updated 2026-02-11
ONNX files
| File | Size | Download |
|---|---|---|
| gemma-3-12b-it/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/gemma-3-embedding.onnx | — | Download |
| gemma-3-12b-it/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/gemma-3-text.onnx | — | Download |
| gemma-3-12b-it/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/gemma-3-vision.onnx | — | Download |
| gemma-3-12b-it/gpu/cuda-bf16-io-int4-rtn-block-32/gemma-3-embedding.onnx | — | Download |
| gemma-3-12b-it/gpu/cuda-bf16-io-int4-rtn-block-32/gemma-3-text.onnx | — | Download |
| gemma-3-12b-it/gpu/cuda-bf16-io-int4-rtn-block-32/gemma-3-vision.onnx | — | Download |
| gemma-3-12b-it/gpu/gpu-fp16-io-int4-rtn-block-32/gemma-3-embedding.onnx | — | Download |
| gemma-3-12b-it/gpu/gpu-fp16-io-int4-rtn-block-32/gemma-3-text.onnx | — | Download |
| gemma-3-12b-it/gpu/gpu-fp16-io-int4-rtn-block-32/gemma-3-vision.onnx | — | Download |
| gemma-3-27b-it/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/gemma-3-embedding.onnx | — | Download |
Showing 10 of 27 .onnx files — see the full file list on the right.
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
Gemma-3 Vision ONNX models
Introduction
This repository hosts the optimized versions of the Gemma-3 vision models to accelerate inference with ONNX Runtime.
Optimized models are published here in ONNX format to run with ONNX Runtime on CPU and GPU across devices, including server platforms, Windows, Linux and Mac desktops, and mobile CPUs, with the precision best suited to each of these targets.
Here are some of the optimized configurations we have added:
- ONNX model for int4 CPU: ONNX model for CPU and mobile using int4 quantization via RTN.
- ONNX model for int4 CUDA: ONNX model for CUDA using int4 quantization via RTN.
- ONNX model for int4 GPU: ONNX model for GPU using int4 quantization via RTN.
Model Run
You can see how to run the examples with ORT GenAI here.
For CPU:
# Download the model directly using the Hugging Face CLI
# Replace `model_name` with one of the following options: `gemma-3-4b-it`, `gemma-3-12b-it`, or `gemma-3-27b-it`
huggingface-cli download onnxruntime/Gemma-3-ONNX --include {model_name}/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir .
# Install the CPU package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai
# Please adjust the model directory (-m) accordingly
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-mm.py -o model-mm.py
python model-mm.py -m {model_name}/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4 -e cpu
For CUDA:
# Download the model directly using the Hugging Face CLI
# Replace `model_name` with one of the following options: `gemma-3-4b-it`, `gemma-3-12b-it`, or `gemma-3-27b-it`
huggingface-cli download onnxruntime/Gemma-3-ONNX --include {model_name}/gpu/cuda-bf16-io-int4-rtn-block-32/* --local-dir .
# Install the CUDA package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai-cuda
# Please adjust the model directory (-m) accordingly
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-mm.py -o model-mm.py
python model-mm.py -m {model_name}/gpu/cuda-bf16-io-int4-rtn-block-32/ -e cuda
For DirectML:
# Download the model directly using the Hugging Face CLI
# Replace `model_name` with one of the following options: `gemma-3-4b-it`, `gemma-3-12b-it`, or `gemma-3-27b-it`
huggingface-cli download onnxruntime/Gemma-3-ONNX --include {model_name}/gpu/gpu-fp16-io-int4-rtn-block-32/* --local-dir .
# Install the DML package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai-directml
# Please adjust the model directory (-m) accordingly
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-mm.py -o model-mm.py
python model-mm.py -m {model_name}/gpu/gpu-fp16-io-int4-rtn-block-32/ -e dml
Model Description
- Developed by: Microsoft
- Model type: ONNX
- License: MIT
- Model Description: This is a conversion of the Gemma-3 vision models for ONNX Runtime inference.
Disclaimer: Model is only an optimization of the base model. Any risk associated with the model is the responsibility of the user of the model. Please verify and test for your scenarios. There may be a slight difference in output from the base model with the optimizations applied.
Model info
Created: 2025-04-18
Updated: 2026-02-11
View on Hugging FaceFiles (117)
Related models
More from onnxruntime
More models
No task type declared.