Skip to content

hsml.triton.signature #

create_model #

create_model(
    name: str,
    version: int | None = None,
    metrics: dict | None = None,
    description: str | None = None,
    input_example: pandas.DataFrame
    | pandas.Series
    | numpy.ndarray
    | list
    | None = None,
    model_schema: ModelSchema | None = None,
    feature_view: FeatureView | None = None,
    training_dataset_version: int | None = None,
    tags: tag.Tag
    | dict[str, Any]
    | list[tag.Tag | dict[str, Any]]
    | None = None,
) -> Model

Create a Triton Inference Server model metadata object.

The directory passed to save() is one Triton model: its config.pbtxt, at least one numeric version folder such as 1/, and any files the backend needs, for example a conda-pack archive referenced by EXECUTION_ENV_PATH. Leave name out of config.pbtxt, because Triton serves the model under the deployment name and fails to load a model whose configured name differs. Triton serves the version folders its version_policy selects, by default the highest one, independently of the model registry version.

Lazy

This method is lazy and does not persist any metadata or upload model artifacts in the model registry on its own. To save the model object and the model artifacts, call the save() method with a local path to the directory containing the model artifacts.

PARAMETER DESCRIPTION
name

Name of the model to create.

TYPE: str

version

Version of the model to create. When it is None, the model gets the version after the last one in the model registry.

TYPE: int | None DEFAULT: None

metrics

Model evaluation metrics, for example accuracy or MAE.

TYPE: dict | None DEFAULT: None

description

Description of the model.

TYPE: str | None DEFAULT: None

input_example

An input example that represents a single input for the model.

TYPE: pandas.DataFrame | pandas.Series | numpy.ndarray | list | None DEFAULT: None

model_schema

A model schema for the model inputs and outputs.

TYPE: ModelSchema | None DEFAULT: None

feature_view

The feature view the model was trained from, as returned by the feature store. Without it, the model has no provenance.

TYPE: FeatureView | None DEFAULT: None

training_dataset_version

The training dataset version the model was trained on. When it is None and feature_view is set, it is the training dataset of the feature view that this code or notebook read last.

TYPE: int | None DEFAULT: None

tags

Optionally the tags to attach to the model when it is saved, in the same shapes accepted by feature groups. A single Tag, a {"name": "owner", "value": "team-a"} dict, or a list of either, for example [{"name": "owner", "value": "team-a"}]. The tags ride the create request, so any mandatory model tags missing from them cause the backend to reject the save.

TYPE: tag.Tag | dict[str, Any] | list[tag.Tag | dict[str, Any]] | None DEFAULT: None

RETURNS DESCRIPTION
Model

The model metadata object.