Switch Web API


This page introduces how to switch the endpoint by deploying a newly created model as a Web API using ABEJA Platform GUI.

Add model version

Add a new model version in the trained model, deploy that version as a Web API, and then switch to the currently used Web API.

Manage model versions from training results

For models, if the learning job is completed, registration and version management are automatically performed as a model. If you want to upload individually, please refer to Create Model.

Version control inference code

Click “Codes” in the left menu and select “Create Version”.

Item Value Remark
Source Code -
Inference code in Zip format and upload / template selection
Code Version 1.0.1 Enter a managed version of the inference code
Runtime abeja-inc/all-cpu:19.04 Select a Docker image to perform inference
Model Handler predict:handler Specify Handler to execute inference code

A new inference code version has been registered.

Switch to HTTP service created with new model version

Click “Create HTTP Service” button from “Services”.

Select the “Cloud” tab, set the following values ​​in the input form, and click “Create HTTP Service” to create an HTTP service.

Item Value Remark
Code 1.0.1 Specify the version of inference code managed by Deployment
Model fashion_classification Specify the model
Model Version XXXXXXXXXXXX Specify the training job ID to be used
Instance Type cpu-0.25 HTTP service specifications
Instance Number 1 Number of instances

You can check the environment variables registered in the HTTP service by clicking the icon to the right of Service ID.

HTTP service created with new version.

Update alias

Since the newly created Web API was able to operate correctly, the Web API that sends the request is switched.

Click the Primary button to display the screen for switching.

Select the Version from New Model version (Cloud service only).

When “Update” is selected, switching is complete.

You can use the curl command to check if the alias direction has actually changed. You can check the curl command by clicking the icon to the right of the HTTP service alias.

The created model will be in the following format.

curl -X POST \
     -u user-xxxxx:xxxxxx \
     -H "Content-Type: image/jpeg" \
     --data-binary @sample.jpg \    
     https://{organization name}.api.abeja.io/deployments/{deployment id}