×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

How to create model and version on GCP after uploading model.joblib on bucket?

by MIRNA HANŽEK / Thursday, 23 October 2025 / Published in Artificial Intelligence, EITC/AI/GCML Google Cloud Machine Learning, Advancing in Machine Learning, Scikit-learn models at scale

To create a model and version on Google Cloud Platform (GCP) after uploading a Scikit-learn model artifact (e.g., `model.joblib`) to a Cloud Storage bucket, you need to use Google Cloud’s Vertex AI (previously AI Platform) for model management and deployment. The process involves several structured steps: preparing your model and artifacts, setting up the environment, creating a model resource in Vertex AI, and then creating a version (endpoint) that points to your uploaded model artifact. Below is an exhaustive, step-by-step guide.

1. Preparing the Model Artifact and the Serving Code

Scikit-learn models such as `model.joblib` are binary files generated using `joblib.dump()`. These are not directly interpretable by GCP; you need to provide a custom prediction routine or container that knows how to load and serve the model. Vertex AI provides two primary options for serving Scikit-learn models:

– Using Prebuilt Containers: Vertex AI offers prebuilt containers for Scikit-learn.
– Custom Containers: For more control, you can build a Docker container.

a. Saving the Model
{{EJS16}}
b. Uploading Model to Google Cloud Storage
Use the `gsutil` command to upload your model:
{{EJS17}}

2. Enabling Required APIs and Setting Up GCP

Ensure the following APIs are enabled for your project: - Vertex AI API - Cloud Storage API - Compute Engine API (for deployment) Set up the environment variables and authentication (assuming you use Cloud Shell or authorized gcloud CLI):
bash
export PROJECT_ID=your-gcp-project-id
export REGION=us-central1
gcloud config set project $PROJECT_ID
gcloud config set ai/region $REGION

Authenticate if necessary:

{{EJS19}}

3. Creating the Vertex AI Model Resource

a. Using Prebuilt Container for Scikit-learn
Vertex AI provides a prebuilt container for Scikit-learn. You only need to point to your model artifact on GCS and specify the correct container.
i. Create the Model Resource
bash
gcloud ai models upload \
  --region=$REGION \
  --display-name=sklearn-rf-model \
  --artifact-uri=gs://your-bucket-name/path/to/model \
  --container-image-uri=us-docker.pkg.dev/vertex-ai/prediction/sklearn-cpu.0-24:latest

- `--display-name`: The name for your model in Vertex AI.
- `--artifact-uri`: This should point to the directory containing `model.joblib`.
- `--container-image-uri`: Use the latest Scikit-learn prebuilt image. Find more at [Vertex AI prebuilt containers](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers).

ii. Model Directory Structure

The artifact directory must contain the model file at the root:

