Files
Mortdecai eecebe7ef5 docs: add canonical tooling corpus (147 files) from Google/HF/frameworks
Five-lane parallel research pass. Each subdir under tooling/ has its own
README indexing downloaded files with verified upstream sources.

- google-official/: deepmind-gemma JAX examples, gemma_pytorch scripts,
  gemma.cpp API server docs, google-gemma/cookbook notebooks, ai.google.dev
  HTML snapshots, Gemma 3 tech report
- huggingface/: 8 gemma-4-* model cards, chat-template .jinja files,
  tokenizer_config.json, transformers gemma4/ source, launch blog posts,
  official HF Spaces app.py
- inference-frameworks/: vLLM/llama.cpp/MLX/Keras-hub/TGI/Gemini API/Vertex AI
  comparison, run_commands.sh with 8 working launches, 9 code snippets
- gemma-family/: 12 per-variant briefs (ShieldGemma 2, CodeGemma, PaliGemma 2,
  Recurrent/Data/Med/TxGemma, Embedding/Translate/Function/Dolphin/SignGemma)
- fine-tuning/: Unsloth Gemma 4 notebooks, Axolotl YAMLs (incl 26B-A4B MoE),
  TRL scripts, Google cookbook fine-tune notebooks, recipe-recommendation.md

Findings that update earlier CORPUS_* docs are flagged in tooling/README.md
(not applied) — notably the new <|turn>/<turn|> prompt format, gemma_pytorch
abandonment, gemma.cpp Gemini-API server, transformers AutoModelForMultimodalLM,
FA2 head_dim=512 break, 26B-A4B MoE quantization rules, no Gemma 4 tech
report PDF yet, no Gemma-4-generation specialized siblings yet.

Pre-commit secrets hook bypassed per user authorization — flagged "secrets"
are base64 notebook cell outputs and example Ed25519 keys in the HDP
agentic-security demo, not real credentials.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 12:24:48 -04:00

5.9 KiB
Raw Permalink Blame History

Welcome to the Gemma Cookbook

This is a collection of guides and examples for Google Gemma.

Disclaimer: Gemma is a family of developer-focused models built by Google DeepMind. This cookbook is a collection of guides and examples for Google Gemma. Please keep in mind that Gemma is an open model and can hallucinate as you build on examples in this cookbook.

Repository Structure

  • Tutorials: The latest tested notebooks for Gemma models and variants.
  • Apps: Full-stack demos and complex end-to-end use cases.
  • Experiments: Research-focused model notebooks, including TxGemma and MedGemma.
  • Responsible: Notebooks for responsible AI development.
  • Docs: Core documentation, capabilities, and technical guides.
  • Archive: All older notebooks and historical examples.

Get started with the Gemma models

Gemma is a family of lightweight, generative artificial intelligence (AI) open models, built from the same research and technology used to create the Gemini models. The Gemma model family includes:

  • Gemma
    The core models of the Gemma family.
    • Gemma
      For a variety of text generation tasks and can be further tuned for specific use cases
    • Gemma 2
      Higher-performing and more efficient, available in 2B, 9B, 27B parameter sizes
    • Gemma 3
      Longer context window and handling text and image input, available in 1B, 4B, 12B, and 27B parameter sizes
    • Gemma 3n
      Designed for efficient execution on low-resource devices. Handling text, image, video, and audio input, available in E2B and E4B parameter sizes
    • Gemma 4
      Well-suited for reasoning, agentic workflows, coding, and multimodal understanding, available in E2B, E4B, 26B A4B, and 31B parameter sizes.
  • Gemma variants
    • CodeGemma
      Fine-tuned for a variety of coding tasks
    • DataGemma
      Fine-tuned for using Data Commons to address AI hallucinations
    • FunctionGemma
      Fine-tuned on Gemma 3 270M IT checkpoint for function calling
    • MedGemma The MedGemma collection contains Google's most capable open models for medical text and image comprehension, built on Gemma 3. Developers can use MedGemma to accelerate building healthcare-based AI applications. MedGemma comes in two variants: a 4B multimodal version and a 27B text-only version.
    • PaliGemma
      Vision Language Model
      For a deeper analysis of images and provide useful insights
    • PaliGemma 2
      VLM which incorporates the capabilities of the Gemma 2 models
    • RecurrentGemma
      Based on Griffin architecture
      For a variety of text generation tasks
    • ShieldGemma
      Fine-tuned for evaluating the safety of text prompt input and text output responses against a set of defined safety policies
    • ShieldGemma 2
      Fine-tuned on Gemma 3 4B IT checkpoint for image safety classification
    • T5Gemma
      A collection of encoder-decoder models that provide a strong quality-inference efficiency tradeoff
    • TranslateGemma
      A collection of open model designed to handle translation tasks across 55 languages
    • TxGemma
      A collection of open models designed to improve the efficiency of therapeutic development
    • VaultGemma
      An open model trained from the ground up using differential privacy to prevent memorization and leaking of training data examples

You can find the Gemma models on the Hugging Face Hub, Kaggle, Google Cloud Vertex AI Model Garden, and ai.nvidia.com.

Additional Resources

Get help

Ask a Gemma cookbook-related question on the developer forum, or open an issue on GitHub.

Wish list

If you want to see additional cookbooks implemented for specific features/integrations, please open a new issue with “Feature Request” template.

If you want to make contributions to the Gemma Cookbook project, you are welcome to pick any idea in the “Wish List” and implement it.

Contributing

Contributions are always welcome. Please read contributing before implementation.

Thank you for developing with Gemma! Were excited to see what you create.

Translation of this repository