# pai-model_management

Part of **PAI**

# Platform for AI (PAI) Model Management Console Guide

## Operations Overview

| Operation | Console Entry | Prerequisites | Description |
|----------|---------------|---------------|-------------|
| Copy, Read, and Export Offline Model | Console > PAI > OfflineModel Components | A MaxCompute project with a trained OfflineModel, OSS bucket with write permissions, RAM role configured for OSS access if using OSS RAM Role Settings | Manage OfflineModels by copying between projects, reading metadata, or exporting to OSS in original or PMML format |
| Create Pipeline Model | Platform for AI > Machine Learning Designer > Components > Make Pipeline model | PAI authorized to access OSS, required permissions for Machine Learning Designer granted | Package up to four Flink ML or Alink-based models into a single pipeline model for EAS deployment |
| Deploy Pipeline as Online Service | Console > Workspaces > Model Training > Visualized Modeling (Designer) | A successfully run batch pipeline built entirely with Alink algorithm components (purple circle icons) | Convert a serial data-processing pipeline into an online prediction service on Elastic Algorithm Service (EAS) |
| Deploy Model to EAS | PAI Console > Visualized Modeling (Designer) > Workflow > Model List > Deploy to EAS | Models trained and validated in Designer; for PMML models, 'Whether to Generate PMML' enabled in Fields Setting tab | Deploy individual models to EAS via one-click or manual configuration for real-time serving |
| Schedule Model Service Update | Console > PAI > Machine Learning Designer > Pipelines > Schedule Updates | A running EAS online model service, DataWorks workspace with scheduling access | Automate periodic updates of EAS model services by connecting the Update EAS Service (Beta) component and scheduling in DataWorks |
| Evaluate Prediction Fairness | Platform for AI > Machine Learning Designer > Pipelines > Add Component > Lorenz Curve | Dataset with numeric feature columns, access to Machine Learning Designer workspace | Assess model prediction fairness using Lorenz Curve visualization to detect bias in resource allocation |
| Export Model to OSS | Console > PAI > All Product Dependencies > Designer > View Authorization Information | OSS authorization for Designer completed | Export general-purpose models from PAI Designer to OSS in original or PMML format |

## Operation Steps

### Copy, Read, and Export Offline Model

**Navigation**: Console > PAI > OfflineModel Components

**Prerequisites**:
- A MaxCompute project with a trained OfflineModel
- OSS bucket with write permissions
- RAM role configured for OSS access if using OSS RAM Role Settings

1. Navigate to the OfflineModel components section in the PAI console  
   - Element: **OfflineModel Components** (link) — left navigation panel

2. Select the Copy MaxCompute Offline Model component  
   - Element: **Copy MaxCompute Offline Model** (button) — main content area

3. On the Parameters Setting tab, enter the Target Model Name  
   - Element: **Target Model Name** (text_input) — Parameters Setting tab  
   - Notes: This field is required.

4. Specify the Dest MaxCompute Project or leave blank to use the current workspace's project  
   - Element: **Dest MaxCompute Project** (text_input) — Parameters Setting tab  
   - Notes: If not specified, defaults to the current workspace's MaxCompute project.

5. Select Overwrite if you want to replace an existing model  
   - Element: **Overwrite** (checkbox) — Parameters Setting tab  
   - Notes: If selected, the existing model will be deleted before creating the new one.

6. Select the Read MaxCompute Offline Model component  
   - Element: **Read MaxCompute Offline Model** (button) — main content area

7. On the Fields Setting tab, enter the Model Name  
   - Element: **Model Name** (text_input) — Fields Setting tab  
   - Notes: This field is required. The MaxCompute Project Name defaults to the current workspace's project.

8. Select the Model export component  
   - Element: **Model export** (button) — main content area

9. On the Parameter Settings tab, specify the OSS Target Path  
   - Element: **OSS Target Path** (text_input) — Parameter Settings tab  
   - Notes: This field is required. Specifies the destination path for the exported model.

10. Optionally enter a new name for the exported file using Rename  
    - Element: **Rename** (text_input) — Parameter Settings tab  
    - Notes: If left empty, the original model name is used.

11. Configure OSS RAM Role Settings if authorization is required  
    - Element: **OSS RAM Role Settings** (text_input) — Parameter Settings tab  
    - Notes: Requires proper RAM role configuration for access.

12. Select Overwrite to replace any existing file at the target path  
    - Element: **Overwrite** (checkbox) — Parameter Settings tab

