Model 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 MinIO for more details.
Python Language Wrapper
You can add model metadata you your custom Python model by implementing init_metadata method:
See Python wrapper documentation for more details and notebook Basic Examples for Model with Metadata.
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.
Example response:
See example notebook 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:
v1format that closely correlates to the current structure ofSeldonMessagev2format that is future-proof and fully compatible with kfserving dataplane proposal.
Though most fields that you can specify on model metadata follows kfserving dataplane proposal 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 Validation 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 proposal specification.
with
Example definition
Last updated
Was this helpful?