Deploy trained models as online inference services with elastic scaling, versioning, and resource monitoring using PAI-EAS.
Billing
This example uses public resources with pay-as-you-go billing. Stop or delete the service when no longer needed to avoid further charges.

Prerequisites
-
PAI workspace
-
Trained model ready for deployment
-
(Optional) Application code uploaded to Object Storage Service (OSS)
-
(Optional) Container image in Container Registry (ACR) or Data Science Workshop (DSW) image URL
Deploy model with EAS
For a complete example, see Deploy a model as an online service using EAS.
-
Log on to the PAI console. In the top navigation bar, select the destination region and workspace. In the left-side navigation pane, click Elastic Algorithm Service (EAS) > Deploy Service > Custom Deployment.
-
Set Deployment Method to Image-based Deployment.
-
Configure Image Configuration to specify the runtime environment. Choose an Alibaba Cloud image, custom image, or image specified by address.
If the model was developed in DSW, select Image Address and copy the image URL from DSW.

Alternatively, use the DSW image creation feature to push the image to ACR for EAS. For more information, see Create a DSW instance image.
-
In the Mount storage section, upload application code files to OSS and configure the mount address.

The following example uses a simple test application uploaded to the OSS path shown above.
-
In the Command field, enter the command to start the application.

-
In the Port Number field, enter
9000to match the port defined inweb.py. -
In the Third-party Library Settings section, add libraries not included in the image. For example:

-
For Resource Type, select Public Resources. For instance type, select
ecs.gn7i-c16g1.4xlarge. -
Click Deploy. Deployment succeeds when the service status changes to Running.
For all configuration parameters, see Parameters for custom deployment.
Test the service
After deployment, test the service endpoint with EAS online debugging.
-
On the EAS instance list page, click the instance name. On the instance details page, click Online Debugging.
-
Enter the request URL for the
web.pyapplication (for example, the/helloroute) and click Send Request. A "hello World!" response confirms the service is working. -
To invoke the service from internet or VPC, see Service invocation methods.

References
-
Service deployment overview -- Full overview of EAS deployment features
-
Parameters for custom deployment -- Complete reference for all console configuration parameters
-
EAS FAQ -- Troubleshooting for deployment and invocation issues