13. Choose Export Model Type: either original MaxCompute OfflineModel format or PMML  
    - Element: **Export Model Type** (dropdown) — Parameter Settings tab  
    - Notes: PMML is a standard format for predictive models.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Target Model Name | text_input | Yes | — | The name of the model to be copied. |
| Dest MaxCompute Project | text_input | No | — | The MaxCompute project where the model will be copied. If not specified, uses the current workspace's project. |
| Overwrite | checkbox | No | — | If selected, deletes the existing model before creating the new one. |
| Model Name | text_input | Yes | — | The name of the model to be read. The MaxCompute Project Name defaults to the current workspace's project. |
| OSS Target Path | text_input | Yes | — | The destination path in OSS where the model will be exported. |
| Rename | text_input | No | — | Optional new name for the exported file. |
| OSS RAM Role Settings | form_field | No | — | Configuration for RAM role authorization when accessing OSS. |
| Export Model Type | dropdown | No | original, pmml | Choose between exporting in the original MaxCompute OfflineModel format or as a PMML file. |

### Create Pipeline Model

**Navigation**: Platform for AI > Machine Learning Designer > Components > Make Pipeline model

**Prerequisites**:
- PAI is authorized to access Object Storage Service (OSS)
- Required permissions for Machine Learning Designer are granted

1. Navigate to the Machine Learning Designer workspace  
   - Element: **Machine Learning Designer** (link) — main console navigation panel

2. Locate and select the Make Pipeline model component from the components library  
   - Element: **Make Pipeline model** (panel) — components panel

3. Connect upstream components to the input ports  
   - Element: **train data** (link) — left side of the component  
   - Notes: Connect a 'Read Table' component to provide training data

4. Connect trained models to model 1, model 2, etc. input ports  
   - Element: **model 1** (link) — left side of the component  
   - Notes: Only Flink ML or Alink-based models are supported

5. Configure parameters on the Parameter Setting tab  
   - Element: **Parameter Setting** (tab) — component configuration panel

6. Set class Names and params array in string format  
   - Element: **class Names** (text_input) — parameter table  
   - Notes: These are typically auto-filled by the system

7. Optional: Specify OSS Directory for Alink Model and filename  
   - Element: **OSS Directory for Alink Model** (text_input) — parameter table  
   - Notes: If not specified, the system uses the default data storage path

8. Optional: Select Overwrite to replace existing model files  
   - Element: **Overwrite** (checkbox) — parameter table  
   - Notes: Enables overwriting of existing model files in OSS

9. Deploy the pipeline model to EAS  
   - Element: **Update EAS Service (Beta)** (link) — output port area  
   - Notes: This is the recommended downstream component

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| class Names | text_input | Yes | — | Specifies the type of the model that you want to package. |
| params array in string format | text_input | Yes | — | Specifies the inference parameters of the model that you want to package. |
| OSS Directory for Alink Model | text_input | No | — | Optional. If not specified, the data storage path for the pipeline is used. |
| the filename of Alink Model | text_input | No | — | Optional. If not specified, the system automatically generates a name based on the job ID. |
| Overwrite | checkbox | No | — | If selected, the generated model files overwrite the model files of the same names in the specified OSS path. |

### Deploy Pipeline as Online Service

**Navigation**: Console > Workspaces > Model Training > Visualized Modeling (Designer)

**Prerequisites**:
- A batch data-processing pipeline that implements data pre-processing, feature engineering, and model prediction
- The pipeline has been run successfully with all training and prediction components showing a green check
- Only pipelines built entirely with Alink algorithm components (marked with a small purple circle) can be deployed

1. Log on to the Machine Learning Platform for AI console  
   - Element: **Machine Learning Platform for AI console** (link) — top navigation bar

2. Click Workspaces in the left-side navigation pane  
   - Element: **Workspaces** (menu) — left-side navigation panel

3. Click the name of the workspace you want to manage  
   - Element: **workspace name** (link) — Workspaces page

4. Choose Model Training > Visualized Modeling (Designer) in the left-side navigation pane  
   - Element: **Model Training** (menu) — left-side navigation panel

5. Double-click the pipeline to open it  
   - Element: **Pipelines** (tab) — top navigation bar

6. In the top navigation bar, choose Create Pipeline Model  
   - Element: **Create Pipeline Model** (button) — top navigation bar  
   - Notes: An image icon is shown next to this button

