Chuyển đến nội dung chính

Lesson 6: Google Vertex AI Setup — Environment & Pricing

Setup Google Cloud project, IAM, billing. Vertex AI SDK installation. GCS bucket for data. Quota management. Pricing breakdown in detail.

🧠 AI & ML — Lesson 5 Lesson 6: Google Vertex AI Setup — Environment & Pricing

Fine-tuning LLM: The Art of AI Tuning

Part 3: Fine-tuning on Google Gemini / Vertex AI

xdev.asia

Introduction

Get hands-on with Google Cloud! This article sets up a complete environment to fine-tune Gemini models.


1. Google Cloud Setup

# Install Google Cloud CLI
curl https://sdk.cloud.google.com | bash
gcloud init

# Create project
gcloud projects create my-finetuning-project
gcloud config set project my-finetuning-project

# Enable APIs
gcloud services enable aiplatform.googleapis.com
gcloud services enable storage.googleapis.com

2. Vertex AI SDK

pip install google-cloud-aiplatform
from google.cloud import aiplatform

aiplatform.init(
    project="my-finetuning-project",
    location="us-central1",
)

3. GCS Bucket for Training Data

gsutil mb gs://my-finetuning-data/
gsutil cp training_data.jsonl gs://my-finetuning-data/

4. Pricing Deep-dive

Gemini 2.0 Flash Fine-tuning:
├── Training: ~$0.40 per 1M tokens
├── Inference: Same as base model ($0.075/1M input, $0.30/1M output)
├── Storage: GCS standard pricing
└── Evaluation: Billed as batch prediction

Ví dụ tính:
├── Dataset: 500 examples × 500 tokens = 250K tokens
├── Epochs: 3 → 750K training tokens
├── Training cost: 750K × $0.40/1M = $0.30
└── TỔNG: ~$0.30 cho 1 lần fine-tune! 🎉

Summary

  • Google Cloud setup: project → APIs → SDK → GCS bucket
  • Vertex AI is fully managed — no GPU management required
  • Extremely low training costs ($0.30–$50 for most use cases)
  • Free trial $300 credit enough for the entire course

Exercises

  1. Setup Google Cloud project and enable Vertex AI
  2. Install SDK and test connection
  3. Upload sample dataset to GCS
  4. Calculate the estimated cost for your dataset