# Blueprints (MetaCloud only)

# Overview

Created by domain experts, an AI Blueprint is a consistent, machine learning (ML) pipeline built on reusable blocks of code. Each Blueprint has been carefully crafted to implement an ML use-case that supports custom modifications to bring your data into the pipeline. For more details, see the Introduction and Training and Inference examples below.

NOTE

Blueprints are only available for MetaCloud.

# Introduction

The cnvrg.io platform hosts a Marketplace of AI Blueprints and associated components, which can be fully integrated with popular third-party services and frameworks. Head over to the cnvrg.io Marketplace to learn more and find the right set of integrations to meet your requirements. If you cannot find a particular integration, please reach out to one of the experts at the cnvrg.io support portal to make a suggestion.

At a high level, AI Blueprints are organized by their role in the AI pipeline and the ML task they perform, such as Object Detection or Sentiment Analysis. The three main building blocks within an AI pipeline are, Data Connectors, Models, Deployment Options. These tasks are further organized into workflows that are either training-focused or inference-focused.

Please refer to the available cnvrg.io AI Blueprint workshop sessions and hands-on guides to learn more. Head over to the cnvrg.io Metacloud Blueprints page to get started deploying your first AI Blueprint in a matter of minutes!

# Training Blueprint: Object Detection

A training AI Blueprint focuses on determining model weights and convergence toward a specific ML use case. This is ideal if you would like to fine-tune a model and train it on proprietary data that fits a unique use-case. For example, an e-commerce application might want to use sales-data to create a unique recommender system to facilitate a better shopping experience for customers.

# Instruction

  1. To access the cnvrg.io training-related AI Blueprints, log in to the cnvrg.io Metacloud.
  2. Click the Blueprints tab on the left sidebar to display the AI Blueprints page.
  3. Click the Training button at the top.

Training Blueprints can also be accessed by simply navigating to the cnvrg.io Metacloud website and clicking the top Training button.

Both actions display all the AI Blueprints cnvrg.io experts have carefully crafted to guide you toward their model-training goals. Reference one of the hands-on workshop sessions or follow a specific step-by-step cnvrg.io AI Blueprint guide to experiment at your own pace with your own data.

As an example, let’s walk through how to use an AI Blueprint. Select the popular Training AI Blueprint called Object Detection.

Selecting Object Detection Training displays its page containing information about the AI Blueprint and the tasks comprising its pipeline. This page explains the purpose of the AI Blueprint, provides a visual diagram of the task sequence, and lists sequential instructions to help you train the model and deploy the endpoint within their computing environment. The bottom of the page displays the Connected Libraries section, which includes the Integration Connectors required to run the AI Blueprint.

The AI Blueprint Deep Dive section provides a flow diagram depicting the individual tasks within the AI Blueprint pipeline and uses connecting links to illustrate their associated relationships with each other. This visual improves understanding of the technical complexities and the computational costs associated with a particular AI Blueprint. Larger, more complex training AI Blueprints will likely incur longer completion and convergence times than smaller, simpler AI Blueprints. A user can decide to deploy a specific training AI Blueprint by clicking the Use Blueprint button.

