ProductsNEWS BRIEFING

How to run supervised and distillation fine-tuning on open models in Google Cloud

6 min read

88Z AI, 28 November — Google Cloud’s Gemini Enterprise Agent Platform documentation explains supervised and distillation fine-tuning for open models. The distillation page currently lists only GLM 5.2 MaaS as the teacher, with Qwen 3 and Gemma 3 IT as students; supervised fine-tuning covers a wider set including Llama, Gemma, and Qwen. Hugging Face CEO Clement Delangue commented on the documentation on X.

At a glance

  • The open-model distillation page currently lists only teacher GLM 5.2 MaaS, with Qwen 3 and Gemma 3 IT as students
  • Distillation training data may be prompts only, but the validation set must include ground-truth completions; jobs are submitted with the GenAI SDK DISTILLATION method
  • Supervised fine-tuning covers a wider set including Llama, Gemma, and Qwen, with FULL or PEFT_ADAPTER modes, and is separate from Gemini Distillation Service

What the documentation covers

On X, Hugging Face CEO Clement Delangue wrote that distillation is good and healthy in AI, that it is one of the few things limiting extreme concentration of power, capabilities and wealth, and that he was glad to see Google promoting it. The post included a screenshot of Google Cloud’s page “Supervised and distillation fine-tuning for open models.” That page, in Gemini Enterprise Agent Platform, explains how to run supervised fine-tuning (SFT) and distillation fine-tuning on open models such as Llama 3.1. Unless stated otherwise, its instructions apply to both methods. Distillation means you specify a stronger teacher model to generate responses, then use those responses to tune a smaller student. The docs say this works best when the teacher is substantially more capable than the student on the target task, especially math and quantitative reasoning, scientific or medical question answering that needs step-by-step reasoning, and other work where a teacher with “thinking” or chain-of-thought consistently beats the student. Gains are smaller when the student is already close to the teacher, or on short-form retrieval where the teacher’s reasoning trace adds little.

Supported models

The distillation section currently lists only one teacher: GLM 5.2 MaaS (zai-org/glm-5.2-maas). Students are Qwen 3 4B/8B/14B/32B (for example qwen/qwen3@qwen3-4b) and Gemma 3 1B/4B/12B/27B IT (for example google/gemma3@gemma-3-1b-it). Gemini models are not listed as teachers on this open-model distillation page, and Llama appears only on the supervised-tuning list, not as a distillation teacher or student. Supervised fine-tuning covers a wider set, including several Gemma 4 sizes, Gemma 3, Medgemma 1.5 4B IT, multiple Qwen 3.x models, Llama 3.1 8B and Instruct, Llama 3.2 1B/3B Instruct, Llama 3.3 70B Instruct, Llama 4 Scout 17B 16E Instruct, and GLM 4.7 Flash. SFT can be full fine-tuning or LoRA (also called parameter-efficient fine-tuning): the docs say LoRA adjusts a subset of parameters, costs less, and needs less data, while full fine-tuning adjusts all parameters and has higher quality potential. Support varies by model; for example Gemma 4 variants are listed as parameter-efficient only, Gemma 3 1B/4B/12B IT as full fine-tuning only, and Gemma 3 27B IT, Qwen 3 32B, and Llama 3.1 8B as both.

Set up the environment and dataset

The docs strongly recommend launching jobs from the global endpoint, which selects a supported region with capacity. A matching regional job is created, but you are billed and charged quota for a single tuning job. Region-specific jobs remain available in us-central1 (Iowa), europe-west4 (Netherlands), us-west1 (Oregon), us-east5 (Columbus), asia-southeast1 (Singapore), and asia-southeast2 (Jakarta). For SFT, install and initialize the Vertex AI SDK for Python, call vertexai.init(project=PROJECT_ID, location=REGION), and import sft and SourceModel from vertexai.tuning. For distillation, run pip install google-genai and create a google.genai Client with vertexai=True, project, and location. A training dataset is required, as JSONL uploaded to Cloud Storage. A common text format is one object per line with prompt and completion fields; a messages array with system, user, and assistant roles is also supported. The GenerateContent format and multimodal datasets apply to supervised fine-tuning only. For distillation, the training set may contain prompts only, because the teacher writes the completions, but the validation set must include both prompts and ground-truth completions, since it is used to evaluate held-out quality while the student is tuned. The docs also suggest running a knowledge-distillation feasibility notebook in Colab Enterprise before you start, to see whether your dataset suits the teacher-student pair. If images live in a different bucket from the JSONL files, grant the Storage Object User role on both buckets to service-PROJECT_NUMBER@gcp-sa-vertex-moss-ft.iam.gserviceaccount.com and service-PROJECT_NUMBER@gcp-sa-aiplatform.iam.gserviceaccount.com.

