Prepare and test your skills
Prepare and test your skills
Evaluate Specialized Gemma Variants and Use Cases means matching a Gemma model's specialty to the task and then serving it from Google Cloud. Gemma is a family of open foundation models that can be deployed and served inside Google Cloud through Model Garden (opens in a new tab). Text models handle prompts and responses, CodeGemma handles programming tasks, and PaliGemma handles vision-language tasks that combine images with text.
Gemma variant IDs in Model Garden identify the exact model, version, and size to deploy. Examples include google/gemma3@gemma-3-1b-it, google/gemma3@gemma-3-12b-it, google/gemma2@gemma-2-27b, and google/gemma2@gemma-2-27b-it. The -it suffix marks instruction-tuned versions, which are tuned to follow prompts rather than only continue text. Larger sizes such as 12B or 27B trade more compute for more capability than the 1B and 2B models, while PaliGemma is used for tasks such as image captioning.
Deploying a Gemma model to an endpoint creates a serving endpoint that hosts the model and answers prediction requests. Model Garden verifies a deployment configuration for each model, so the same model can be deployed from the Google Cloud console or programmatically through the SDK, gcloud, REST, or Terraform. Deployment through Gemini Enterprise Agent Platform (opens in a new tab) follows a fixed order:
model_garden.list_deployable_models or gcloud ai model-garden models list --model-filter=gemma, then record the model ID to deploy.machine_type="g2-standard-48", accelerator_type="NVIDIA_L4", and accelerator_count=4, and accepting the end-user license agreement.After deployment, the endpoint is identified by a project ID, a region, and an endpoint ID. You can find the endpoint ID in the console under Online prediction > Endpoints or by running gcloud ai endpoints list --region=ENDPOINT_REGION --filter=display_name=ENDPOINT_NAME.
Running inference on a deployed endpoint sends a prompt to the endpoint and returns the model's text response. The client builds a prediction request that wraps the prompt and its parameters, then calls predict on the endpoint path projects/PROJECT_ID/locations/ENDPOINT_REGION/endpoints/ENDPOINT_ID. The sample configuration uses max_tokens of 1024, temperature of 0.9, top_p of 1.0, and top_k of 1. These parameters control response length and randomness. The SDK is available for Python (google-cloud-aiplatform>=1.64 with protobuf>=5.28), Node.js (@google-cloud/aiplatform), Java with Maven or Gradle, and Go, and each language uses the Protocol Buffers library to convert the input dictionary into the JSON format the API expects.
Serving containers and tuning for Gemma determine where the model runs and how its behavior is adjusted. Different serving containers support different workloads, while Workbench fine-tuning notebooks adjust a model's behavior for a specific use case rather than relying only on prompting. Serving on Cloud TPUs (opens in a new tab) and Cloud GPUs uses these options:
| Option | What it serves | Where it runs |
|---|---|---|
| Hex-LLM | Open models, including Gemma | Cloud TPUs |
| vLLM | Text-only and multimodal language models | Cloud GPUs |
| xDiT | Image and video generation | Cloud GPUs |
| Hugging Face DLC for PyTorch | Multiple LoRA adapters, and PaliGemma for image captioning | Cloud GPUs |
Serving can also use Spot VMs or a Compute Engine reservation to control cost and capacity.
Controlling access to Gemma models uses a Model Garden organization policy that limits which models a team may deploy. An administrator can set the policy at the organization, folder, or project level. The policy can allow access to only the models that have been vetted and deny access to all others, so the boundary of allowed variants is enforced before deployment rather than after.
Exam tip: PaliGemma is the vision-language variant for tasks like image captioning, while the numbered Gemma models such as 1B, 2B, 12B, and 27B are text models, with the -it versions instruction-tuned for prompt-following.
Distinguish Gemma Architecture and Open-Weight Benefits means understanding how Gemma differs from a fully managed model. Gemma is a family of small, lightweight open models offered in Model Garden (opens in a new tab), Google Cloud's catalog for finding and deploying models. Unlike a fully managed model that only runs behind a vendor API, an open model can be self-deployed, which means you place it on infrastructure you control inside your own Google Cloud project and virtual private cloud (VPC) network.
Open models and self-deployment boundaries define who runs the model and where traffic stays. A self-deployable open model is a model you deploy yourself rather than consume as a hosted service. Self-deployed models are not serverless: you must deploy them on Gemini Enterprise Agent Platform before you can use them, and once deployed they run securely within your Google Cloud project and VPC network. This boundary matters because the model, its endpoint, and the network path between your applications and the model all stay inside your project instead of crossing into a shared service. To find self-deployable open models in Model Garden, open the Features filter and select Open models and One-click deployment.
Exam tip: When a model is offered both ways, the managed API model card has API Service in its name, while the self-deployable model card does not.
Members of the Gemma model family share a small, lightweight design but specialize in different tasks. Choosing within the family means matching the model to the work, from general text to code, safety, vision, and medical data:
A decision tree that branches on code, image-plus-text, and text goals to match a task to CodeGemma, PaliGemma, MedGemma, MedSigLIP, TxGemma, ShieldGemma 2, T5Gemma, or Gemma.
These variants are described in Google models (opens in a new tab) documentation, and the model card tells you whether you are looking at a managed or self-deployable offering.
Self-deployable versus managed API offerings differ in who runs the model, where it runs, and how applications reach it. The same open model may be offered in two ways, and the model card tells you which one you are looking at. Deploying a Gemma open model means sending it to a Gemini Enterprise Agent Platform endpoint through one-click deployment, which you can perform from the Google Cloud console or with the Agent Platform SDK for Python. Model Garden also supports deploying supported models with custom weights stored in a Cloud Storage bucket, which is a Preview feature.
| Offering | Who runs the model | Where it runs | How you reach it |
|---|---|---|---|
| Managed API (MaaS) | Google-hosted service | API call | |
| Self-deployable open model | You | Your Google Cloud project and VPC network | Endpoint you deploy on Gemini Enterprise Agent Platform |
Once a model is deployed, you can serve it with popular serving frameworks such as vLLM (opens in a new tab), Hex-LLM, SGLang, TGI, or TensorRT-LLM without building and maintaining your own container images. Build a custom vLLM container instead when you need maximum flexibility over the container image, including dependencies and configurations, or when your model requires unique pre-processing or post-processing steps that prebuilt containers do not support.
Assess Deployment and Responsible AI Integration means using Model Garden to deploy Gemma while applying safety and governance controls. Gemma deployment in Google Cloud centers on Vertex AI Model Garden (opens in a new tab), which is an AI/ML model library for discovering, testing, customizing, and deploying models. Responsible AI integration adds security scanning, access control, evaluation, and safety-focused models so Gemma implementations can be safe, transparent, and ethically aligned.
Finding Gemma in Vertex AI Model Garden starts with browsing a shared catalog of Google, partner, and open-source models. Model Garden provides a consistent deployment pattern with built-in integration for tuning, evaluation, and serving. To access Gemma, open the Model Garden page in the Google Cloud console, then filter models by tasks, model collections, providers, and features. Each model has a model card that explains what it does. Model Garden organizes models into three categories:
Gemma models come in several sizes, and each size is available in pretrained, instruction-tuned, and mix fine-tuned versions. Lower parameter sizes reduce resource requirements and increase deployment flexibility. After selecting Gemma, deploy it using the Python SDK, CLI, REST API, or console. Gemma can also be used with other Google Cloud products such as Google Kubernetes Engine (GKE), Dataflow, and Colab.
Deployment paths for Gemma in ABAP SDK specify different classes and inputs for Agent Platform versus Cloud Run. Gemma can be deployed on Agent Platform, deployed on Cloud Run, or accessed through Gemini API. The Agent Platform SDK for ABAP uses a different class for each path, as documented in the guide to invoke Gemma models (opens in a new tab):
| Deployment path | SDK class | Required inputs |
|---|---|---|
| Agent Platform | /GOOG/CL_GEMMA_ON_VERTEXAI | Model key, project number, region, endpoint ID |
| Cloud Run or Gemini API | /GOOG/CL_GEMMA_ON_CLOUDRUN | Model key |
Before sending requests, enable the required APIs, deploy the Gemma model if needed, install the SDK, set up authentication, and configure the service mapping. Then instantiate the model class and call methods such as GENERATE_CONTENT to send a text prompt, provide system instructions, set generation configuration, pass multimodal input, or count tokens. Pricing for open-source models in Model Garden charges for model tuning, model deployment, and Colab Enterprise.
Responsible AI controls for Gemma implementation combine scanning, access limits, transparency, and evaluation. Model Garden performs security scanning: Google tests and benchmarks serving and tuning containers, and applies active vulnerability scanning to container artifacts. Third-party models from featured partners undergo model checkpoint scans for authenticity. Third-party models from HuggingFace Hub are scanned by HuggingFace and a third-party scanner for malware, pickle files, Keras Lambda layers, and secrets. Models deemed unsafe are flagged and blocked from deployment. Models deemed suspicious or capable of executing remote code are indicated in Model Garden but can still be deployed, so a thorough review is recommended before deployment.
Access to specific models is controlled by a Model Garden organization policy set at the organization, folder, or project level. This policy can allow access to vetted models and deny access to all others. Transparency comes from model cards, which describe each model, and from filters for tasks, model collections, providers, and features. Evaluation is supported through the generative AI evaluation service (opens in a new tab), such as evaluating Gemma 2. Safety-focused models such as ShieldGemma 2 can run local inference with Hugging Face transformers. Specialized variants like MedGemma and MedSigLIP can be served in Gemini Enterprise Agent Platform.
Exam tip: Unsafe models are blocked from Model Garden deployment, but suspicious or remote-code-capable models are only flagged and can still be deployed, so review them before use.
-it marks instruction-tuned Gemma text models.predict requests on the path projects/PROJECT_ID/locations/ENDPOINT_REGION/endpoints/ENDPOINT_ID.Self-deployable Gemma open models are deployed by you on Gemini Enterprise Agent Platform and run inside your own Google Cloud project and virtual private cloud (VPC) network, and you reach them through an endpoint you deploy. Managed API offerings run on a Google-hosted service operated by Google, and you reach them by API call.
PaliGemma is the vision-language variant for tasks like image captioning that combine images with text, while CodeGemma is the lightweight open model for coding tasks including code completion, generation, and understanding. Numbered Gemma text models such as 1B, 2B, 12B, and 27B handle prompts and responses, with the -it versions instruction-tuned to follow prompts rather than only continue text.
Deploying a Gemma model creates a serving endpoint that hosts the model and answers prediction requests, following a fixed order of listing the deployable models and recording the model ID, viewing the deployment specifications for machine type, accelerator type, and container image URI, then deploying to an endpoint and accepting the end-user license agreement. After deployment the endpoint is identified by project ID, region, and endpoint ID, and running inference sends a prompt in a prediction request that calls predict on the endpoint path and returns the text response.
An administrator can set a Model Garden organization policy at the organization, folder, or project level to allow access to only vetted models and deny access to all others. The boundary of allowed variants is enforced before deployment rather than after, while Model Garden blocks models deemed unsafe from deployment and only flags models deemed suspicious or capable of executing remote code so they can still be deployed after review.
An enterprise development team is selecting specialized, lightweight open models to support two distinct initiatives:
Which combination of specialized Gemma variants directly addresses the requirements of both initiatives?
Last updated