The cnvrg.io platform provides an easy way to balance these computational complexities through our Compute Templates section. The cnvrg.io platform Compute functionality can offload users with these computational complexities described below. Go to Compute > Templates to access the available default Compute Templates and add new ones by clicking Add Compute Template. For instructions on setting up Compute Templates, please refer to the [Compute documentation] (../core_concepts/compute.html#compute).

To deploy a specific training AI Blueprint, click the Use Blueprint button and follow the step-by-step instructions provided.

AI Blueprint versioning information is captured on the right section. The cnvrg.io team regularly updates AI Blueprint versions, so be sure to look for the latest versions of your favorite training AI Blueprints, which bring enhanced execution and code optimization to your fingertips.

# Code Snippets

Upon execution of a Training AI Blueprint, navigate to the ‘Flows’ section of cnvrg.io. Here, you are greeted by the ‘Welcome’ pop-up that illustrates the three major steps in Flow execution.

To access code-snippets related to the training, click Run at the top of the Flows page.

This starts the execution while providing you with a dashboard that indicates the status of progress and console messages associated with each task.

After the execution has completed, if the particular Training AI Blueprint supports an endpoint, you are presented with code snippets to easily embed within their proprietary projects.

The following code is an example snippet.

curl -X POST \
https://inference-1-1.ak4xb9yonezzgpfcm7bby6j.cloud.cnvrg.io/api/v1/endpoints/jcxjdv3xp1kw5kncru7u \
-H 'Cnvrg-Api-Key: 7Z1XBHfQeCASKo2k3bwnHJ4Z' \
-H 'Content-Type: application/json' \
-d '{"input_params": {"input_text": text}}'

The following code is another example snippet

import http.client

conn = http.client.HTTPSConnection("inference-1-1.ak4xb9yonezzgpfcm7bby6j.cloud.cnvrg.io", 443)
payload = "{\"input_params\": {\"input_text\": text}}"
headers = {
    'Cnvrg-Api-Key': "7Z1XBHfQeCASKo2k3bwnHJ4Z",
    'Content-Type': "application/json"
    }
conn.request("POST", "/api/v1/endpoints/jcxjdv3xp1kw5kncru7u", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

# Inference Blueprint: Object Detection

An inference AI Blueprint captures the serving and inference aspects of the ML pipeline. The cnvrg.io Metacloud provides many inference AI Blueprints that can be used immediately without the need to train them in advance. Each Inference AI Blueprint comes with a corresponding Training AI Blueprint and allows models to be fine tuned or deployed with new training data.

To access the cnvrg.io inference-related AI Blueprints, log in to the cnvrg.io Metacloud, click the Blueprints tab on the left sidebar to display the AI Blueprints page, and click the Inference button at the top. Inference AI Blueprints can also be accessed by simply navigating to the cnvrg Metacloud website and clicking the top Inference button.

Both actions each display all the AI Blueprints cnvrg.io experts have carefully crafted to guide you toward their inference and model serving goals. Select a specific AI Blueprint, for example, Object Detection Inference, and follow the instructions to quickly deploy it—much like the process with its associated training AI Blueprint.

Selecting Object Detection Inference displays its page, which includes an AI Blueprint Deep Dive flow diagram comprising a single Deploy Object Detection task, as shown above. All inference-related actions required to deploy and serve the AI Blueprint are neatly contained within a single task, streamlining versioning and eliminating the need for complex maintenance in the future.

# Instruction

  1. Click the Use Blueprint button and follow the step-by-step instructions to quickly incorporate it within your organization’s projects.
  2. On the Compute page, click Templates to access its Compute Templates page listing available templates.
  3. Select the optimum template(s) or add new ones to deploy the inference AI Blueprint that best balances costs and performance according to your organizational requirements.

# Try It Live

Additionally, within an inference page we include a helpful Try it Live section where you can test a pretrained model. This type of simple cnvrg.io integration is key and highlights the platform’s commitment to making ML training and inference technology ubiquitous and accessible to a wide range of users and experience levels. Follow the instructions on the left side of the Try It Live section to include any input data into the inference service, click Execute and view the sample result instantaneously in the Result box. This is especially useful for API developers who would like to get a better understanding of sample outputs and design their code around the inference data that is returned.

To deep dive into Inference code, cnvrg.io provides code snippets to improve understanding and access code for reuse within your projects.

# Code Snippets

Similar to the Code Snippets from the Training AI Blueprint under the Serving tab, Inference AI Blueprints also provide convenient code snippets to serve your model at an endpoint that is easily accessible for your proprietary project code.

cnvrg.io makes it simple to serve an object detection model through a standard POST call. We provide a curl command as well as a python script to provide developers with additional flexibility to integrate model serving into their projects.

curl -X POST \
https://deploy-object-detection-2-1.ak4xb9yonezzgpfcm7bby6j.cloud.cnvrg.io/api/v1/endpoints/iwdjgya5xjxjfp914zuw \
-H 'Cnvrg-Api-Key: NcC5saJpMmDcqUt6LFbKpyTD' \
-H 'Content-Type: application/json' \
-d '{"input_params": {"img": file}}'
import http.client

conn = http.client.HTTPSConnection("[deploy-object-detection-2-1.ak4xb9yonezzgpfcm7bby6j.cloud.cnvrg.io](http://deploy-object-detection-2-1.ak4xb9yonezzgpfcm7bby6j.cloud.cnvrg.io/)", 443)
payload = "{\"input_params\": {\"img\": file}}"
headers = {
'Cnvrg-Api-Key': "NcC5saJpMmDcqUt6LFbKpyTD",
'Content-Type': "application/json"
}
conn.request("POST", "/api/v1/endpoints/iwdjgya5xjxjfp914zuw", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")

# Integrations

Integrations are an effective way to introduce functionality from third-party frameworks and services like AWS into the cnvrg.io Metacloud platform. Similar to training and inference AI Blueprints, at their core, connector integrations are tasks that run a single script. These tasks help bring in functionality that is provided by services that are managed by third parties. For example, our data integrations that can be found under the Data tab, support S3-connector, SalesForce, Slack, and Snowflake integrations. This allows you to bring in data from these platforms with little overhead into their AI Flows.

To learn more about a specific Connector, click on one, to display its Connectors description page. Here you will find a plethora of information about the Connector from its description, to its parameters, to the nature of its command-line syntax.

Integrated connectors can be used independently or in conjunction with other tasks and ML models in an AI Blueprint. They can also be customized for additional functionality after using an AI Blueprint. Navigate to the AI Blueprint’s flow page, locate the associated connectors, and modify the simple key-value pairs to customize their functionality according to specific needs.

# Detection and Captioning

# Recommenders

# Text Extraction and Summarization

# Topic Models

# Sentiment Analysis

# Classification

# Other

Last Updated: 3/18/2024, 8:47:35 AM