{{EJS21}}
b. Custom Prediction Routine (Optional)
If you need custom preprocessing or postprocessing, you should package your model with a `predictor.py` file as described in [Vertex AI custom prediction routines](https://cloud.google.com/vertex-ai/docs/predictions/custom-prediction-routines-overview).
c. Using Custom Containers (Advanced)
You can build a Docker container that loads your Scikit-learn model and serves predictions using Flask, FastAPI, or similar frameworks, push it to Artifact Registry, and use its URI.

4. Creating a Model Version (Endpoint) for Online Prediction

Vertex AI uses the concept of "endpoints" for serving models.
a. Create an Endpoint
bash
gcloud ai endpoints create \
  --region=$REGION \
  --display-name=sklearn-rf-endpoint

Capture the endpoint ID from the output (e.g., `1234567890`).

b. Deploy the Model to the Endpoint

You can now deploy the model to the endpoint:

bash
gcloud ai endpoints deploy-model ENDPOINT_ID \
  --region=$REGION \
  --model=MODEL_ID \
  --display-name=sklearn-rf-deployment \
  --machine-type=n1-standard-2 \
  --traffic-split=0=100

- `ENDPOINT_ID`: The ID obtained from the previous step.
- `MODEL_ID`: The model resource ID from the upload step.
- You can adjust `--machine-type` as needed.

5. Testing Online Prediction

a. Prepare Input Instance

Create a JSON file `instance.json` that matches the expected input schema:

{{EJS24}}
b. Send Prediction Request
{{EJS25}}

6. Example: End-to-End Process

Assume you have trained an Iris classifier and saved it as `model.joblib`: 1. Upload to GCS:
bash
   gsutil cp model.joblib gs://my-ml-bucket/iris-model/
   

2. Model Upload:

bash
   gcloud ai models upload \
       --region=us-central1 \
       --display-name=iris-sklearn \
       --artifact-uri=gs://my-ml-bucket/iris-model/ \
       --container-image-uri=us-docker.pkg.dev/vertex-ai/prediction/sklearn-cpu.0-24:latest
   

Output provides the `MODEL_ID`.

3. Create Endpoint:

bash
   gcloud ai endpoints create \
       --region=us-central1 \
       --display-name=iris-endpoint
   

Output provides the `ENDPOINT_ID`.

4. Deploy Model:

bash
   gcloud ai endpoints deploy-model ENDPOINT_ID \
       --region=us-central1 \
       --model=MODEL_ID \
       --display-name=iris-sklearn-deployment \
       --machine-type=n1-standard-2 \
       --traffic-split=0=100
   

5. Send Prediction:
Prepare `instance.json` as above and run:

{{EJS30}}

7. Batch Prediction (Optional)

For batch prediction jobs, you can submit a job that reads input instances from a file in Cloud Storage and writes results to another Cloud Storage location.

{{EJS31}}

8. Best Practices and Considerations

- Artifact Path: Ensure the artifact path points to the directory containing the model and not directly to the file.
- File Naming: The default filename expected by the Scikit-learn prebuilt container is `model.joblib`.
- Input Format: The JSON input should match the format expected by your model (e.g., key names and data types).
- Model Size: For large models, verify that memory on the selected machine type is sufficient.
- IAM Permissions: Ensure that the deploying user/service account has the necessary permissions (`Vertex AI Admin`, `Storage Object Viewer`).
- Versioning: Vertex AI manages versions via endpoint deployments. Multiple models can be deployed to a single endpoint with traffic-splitting, supporting A/B testing and model rollbacks.

9. Automation and Infrastructure-as-Code

For production workflows, consider using Terraform or Google Cloud Deployment Manager to manage these resources as code. For continuous deployment, integrate with CI/CD pipelines using Cloud Build.

10. Troubleshooting

- Prediction Errors: Check that the input instance schema matches the model’s expected input features.
- Deployment Failures: Validate the container image URI and that the model file is accessible from the specified GCS path.
- Permission Issues: Confirm that the appropriate IAM roles are assigned.

11. References

- [Vertex AI documentation](https://cloud.google.com/vertex-ai/docs)
- [Prebuilt Prediction Containers](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers)
- [Custom Prediction Routines](https://cloud.google.com/vertex-ai/docs/predictions/custom-prediction-routines-overview)
- [gcloud AI Command Reference](https://cloud.google.com/sdk/gcloud/reference/ai/)

By following these steps, you can successfully register, version, and deploy your Scikit-learn model at scale on GCP using Vertex AI, taking advantage of robust infrastructure for serving and managing machine learning models in production environments.

Other recent questions and answers regarding Scikit-learn models at scale:

  • What are the benefits of deploying scikit-learn models on Google Cloud ML Engine?
  • How can you call predictions using a sample row of data on a deployed scikit-learn model on Cloud ML Engine?
  • What are the requirements for creating a model and version on Cloud ML Engine for a scikit-learn model?
  • What are the steps to upload a joblib file to Google Cloud Storage for deploying a scikit-learn model?
  • How can you export a scikit-learn model using the joblib library from sklearn.externals?

More questions and answers:

  • Field: Artificial Intelligence
  • Programme: EITC/AI/GCML Google Cloud Machine Learning (go to the certification programme)
  • Lesson: Advancing in Machine Learning (go to related lesson)
  • Topic: Scikit-learn models at scale (go to related topic)
Tagged under: Artificial Intelligence, Cloud Storage, GCP, Model Deployment, Scikit-learn, Vertex AI
Home » Artificial Intelligence » EITC/AI/GCML Google Cloud Machine Learning » Advancing in Machine Learning » Scikit-learn models at scale » » How to create model and version on GCP after uploading model.joblib on bucket?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.
Eligibility for EITCA Academy 90% EITCI DSJC Subsidy support
90% of EITCA Academy fees subsidized in enrolment

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.