7. Select nodes forming a serial data processing link  
   - Element: **Next** (button) — bottom of the dialog box  
   - Notes: Selecting a node automatically selects connected upstream/downstream nodes; unselecting a node unselects all selected nodes

8. Click Next in the Create Pipeline Model dialog box to start packaging  
   - Element: **Next** (button) — bottom of the dialog box  
   - Notes: A batch task named model-combination- is launched. Wait until its status changes to Succeeded.

9. In the Previous Tasks dialog box, click Model in the Actions column  
   - Element: **Model** (button) — Actions column  
   - Notes: This opens the EAS-Online Model Services page

### Deploy Model to EAS

**Navigation**: PAI Console > Visualized Modeling (Designer) > Workflow > Model List > Deploy to EAS

**Prerequisites**:
- Train and validate models in Designer before deployment
- For PMML-based models: enable 'Whether to Generate PMML' in Fields Setting tab

1. Go to the Visualized Modeling (Designer) console and select your workspace.  
   - Element: **Visualized Modeling (Designer)** (link) — top navigation panel

2. Click on the Model List button above the workflow canvas.  
   - Element: **Model List** (button) — above workflow canvas  
   - Notes: The system automatically detects and displays all deployable models.

3. Select your model from the list and click Deploy to EAS.  
   - Element: **Deploy to EAS** (button) — model selection list  
   - Notes: This opens the Create Service page in the EAS console.

4. Configure deployment parameters such as Model File and Processor Type.  
   - Element: **Model File** (text_input) — Create Service page  
   - Notes: These fields are populated automatically based on model type. Additional options can be configured via Custom deployment.

5. Click Deploy and wait for the service status to show Running.  
   - Element: **Deploy** (button) — bottom of the Create Service form  
   - Notes: Monitor the Service Status field until it shows 'Running'.

### Schedule Model Service Update

**Navigation**: Console > PAI > Machine Learning Designer > Pipelines > Schedule Updates

**Prerequisites**:
- A model trained in Machine Learning Designer and deployed to EAS as an online model service in Running state
- A DataWorks workspace with access to schedule pipeline tasks

1. Drag the Update EAS Service (Beta) component onto the canvas  
   - Element: **Update EAS Service (Beta)** (button) — component palette

2. Connect the model output port of your upstream model component directly to the input port of the Update EAS Service (Beta) component  
   - Element: **Update EAS Service (Beta)** (link) — main canvas  
   - Notes: The input port accepts models stored in an Object Storage Service (OSS) bucket. Supported model types include PMML, vision, text processing, and XGBoost models.

3. Click the Update EAS Service (Beta) component to open its settings panel  
   - Element: **Update EAS Service (Beta)** (panel) — main canvas

4. Configure the EAS Service Name and EAS service description json parameters on the Parameters Settings tab  
   - Element: **Parameters Settings** (tab) — settings panel  
   - Notes: The EAS service must be in Running state. Leave EAS service description json blank unless custom configuration is needed.

5. Right-click the Update EAS Service (Beta) component and select Run Current Node  
   - Element: **Run Current Node** (menu) — context menu  
   - Notes: After successful execution, an online model service is created.

6. Submit the pipeline to DataWorks for periodic scheduling  
   - Element: **Submit to DataWorks** (button) — pipeline toolbar  
   - Notes: See Use DataWorks tasks to schedule pipelines in Machine Learning Designer for details.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| EAS Service Name | text_input | Yes | — | The name of the EAS service to update. The service must be in Running state. |
| EAS service description json | text_input | No | — | A JSON file describing the service configuration. Leave this blank in most cases. To add custom settings, enter them in the code editor. |

### Evaluate Prediction Fairness

**Navigation**: Platform for AI > Machine Learning Designer > Pipelines > Add Component > Lorenz Curve

**Prerequisites**:
- A dataset with numeric feature columns
- Access to Machine Learning Designer workspace

1. Add the Lorenz Curve component to the pipeline  
   - Element: **Add Component** (button) — Pipeline details page

2. Configure the Fields Setting tab  
   - Element: **Fields Setting tab** (tab) — Component configuration panel

3. Select the numeric feature column to analyze  
   - Element: **Select Fields** (dropdown) — Fields Setting tab  
   - Notes: Must be a numeric column such as income, wealth, or prediction score.

4. Set the number of quantile intervals  
   - Element: **Quantile** (text_input) — Parameters Setting tab  
   - Notes: Higher values produce finer-grained curves.

5. Adjust computing resources  
   - Element: **Computing Cores** (text_input) — Tuning tab  
   - Notes: Must be a positive integer. System-determined if not specified.

