Google Cloud AI Platform Python Client Library

1.143.0 · active · verified Sat Mar 28

The Google Cloud AI Platform Python Client Library provides a set of tools for interacting with Vertex AI services, enabling users to build, deploy, and manage machine learning models on Google Cloud. As of version 1.143.0, released on March 25, 2026, the library continues to evolve with regular updates to enhance functionality and performance.

Warnings

Install

Imports

Quickstart

This quickstart guide demonstrates how to initialize the AI Platform SDK, create a TabularDataset, upload a model, and deploy it to an endpoint using environment variables for authentication.

import os
from google.cloud import aiplatform

aiplatform.init(
    project=os.environ.get('GOOGLE_CLOUD_PROJECT', 'your-project-id'),
    location='us-central1',
    staging_bucket='gs://your-staging-bucket'
)

# Example: Create a TabularDataset
my_dataset = aiplatform.TabularDataset.create(
    display_name='my-dataset',
    gcs_source=['gs://path/to/your/data.csv']
)

# Example: Train a Model
my_model = aiplatform.Model.upload(
    display_name='my-model',
    artifact_uri='gs://path/to/your/model',
    serving_container_image_uri='gcr.io/cloud-aiplatform/training/tf2-cpu.2-3:latest'
)

# Example: Deploy the Model
endpoint = my_model.deploy(
    deployed_model_display_name='my-deployed-model',
    machine_type='n1-standard-4'
)

view raw JSON →