Skip to content

Create a Scikit-learn Serving Function

Define the Function with the scikit-learn model path and serving image.

Parameters

Name Type Required Description
project str (✓) Project name. Required only when creating from the library; otherwise MUST NOT be set.
name str ✓ Name that identifies the object.
kind str ✓ Function kind. Must be sklearnserve.
uuid str Object ID in UUID4 format.
description str Description of the object.
labels list[str] List of labels.
embedded bool Whether to embed the object in the project.
path str Model path.
model_name str Name of the model.
image str Docker image used to serve the model.

Model path

The SDK stores the model path as a string and does not validate its format locally. Provide a model key, an S3 path partition, or a zip archive supported by the platform.

Model image

The SDK stores the image as a string and does not validate its format locally. Provide an image compatible with the scikit-learn serving runtime.

Example

function = dh.new_function(
    name="my-sklearn-service",
    kind="sklearnserve",
    path=model.key
)