Gemma 4

Guide de déploiement

Exécutez Gemma 4 localement sur votre propre matériel. Plusieurs options de déploiement, des installateurs en un clic aux frameworks de service de niveau production.

Ollama

Le moyen le plus simple d'exécuter Gemma 4 localement. Une commande pour télécharger et servir n'importe quelle variante avec optimisation matérielle automatique.

Installer Ollama

curl -fsSL https://ollama.com/install.sh | sh

Exécuter le modèle

# Gemma 4 31B (Dense) - 最强性能
ollama run gemma4:31b

# Gemma 4 26B (MoE) - 效率优先
ollama run gemma4:26b

# Gemma 4 E4B - 移动/轻量
ollama run gemma4:e4b

# Gemma 4 E2B - 边缘设备
ollama run gemma4:e2b

LM Studio

Application de bureau avec une interface visuelle pour télécharger, configurer et discuter avec les modèles Gemma 4. Idéal pour les débutants.

  1. Download LM Studio from lmstudio.ai
  2. Search for "Gemma 4" in the model browser
  3. Select a quantized version matching your VRAM
  4. Click Download and wait for completion
  5. Start chatting in the built-in interface

vLLM

Moteur de service de production à haut débit avec PagedAttention, batching continu et endpoints API compatibles OpenAI.

pip install vllm
vllm serve google/gemma-4-31b --max-model-len 32768

llama.cpp

Moteur d'inférence C++ optimisé prenant en charge les modèles quantifiés GGUF. Exécutez Gemma 4 sur CPU ou en configurations CPU/GPU mixtes.

# Build llama.cpp
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp && cmake -B build && cmake --build build

# Run with GGUF model
./build/bin/llama-cli -m gemma-4-31b-Q4_K_M.gguf -p "Hello"

MLX

Framework natif Apple Silicon par Apple. Optimisé pour les puces série M avec mémoire unifiée, offrant d'excellentes performances sur le matériel Mac.

pip install mlx-lm
mlx_lm.generate --model google/gemma-4-31b --prompt "Hello"

Besoins en VRAM

Utilisation estimée de VRAM pour chaque variante de modèle à différents niveaux de quantification.

ModelBF16INT8INT4
E2B4 GB2.5 GB1.5 GB
E4B8 GB5 GB3 GB
26B MoE52 GB28 GB16 GB
31B Dense62 GB33 GB18 GB

Télécharger les modèles

Obtenez les poids des modèles Gemma 4 à partir de sources officielles.