AIaaS

What is AIaaS and how to build it

How to start building AI-as-a-service products

Michelangiolo Mazzeschi
Plain Simple Software

--

With the advent of Cloud Computing, services that once were only available after making a consistent investment in hardware can be now rented for a very small sum of money. Because of giant Cloud Providers that can minimize their fixed costs and are in constant competition with each other, they are able to keep prices at the lowest possible level. This is heaven for developers.

These improvements, which saw their birth about 10 years ago and an explosion of Cloud adoption in the last 3 years only, gave rise to the as-a-service (aaS) products, which are products that do not have to be bought as a whole but can be accessed through subscriptions and single uses. Managing as-a-service products is a much lighter task rather than selling an entire product because:

  • User is not forced to download an entire software
  • We avoid compatibility issues
  • The response reaction is dependent on the Cloud speed (much faster)
  • No fear of code being replicated
  • Is way cheaper than a product as a whole

Different aaS products

Before even talking about AIaaS, to make you understand a bit better these kinds of models let us see some examples. The biggest kind of service model is called IaaS (infrastructure-as-a-service) and refers to the entire Cloud. Through IaaS we are able to rent entire infrastructures without any limit, completely managed by the provider and with scaling abilities.

When, instead, we only need to use a platform, rather than renting the entire infrastructure, we can utilize PaaS (platform-as-a-service). Through PaaS, for example, we can use web hosting platforms to manage our websites.

The most common kind of service model is called SaaS (Software-as-a-service): when we are renting a pre-made software, we are accessing a SaaS, for example online Microsoft Word or PowerBI.

Other very important aaS models are Faas (Function-as-a-service) and DaaS (data-as-a-service), and finally, AIaas, which is the service model we are going to see through this article.

What is an AIaaS?

If you are still unfamiliar with AI (this quick guide may help you out), know that is just a bunch of lines of code that work on some data. However, writing the AI, something that takes a few years to become good at, is the simple part. For the model to be available online, usable by the end-user, it has to be deployed on a provider. Once a model has been deployed and can be accessed through API by everyone can be called an AIaaS.

The low-resolution architecture of an AIaaS product

How is an AIaaS built?

By looking at the picture above, we can see the different development steps behind the creation of an AIaaS. Know that each Cloud provider owns its own software to manage the AIaaS creation pipeline. In the case of AWS, for example, I would use Amazon Sagemaker.

Training the model

The first step in creating an AIaaS consists in creating the software. We need to have a working AI, and to create it we need some working code that allows a model to be trained on some data. The model needs to be tuned and tested before being made available to the public.

Containerization

Once the code of an ML model is stable, we need to go through a step called containerization. By containerizing a model, we create a blueprint that can be used to recreate the same model with all its dependencies. Containerization of applications is the lightest way to prepare software for deployment.

Deployment

Once a model has been properly containerized, it can finally be deployed. End-users will be able to access it through a simple API call, receiving some code (that contains the inference information) as a result. Imagine if any user would have to install the AI before using it. Instead, by using this service model we can make an AI available to every user in a fraction of seconds.

We constantly see AIaaS products being deployed everywhere. When Facebook uses its image detection model to recognize photos in images, it uses its own ML model in the form of AIaaS.

MLOps

The most common way of managing the creation and development of ML models is called MLOps. The MLOps process is a standardized way for developers to follow the creation, testing, containerization, and deployment of an ML model.

Continuous Delivery for Machine Learning (CD4ML)

By standardizing this process, developers can follow the process by using a bundle of software made available by the Cloud providers but also being able to manage the MLOps pipeline the way they want.

--

--