Bonus: Top up now and we'll double your first deposit — get x2 credits instantly.

Gemma 2 9B IT: Self-Hosting & Deployment Guide

Gemma 2 9B IT is a small open-weight instruction-tuned model that fits a single consumer GPU.

What is Gemma 2 9B IT?

Gemma 2 9B IT is a small open-weight instruction-tuned model that fits a single consumer GPU, published by Google with open weights at google/gemma-2-9b-it. LLM API does not route this model today, so there is no endpoint or code sample for it here. What this page does give you is the self-hosting picture: published weight sizes, the VRAM each quantisation needs and the commands to serve it yourself. Every figure is read from the public repository and refreshed weekly.

How to run Gemma 2 9B IT yourself

Open weights (gemma), 9.2B parameters. Below: how much memory the weights need at each quantization, which hardware fits them, and the commands to serve it.

Gemma 2 9B IT VRAM requirements

Precision / quantizationWeightsFigureSource
BF16 (full precision)18.5 GBEstimate9.2B params × 2 bytes
FP810.2 GBFile sizeRedHatAI/gemma-2-9b-it-FP8
AWQ 4-bit6.2 GBFile sizehugging-quants/gemma-2-9b-it-AWQ-INT4
MLX 4-bit5.2 GBFile sizemlx-community/gemma-2-9b-it-4bit
GGUF Q8_09.8 GBFile sizebartowski/gemma-2-9b-it-GGUF
GGUF Q4_K_M5.8 GBFile sizebartowski/gemma-2-9b-it-GGUF
GGUF Q2_K3.8 GBFile sizebartowski/gemma-2-9b-it-GGUF

File size = actual download size on Hugging Face. Estimate = parameter count × bytes per weight. Weights only — the KV cache for long contexts needs extra memory; the fit tables below add 15% headroom as a rule of thumb.

GPU requirements: deploy Gemma 2 9B IT on your hardware

HardwareBF16 (full precision)FP8AWQ 4-bitMLX 4-bitGGUF Q8_0GGUF Q4_K_MGGUF Q2_K
NVIDIA H200141 GB1×1×1×1×1×1×1×
NVIDIA H10080 GB1×1×1×1×1×1×1×
NVIDIA A100 80GB80 GB1×1×1×1×1×1×1×
NVIDIA L40S48 GB1×1×1×1×1×1×1×

GPUs needed per variant.

HardwareGGUF Q8_0GGUF Q4_K_MGGUF Q2_K
RTX 509032 GB1×1×1×
RTX 409024 GB1×1×1×
RTX 309024 GB1×1×1×

GGUF via llama.cpp; more cards or CPU offload for larger files.

HardwareGGUF Q8_0GGUF Q4_K_MGGUF Q2_KMLX 4-bit
Mac, 512 GBM3 UltraFitsFitsFitsFits
Mac, 192 GBM2 UltraFitsFitsFitsFits
Mac, 128 GBM4 Max / M3 MaxFitsFitsFitsFits
Mac, 64 GBM4 Pro / MaxFitsFitsFitsFits

Assumes ~75% of unified memory is usable by the GPU.

HardwareBF16 (full precision)FP8AWQ 4-bitMLX 4-bitGGUF Q8_0GGUF Q4_K_MGGUF Q2_K
AWS p5.48xlarge8× H100 · 640 GBFitsFitsFitsFitsFitsFitsFits
AWS p4de.24xlarge8× A100 80GB · 640 GBFitsFitsFitsFitsFitsFitsFits
AWS g6e.12xlarge4× L40S · 192 GBFitsFitsFitsFitsFitsFitsFits
Google Cloud a3-highgpu-8g8× H100 · 640 GBFitsFitsFitsFitsFitsFitsFits
Azure ND H100 v58× H100 · 640 GBFitsFitsFitsFitsFitsFitsFits

Whole-instance GPU memory; public instance specs.

Serve it yourself

pip install -U vllm
vllm serve google/gemma-2-9b-it
pip install 'sglang[all]'
python -m sglang.launch_server --model-path google/gemma-2-9b-it
llama-server -hf bartowski/gemma-2-9b-it-GGUF:Q4_K_M \
  --ctx-size 32768 --n-gpu-layers 99
pip install -U mlx-lm
mlx_lm.generate --model mlx-community/gemma-2-9b-it-4bit --prompt "Hello"

Commands use the official repositories above; vLLM and SGLang expose an OpenAI-compatible endpoint.

Not on LLM.API yet

We do not route this model through our API at the moment. Browse the models you can call today — most workloads have a close match already live.

Not available on LLM API yet

We do not route this model through our API at the moment, so there is no endpoint or code snippet for it yet. Browse the models you can call today — most workloads have a close match already live.

Browse available models

Why run Gemma 2 9B IT on LLM.API?

  • Unified AI Routing

    Reach Gemma 2 9B IT and sibling models through one OpenAI-compatible endpoint.

  • Cost Control

    Production: Compare provider price points and keep spend visible as you scale Gemma 2 9B IT.

  • Reliability Layer

    Retry and route across configured providers when a single upstream blips.

  • Observability

    Trace prompts, tokens, and errors for Gemma 2 9B IT alongside the rest of your stack.

  • Drop-in SDKs

    Keep using familiar OpenAI client patterns with base URL https://api.llmapi.ai/v1.

  • Model Breadth

    Swap Gemma 2 9B IT for chat, media, or embedding alternatives without rewriting auth.

When to Use — When NOT to Use

Use it if...

  • You want to run Gemma 2 9B IT on your own hardware and keep every prompt inside your network
  • The weights are published openly, so you can pin one checkpoint and keep it reproducible
  • You want to fine-tune or quantise the model rather than accept a hosted configuration
  • You are comparing self-hosting cost against a managed endpoint before committing

Avoid if...

  • LLM API does not route this model today, so there is no endpoint here to call
  • You have no GPU capacity: the VRAM figures below are the floor, not a suggestion
  • You want zero operations — serving, scaling and upgrades are yours to run
  • You need image, audio or video input; this checkpoint is text in, text out

What developers say about Gemma 2 9B IT

LMArena#309 · Elo 1207Arena coding#321 · Elo 1174Speed—Sources: LMArena, Artificial Analysis

Summarised from public developer discussions and write-ups. Opinions are the sources’, not LLM.API’s.

  • Developers on Hugging Face report the model is highly competitive, showing high intelligence, good instruction following, and a refined writing style that outperforms previous Google open models and some competitors.
  • Some developers observe the model is unexpectedly slow during inference and has high VRAM usage compared to Llama 8B, likely due to logit soft-capping and half Grouped-Query Attention (GQA).
  • Users have noted limitations including a relatively small 8K context window and occasional difficulty with specific formatting styles like markdown and quotes for roleplaying tasks.

Get one key to every model

Swap your API key. Keep your code.