Sponsored by Byond Boundrys Consulting - Empowering Ideas, Delivering Results
Google DeepMind Intermediate

CodeGemma

CodeGemma is Google's Gemma-based coding family with 2B and 7B variants for code completion, generation and instruction-following programming tasks.

Coding ModelsText Open Source
In plain English

What is this model and why does it matter?

CodeGemma is Google's Gemma-based coding model family for code completion, code generation and instruction-based coding assistance.

Code completionCode generationProgramming educationLocal coding assistantsIDE experiments
Model overview

CodeGemma: features, use cases and important details

CodeGemma is Google’s coding-focused model family built on Gemma. Google documents three main variants: a 2B pretrained model for fast code completion, a 7B pretrained model for code completion and generation, and a 7B instruction-tuned model for coding chat and instruction following.

Where CodeGemma fits

The family is aimed at code completion, fill-in-the-middle generation, code generation, code discussion and programming education. Google specifically documents formatting tokens for prefix, suffix and middle sections so pretrained CodeGemma models can fill code at a cursor position rather than only continue from the end of a prompt.

Verified model facts

Google initially released CodeGemma on April 9, 2024 and later released CodeGemma v1.1. The models are distributed as open weights under the Gemma terms. The family is text and code in, text and code out, and its standard Gemma-generation configuration uses an 8,192-token context.

Limitations

CodeGemma is not one single checkpoint, so the correct variant matters. The pretrained versions are better suited to completion and infilling, while the instruction-tuned version is designed for natural-language coding requests. Generated code should always be reviewed for correctness, security and dependency assumptions before it is run.

Get started

How to use this model

  1. Choose the 2B pretrained, 7B pretrained or 7B instruction-tuned variant based on the task.
  2. Accept the Gemma terms and download the official weights.
  3. Use the correct CodeGemma prompt format, including FIM tokens for infilling when needed.
  4. Run locally or deploy through a supported cloud environment.
  5. Evaluate generated code before execution or production use.
Copy and try

Example prompts

  • Complete the missing Python function from this prefix and suffix.
  • Explain this Java method and suggest a safer implementation.
  • Generate a small REST endpoint from these requirements.
Capabilities

What it can do

  • Code completion
  • Fill-in-the-middle generation
  • Code generation
  • Code explanation
  • Instruction following
Best for

Practical use cases

  • IDE assistance
  • Code infilling
  • Programming education
  • Code prototyping
Pricing

What does it cost?

Open-weight CodeGemma family under the Gemma terms; no single provider token price applies to the downloadable family.

Simple summaryWeights are downloadable under the Gemma terms. Hosting cost depends on the chosen CodeGemma variant and deployment hardware.

What stands out

  • Multiple model sizes
  • Specialized coding training
  • Official Google documentation
  • Can run locally

Things to consider

  • Older Gemma-based coding family
  • Primarily English natural-language training
  • Variant choice matters for chat versus completion
Limitations

Important restrictions and trade-offs

  • Generated code can contain bugs or security issues
  • Not all variants are instruction tuned
  • Gemma terms apply
SimplifyAITools verdict

Our editorial take

A well-documented lightweight coding family that remains useful for local code completion and education, especially when you need smaller downloadable models.

References

Primary sources

  1. Open source 1 ↗
  2. Open source 2 ↗
  3. Open source 3 ↗