Skip to main content

Gemma open-weight LLM library from Google DeepMind.

Project description

Gemma

Unittests PyPI version Documentation Status

Gemma is a family of open-weights Large Language Model (LLM) by Google DeepMind, based on Gemini research and technology.

This repository contain the implementation of the gemma PyPI package. A JAX library to use and fine-tune Gemma.

For examples and uses-cases, see our documentation. Please report issues and feedback in our GitHub.

Installation

  1. Install JAX for CPU, GPU or TPU. Follow instructions at the JAX website.

  2. Run

    pip install gemma
    

Examples

Here is a minimal example to have a multi-turn, multi-modal conversation with Gemma:

from gemma import gm

# Model and parameters
model = gm.nn.Gemma3_4B()
params = gm.ckpts.load_params(gm.ckpts.CheckpointPath.GEMMA3_4B_IT)

# Example of multi-turn conversation
sampler = gm.text.ChatSampler(
    model=model,
    params=params,
    mult_turn=True,
)

prompt = """Which of the 2 images do you prefer ?

Image 1: <start_of_image>
Image 2: <start_of_image>

Write your answer as a poem."""
out0 = sampler.chat(prompt, images=[image1, image2])

out1 = sampler.chat('What about the other image ?')

Our documentation contain various Colabs and tutorial, including:

Additionally, our examples/ folder contain additional scripts to fine-tune and sample with Gemma.

Learn more about Gemma

Downloading the models

To download the model weights. See our documentation.

System Requirements

Gemma can run on a CPU, GPU and TPU. For GPU, we recommend a 8GB+ RAM on GPU for the 2B checkpoint and 24GB+ RAM on GPU for the 7B checkpoint.

This is not an official Google product.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemma-3.0.1.tar.gz (80.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemma-3.0.1-py3-none-any.whl (122.1 kB view details)

Uploaded Python 3

File details

Details for the file gemma-3.0.1.tar.gz.

File metadata

  • Download URL: gemma-3.0.1.tar.gz
  • Upload date:
  • Size: 80.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for gemma-3.0.1.tar.gz
Algorithm Hash digest
SHA256 bd25b59a2648bdc533d132c38ac578a2a30ad8d79a78c6660f1409a5bfc0b98b
MD5 5c3cdbd6420ceb3367323e0eda6e7869
BLAKE2b-256 721b86af0b3a5c1f740b16a31563d1b8c791abbc98667e108e0207171d97a5a9

See more details on using hashes here.

File details

Details for the file gemma-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: gemma-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 122.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for gemma-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3dccb9423464bc43a9baf8d1b9f544cdd05f5a3965e7db54ab7b4cb4bbafedf1
MD5 5ba8729a36d22d71dcf6225e8ab40b6e
BLAKE2b-256 c1908364157cdb93e9cb427c18455b4353bbf5bc5f1dead988186112aae75b1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page