"""Canonical Gemma 4 call via the google-genai Python SDK (Gemini API). Source: https://ai.google.dev/gemma/docs/core/gemma_on_gemini_api Install: pip install google-genai Env: GEMINI_API_KEY=... (from https://aistudio.google.com/apikey) Hosted model IDs (2026-04): - gemma-4-31b-it - gemma-4-26b-a4b-it The E-series (E2B, E4B) is NOT exposed via the Gemini API — those are on-device-only checkpoints. For them you must self-host (Ollama, llama.cpp, vLLM, MLX). """ from google import genai client = genai.Client() # picks up GEMINI_API_KEY from env response = client.models.generate_content( model="gemma-4-26b-a4b-it", contents="Write a haiku about inference framework fragmentation.", ) print(response.text)