ML model service API | Service APIs

ML model service API

The ML model service API allows you to make inferences based on a provided ML model.

The ML model service supports the following methods:

Method Name Description
Infer Take an already ordered input tensor as an array, make an inference on the model, and return an output tensor map.
Metadata Get the metadata: name, data type, expected tensor/array shape, inputs, and outputs associated with the ML model.
Reconfigure Reconfigure this resource.
DoCommand Execute model-specific commands that are not otherwise defined by the service API.
GetResourceName Get the ResourceName for this instance of the ML model service.
Close Safely shut down the resource and prevent further use.

API

Infer

Take an already ordered input tensor as an array, make an inference on the model, and return an output tensor map.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Go SDK Docs.

Metadata

Get the metadata: name, data type, expected tensor/array shape, inputs, and outputs associated with the ML model.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Go SDK Docs.

Reconfigure

Reconfigure this resource. Reconfigure must reconfigure the resource atomically and in place.

Parameters:

Returns:

For more information, see the Go SDK Docs.

DoCommand

Execute model-specific commands that are not otherwise defined by the service API. Most models do not implement DoCommand. Any available model-specific commands should be covered in the model’s documentation. If you are implementing your own ML model service and want to add features that have no corresponding built-in API method, you can implement them with DoCommand.

Parameters:

Returns:

Example:


Copy

For more information, see the Go SDK Docs.

GetResourceName

Get the ResourceName for this instance of the ML model service.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Go SDK Docs.

Close

Safely shut down the resource and prevent further use.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the Go SDK Docs.