OSAIM
Open Source AI Models

Gemma 2 2B

Compact Gemma variant designed for on-device inference. Trained with knowledge distillation from larger Gemma 2 teachers. Runs comfortably on a phone at Q4.

Parameters
2.6B
Context length
8K
Modality
text
Released
2024-07-31

Memory & hardware

VRAM (fp16)
5.2 GB
VRAM (Q4)
1.6 GB
Recommended
CPU or any GPU
Quantizations
fp16, q8_0, q4_k_m

License: Gemma Terms of Use

SPDX
Commercial use
Yes
Modification
Yes
Redistribution
Yes

Benchmarks

MMLU
51.3
HumanEval
17.7
MATH
11.8
Benchmarks last verified 2026-05-18.

Hosted inference pricing

No hosted pricing listed — this model is currently self-host-only on this site.

Run it yourself

Drop-in commands for the three most common open-source inference paths. The Ollama tag is a best-effort match against the registry; verify the size variant before pulling.

Run Gemma 2 2B locally
Ollama (easiest)
ollama run gemma2:3b
Single-line install + run; uses the official Ollama registry tag for this family.
vLLM (production)
vllm serve google/gemma-2-2b-it
High-throughput hosted inference; one command to expose an OpenAI-compatible HTTP server.
Transformers (Python)
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-2b-it")
model = AutoModelForCausalLM.from_pretrained(
    "google/gemma-2-2b-it", device_map="auto", torch_dtype="auto"
)
Direct PyTorch usage. Pin a torch / cuda version that matches your GPU.
Hugging Face ID: google/gemma-2-2b-it

Related models

Same family or similar size — useful when shopping around.