Using Gemma 7B Instruct on Replicate API

Implementation guide · Gemma · Google DeepMind

ServerlessOpen Weights

Replicate API exposes Gemma 7B Instruct through model ID google-deepmind/gemma-7b-it. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.

Last refreshed 2026-04-19. Next refresh: weekly.

Quick Start

  1. 1
    Create an account at Replicate API and generate an API key.
  2. 2
    Use the Replicate API SDK or REST API to call google-deepmind/gemma-7b-it — see the documentation for request format.
  3. 3
    You'll be billed $0.05/1M input, $0.25/1M output tokens. See full pricing.

Code Examples

Install
pip install replicate
API key
REPLICATE_API_TOKEN
Model ID
google-deepmind/gemma-7b-it

Replicate uses "owner/model-name" format (e.g. "meta/meta-llama-3-8b-instruct") for the latest version, or "owner/model-name:version-sha" to pin to a specific version. The REST endpoint splits owner and model-name into the path: /v1/models/{owner}/{model-name}/predictions.

import replicate

# reads REPLICATE_API_TOKEN from env
# google-deepmind/gemma-7b-it format: "owner/model-name" (latest version) or "owner/model-name:version-hash"
output = replicate.run(
    "google-deepmind/gemma-7b-it",
    input={"prompt": "Hello"}
)
# Output is a list or generator depending on the model
print("".join(output))

Pricing on Replicate API

TypePrice (per 1M)
Input tokens$0.05
Output tokens$0.25

Capabilities

Structured Outputs

About Gemma 7B Instruct

Gemma 7B Instruct is a cutting-edge large language model developed by Google DeepMind, boasting 7 billion parameters. As part of the Gemma family, it benefits from the advanced research underpinning Google's Gemini models. This model is optimized for text generation tasks, excelling in areas like question answering and summarization, and it is finely tuned to follow instructions effectively. Despite its compact size, Gemma 7B Instruct performs impressively on benchmarks, making it versatile for deployment across various hardware platforms, from laptops to cloud infrastructure.

Model Specs

Released2024-02-21
Parameters7B
Context8k
ArchitectureDecoder Only
Knowledge cutoff2023-04

Provider

Replicate API

Replicate

San Francisco, California, United States