6. Set memory size per core  
   - Element: **Memory Size per Core (Unit: MB)** (text_input) — Tuning tab  
   - Notes: Recommended values: 1024 or 64 × 1024 MB.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Select Fields | dropdown | Yes | — | The feature column to analyze. Select a numeric column containing values such as income, wealth, or prediction score. |
| Quantile | number_input | No | — | The number of equal-probability intervals used to plot the curve. A higher value produces a finer-grained curve. |
| Computing Cores | number_input | No | — | The number of cores used for computation. Must be a positive integer. |
| Memory Size per Core (Unit: MB) | number_input | No | — | The memory allocated to each core, in MB. |

### Export Model to OSS

**Navigation**: Console > PAI > All Product Dependencies > Designer > View Authorization Information

**Prerequisites**:
- OSS authorization for Designer has been completed

1. Navigate to the Export General-Purpose Model component in PAI Designer  
   - Element: **Export General-Purpose Model** (panel) — main content area

2. Go to the Parameters tab of the component  
   - Element: **Parameters** (tab) — top navigation of component panel

3. Configure the Rename parameter with a new name for the exported model  
   - Element: **Rename** (text_input) — parameter list  
   - Notes: If left blank, the model keeps the upstream output model's name.

4. Select Overwrite Existing Model if you want to overwrite previous exports at the same OSS path  
   - Element: **Overwrite Existing Model** (checkbox) — parameter list  
   - Notes: Use together with Rename to avoid accumulating multiple exports.

5. Select the Export Model Format: original or pmml  
   - Element: **Export Model Format** (dropdown) — parameter list  
   - Notes: Check the table to confirm which formats your upstream component supports.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Rename | text_input | No | — | A new name for the exported model. If left blank, the model is saved using the name of the upstream output model. |
| Overwrite Existing Model | checkbox | No | — | When used together with Rename, overwrites the previously exported model on each run. Configure this to avoid accumulating multiple exports at the same OSS path. |
| Overwrite | checkbox | No | — | Overwrites any model file of the same name at the specified OSS path. |
| Export Model Format | dropdown | Yes | original, pmml | The format of the exported model file. Supported values: original (exports a .meta and .model file) or pmml (exports a .xml file). Check the table above to confirm which formats your upstream component supports. |

## FAQ

Q: Where can I find the list of models I've trained in PAI Designer?
A: Click the **Model List** button above the workflow canvas in Visualized Modeling (Designer). The system automatically detects and displays all deployable models from your workflow.

Q: What model formats are supported for export to OSS?
A: You can export models in either **original** format (producing .meta and .model files) or **PMML** format (producing a .xml file). The available options depend on your upstream component—check the component documentation to confirm support.

Q: Can I modify a deployed EAS service after creation?
A: Yes, you can update a running EAS service by using the **Update EAS Service (Beta)** component in Machine Learning Designer and connecting it to your new model, then running the update node or scheduling it in DataWorks.

Q: Why can't I deploy my pipeline as an online service?
A: Only pipelines built entirely with **Alink algorithm components** (identified by a small purple circle icon) can be deployed as online services. Ensure your pipeline uses only these components and has run successfully with all nodes showing a green check.

Q: What happens if I leave the Dest MaxCompute Project field blank when copying an OfflineModel?
A: If left blank, the model will be copied to the **current workspace's MaxCompute project** by default. You only need to specify a different project if you want to copy across projects.

## Pricing & Billing

### Billing Model
Billing is based on per-request usage for model management operations. Each copy, read, export, or evaluation action counts as one request.

### Price Reference
| Tier | Input Price | Output Price |
|------|-------------|--------------|
| OfflineModel operations | ¥0.001 per request | ¥0.001 per request |
| Lorenz Curve evaluation | ¥0.001 per request | ¥0.001 per request |
| Model service updates | ¥0.0001 per request | ¥0.0001 per request |

### Free Tier
- OfflineModel operations: 100 free requests per month
- Lorenz Curve evaluation: 100 free calls per month
- Model service updates: 100 free calls per month

### Billing Notes
- Each model copy, read, or export operation is billed as one request.
- Exporting large model files may incur additional OSS storage fees.
- Lorenz Curve runs are billed per execution; output tables are retained based on lifecycle settings.
- EAS service updates are billed per request; the free tier supports initial testing and development.
- Pipeline model deployment costs vary by model complexity, inference duration, and OSS storage usage.