Execution Overview
This section explains how to execute model serving tasks in the ModelServe runtime. First, we list the function types and actions, then we examine the usage pattern. Finally, we provide links to detailed documentation for each parameter category.
Function types and Actions
There are multiple function kinds in the ModelServe runtime:
sklearnserve: Serve scikit-learn modelsmlflowserve: Serve MLflow modelshuggingfaceserve: Serve HuggingFace modelskubeai-text: Serve text generation models via KubeAIkubeai-speech: Serve speech processing models via KubeAI
Each kind supports specific actions.
| Function Kind | Supported Actions |
|---|---|
sklearnserve |
serve |
mlflowserve |
serve |
huggingfaceserve |
serve |
kubeai-text |
serve |
kubeai-speech |
serve |
Usage Pattern
To execute a model serving task, follow this pattern:
- Use
dh.new_function()orproject.new_function()to create the function, passing function parameters. - Call
function.run()with the desired action, passing task parameters and run parameters.
# Create function with function parameters
function = dh.new_function(
name="my-model-function",
kind="mlflowserve",
path="s3://my-bucket/path-to-model"
)
# Execute with task and run parameters
run = function.run(
action="serve", # Task parameter
replicas=1 # Task parameter
)
ModelServe functions are executed remotely on Kubernetes clusters managed by the platform.
Parameter Documentation
Here are links to the detailed documentation for each ModelServe action:
- sklearnserve serve — Deploy scikit-learn models as services
- mlflowserve serve — Deploy MLflow models as services
- huggingfaceserve serve — Deploy HuggingFace models as services
- kubeai-text serve — Deploy text processing models via KubeAI
- kubeai-speech serve — Deploy speech processing models via KubeAI