All Products
Search
Document Center

Platform For AI:Deploy a model as an online service

Last Updated:Mar 11, 2026

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.

image

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.
  1. 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.

  2. Set Deployment Method to Image-based Deployment.

  3. 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.

    image

    Alternatively, use the DSW image creation feature to push the image to ACR for EAS. For more information, see Create a DSW instance image.

  4. In the Mount storage section, upload application code files to OSS and configure the mount address.

    image

    The following example uses a simple test application uploaded to the OSS path shown above.

    Example application code: web.py

    from bottle import Bottle, run
    
    # Create an instance
    app = Bottle()
    
    # Define a route that returns "Hello, World!"
    @app.route('/hello', method=['GET', 'POST'])
    def hello():
        # In a real application, replace this with parameter parsing and model invocation
    
        return 'Hello, World!'
    
    # Run the server
    if __name__ == '__main__':
        run(app, host='0.0.0.0', port=9000)
    
  5. In the Command field, enter the command to start the application.

    image

  6. In the Port Number field, enter 9000 to match the port defined in web.py.

  7. In the Third-party Library Settings section, add libraries not included in the image. For example:

    image

  8. For Resource Type, select Public Resources. For instance type, select ecs.gn7i-c16g1.4xlarge.

  9. 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.

  1. On the EAS instance list page, click the instance name. On the instance details page, click Online Debugging.

  2. Enter the request URL for the web.py application (for example, the /hello route) and click Send Request. A "hello World!" response confirms the service is working.

  3. To invoke the service from internet or VPC, see Service invocation methods.

image

References