Google Cloud AI Platform Python Client Library
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
- breaking Python versions <= 3.8 are deprecated and no longer supported in the latest release.
- gotcha Ensure that the 'google-cloud-aiplatform' package is installed in your environment to avoid ImportError.
Install
-
pip install google-cloud-aiplatform
Imports
- aiplatform
from google.cloud import aiplatform
Quickstart
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'
)