---
title: "CodeGemma - an official Google release for code LLMs"
description: "CodeGemma is a family of Gemma-based code models from Google: a 2B base model trained only on fill-in-the-middle infilling for fast, low-latency completion, a 7B base model mixing infilling (80%) with natural language, and a 7B instruct model for conversational coding."
url: "https://swe.quest/articles/codegemma-an-official-google-release-for-code-llms-3ae6555e4222e566"
canonical: "https://huggingface.co/blog/codegemma"
source: "Hugging Face"
published: "2024-04-09"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 8
tags: ["llms","ai-coding","inference"]
---

# CodeGemma - an official Google release for code LLMs

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-04-09, 8 min read, Announcement. Original: [https://huggingface.co/blog/codegemma](https://huggingface.co/blog/codegemma)

## Summary

CodeGemma is a family of Gemma-based code models from Google: a 2B base model trained only on fill-in-the-middle infilling for fast, low-latency completion, a 7B base model mixing infilling (80%) with natural language, and a 7B instruct model for conversational coding. All have an 8K context and were trained on an extra 500B tokens. CodeGemma 7B beats most 7B peers except DeepSeek-Coder-7B on HumanEval and MultiPL-E. Practical usage covers the FIM prompt tokens, stopping generation on FIM/file-separator terminators to avoid verbose trailing output, precision choices (bfloat16 vs float16), and 4-bit loading at about 9 GB.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)

## Prerequisites

- Hugging Face Transformers
- LLM text generation basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

CodeGemma, Gemma, Hugging Face Transformers, fill-in-the-middle, HumanEval, Text Generation Inference, Vertex AI

## Related posts

- [Code Llama: Llama 2 learns to code](https://swe.quest/articles/code-llama-llama-2-learns-to-code-bbc6e9367fb26138.md): Hugging Face · 2023-08-25 · Medium · 12 min read · LLMs, AI for coding, Inference & serving, Python, Evaluation
  Code Llama is a family of 7B, 13B and 34B Llama 2 derivatives trained on 500B tokens of code.
- [Code Llama: Meta’s state-of-the-art LLM for coding](https://swe.quest/articles/code-llama-meta-s-state-of-the-art-llm-for-coding-c2f826fd04e42ba1.md): Meta Engineering · 2023-08-24 · Easy · 7 min read · LLMs, AI for coding, Model training
  Code Llama is a code-specialized family of Llama 2 models, built by further training Llama 2 on 500B tokens of code (1T for the 70B model).
- [Welcome Gemma 3: Google's all new multimodal, multilingual, long context open LLM](https://swe.quest/articles/welcome-gemma-3-google-s-all-new-multimodal-multilingual-long-context-open-llm-9610089c9e0bc05e.md): Hugging Face · 2025-03-12 · Medium · 13 min read · LLMs, Inference & serving, Computer vision, Python
  Gemma 3 is Google's open-weight model family in 1B, 4B, 12B and 27B sizes, with 128k context (32k for 1B), image input via a SigLIP encoder on the 4B and larger models, and support for 140+ languages.
- [Replit’s new AI Model now available on Hugging Face](https://swe.quest/articles/replit-s-new-ai-model-now-available-on-hugging-face-3b96faee1bd121e8.md): Replit · 2023-10-10 · Easy · 2 min read · LLMs, AI for coding, Model training, Open source
  Replit Code V1.5 3B is an open code-completion model released on Hugging Face under a license that allows commercial use.
- [StarCoder2-Instruct: Fully Transparent and Permissive Self-Alignment for Code Generation](https://swe.quest/articles/starcoder2-instruct-fully-transparent-and-permissive-self-alignment-for-code-7d548d6a3e65fc89.md): Hugging Face · 2024-04-29 · Hard · 6 min read · Model training, LLMs, AI for coding, Evaluation
  StarCoder2-15B-Instruct is instruction-tuned entirely on data generated by its own base model, with no human annotations or distillation from proprietary LLMs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