Create the job, inspect artifacts, and deploy

You can tune a supported base model, or continue from a custom checkpoint or a previously tuned model with the same architecture. For SFT in the console, open a model card, choose Fine tune and then Managed tuning, or create a job on the Tuning page. The SDK example is sft.train(...): set base_model in source_model, such as meta/llama3_1@llama-3.1-8b, optionally set custom_base_model to an existing checkpoint, choose tuning_mode FULL or PEFT_ADAPTER, and pass epochs plus Cloud Storage paths for train_dataset, validation_dataset, and output_uri. The distillation example is client.tunings.tune(...): set base_model to a student such as qwen/qwen3@qwen3-4b, point training_dataset.gcs_uri at the training file, and in config set method to DISTILLATION, base_teacher_model to zai-org/glm-5.2-maas, plus epoch_count, validation_dataset, and output_uri. When the job finishes, artifacts land in the output directory. Distillation writes distillation_labelled_dataset.jsonl at the root (the teacher’s labeled traces). Final sharded safetensors are under postprocess/node-0/checkpoints/final/, with intermediate checkpoints in checkpoint-M directories. At most 10 checkpoints are stored; if you run fewer than 10 epochs, one checkpoint is stored per epoch. Intermediate checkpoint numbers are ordered but not always consecutive. You can deploy the final directory to a Gemini Enterprise Agent Platform endpoint or export the weights elsewhere. In the console, use Deploy model with custom weights in Model Garden. The SDK example uses a g2-standard-12 machine with one NVIDIA L4 and model_garden.CustomModel(...).deploy(...); the docs note that deployment incurs cost. For inference, deployed custom-weight models use Endpoint.predict, while managed open models use chat.completions.

Limits, quotas, pricing, and a different distillation service

Most listed models have a maximum sequence length of 8192 and are text-only. Qwen 3.8 27B, Qwen 3.6 27B, and Qwen 3.6 35B A3B allow 12288. Llama 4 Scout 17B 16E Instruct allows 2048 and supports text and images, but mixed datasets of text-only and image examples are not supported: if any example has an image, all text-only examples are filtered out. Concurrent tuning jobs are quota-limited. Each project has a default global quota to run at least one job, shared across regions and supported models; to run more at once, request quota for “Global concurrent managed OSS model fine-tuning jobs per project.” Distillation also calls the teacher, so the project needs enough quota for that model. Open models offered as a service (MaaS) use dynamic shared quota, and teacher calls consume the project’s shared quota for that model. You are billed for tuning by training tokens times epochs, and distillation also bills the teacher API calls at managed-model rates; Cloud Storage and prediction are separate. This documentation page does not list dollar prices; use Google’s official pricing pages and calculator. Separately, Google Cloud has a “Gemini Distillation Service” page. In early access it lists teacher gemini-3.1-pro and student gemini-2.5-flash, and says not to use models distilled in that phase in production. That is a different service and model list. This article does not treat the open-model tuning page as a formal production certification. The docs recommend checking results on a validation set before you decide to deploy.

Sources & editorial note

This article is an AI-assisted synthesis by 88Z AI based on the public sources below. Product claims and availability are attributed to their publishers. It does not represent independent testing or first-hand reporting.

  1. @ClementDelangue (clem)Source published

Source dates above refer to the original announcements; the date under the headline is this article’s publication on 88Z AI.

All AI news

Related reading

All stories
88Z.ai