githubEdit

Model Metadata

metadata

Examples

Basic Examples

Metadata integrations with Frameworks

Model Metadata

With Seldon you can easily add metadata to your models.

Prepackaged model servers

To add metadata to your prepackaged model servers simply add a file named metadata.yaml to the S3 bucket with your model:

See SKLearn Server example with MinIOarrow-up-right for more details.

Python Language Wrapper

You can add model metadata you your custom Python model by implementing init_metadata method:

See Python wrapperarrow-up-right documentation for more details and notebook Basic Examples for Model with Metadataarrow-up-right.

Overwrite via environmental variable

You can also always specify MODEL_METADATA environmental variable which takes ultimate priority.

Deployment Metadata

Model metadata allow you to specify metadata for each of the components (nodes) in your graph. New orchestrator engine will probe all nodes for their metadata and derive global inputs and outputs of your graph. It will then expose them together with all nodes' metadata at a single endpoint /api/v1.0/metadata/ of your deployment.

graph-metadata

Example response:

See example notebookarrow-up-right for more details.

Metadata endpoint

Model metadata can be obtained through GET request at /api/v1.0/metadata/{MODEL_NAME} endpoint of your deployment.

Example response:

Deep dive: SeldonMessage and kfserving V2 metadata reference

You can define inputs/outputs of your model metadata using one of two formats:

Though most fields that you can specify on model metadata follows kfserving dataplane proposalarrow-up-right you can also specify extra one called custom that allows you define any custom metadata you may find useful. The custom field is meant to hold dict-like structure with both keys and values being string.

See also: Metadata Schema and Validationarrow-up-right notebook.

SeldonMessage metadata

ndarray input/output

This metadata would mean that following two input is valid for this model:

Note: similar format is valid for messagetype of tensor and tftensor.

jsonData input/output

Example model input:

The schema field is optional and can leaves user total freedom over its structure.

Note: as you can see you can mix inputs and outputs of different types!

strData input/output

Example model input:

custom input/output format

You can also specify your custom messagetype. In this case there are no restrictions on keys that you define under the schema field. This may be useful for raw methods.

V2 TensorMetadata

You can easily define metadata for your models that is compatible with kfserving V2 dataplane proposalarrow-up-right specification.

with

Example definition

Last updated

Was this helpful?