DocumentationAPI Reference
Back to ConsoleLog In

Listing Registered Models

To list the models that are registered in RTiC, use the client.get_all_models() command.
You can retrieve a specific model using the client.get_model(model_name=unique_name) command, in which you provide the model’s name and information/metadata.

The information retrieved by using the get_model / get_all_models commands includes –

  • INFERENCE_FRAMEWORK – The framework in which the model was exported.
  • INFERENCE_HW – Whether the model is meant to run on a GPU or CPU, as was defined when registering the model.
  • MODEL_NAME – The model’s name, as you specified when registering the model in the Deci platform model repository.
  • MODEL_UUID – The model’s unique ID provided by the Deci platform.
  • STATE – The model’s state and whether the model is available for inference.
  • Errors – A list of errors if the model was not registered successfully.

The following code sample shows how to list one or more models.
In order to get all of the models that are currently loaded into the connected RTiC Server, execute the following –

client.rtic.get_all_models()

The following is an example of a response –

>>> {'data': {'5cc32066-9601-49b8-b7c7-1093524d4d99': {
                                    'errors': [],
                    'inference_framework':'onnx',
                    'inference_hw': 'cpu',
                    'model_name':'ResNet_50_1_0',
                    'model_uuid': '5cc32066-9601-49b8-b7c7-1093524d4d99',
                    'state': 'available',
                    'transport': 'http'},
          '5cc67066-9601-49b8-b7c7-1093524d4d99': {
                                    'errors': [],
                    'inference_framework':'onnx',
                    'inference_hw': 'cpu',
                    'model_name':'ResNet_50_1_1',
                    'model_uuid': '5cc67066-9602-49b7-b7c7-1093524d4d99',
                    'state': 'available',
                    'transport': 'http'}},},
        'message': 'Successfully fetched the models.',
        'success': True}

In order to get a specific model by name that is currently loaded to the connected RTiC Server, execute the following –

YOUR_MODEL_NAME = 'resnet50'
client.rtic.get_model(model_name=YOUR_MODEL_NAME)

The following is an example of a response –

>>> {'data': {'5cc32066-9601-49b8-b7c7-1093524d4d99': {
                                    'errors': [],
                    'inference_framework':'onnx',
                    'inference_hw': 'cpu',
                    'model_name':'resnet50',
                    'model_uuid': '5cc32066-9601-49b8-b7c7-1093524d4d99',
                    'state': 'available',
                    'transport': 'http'}},
        'message': 'Successfully fetched the models.',
        'success': True}

👍

Note – You can connect RTiC to the platform after startup.

If your RTiC Server is not authorized to perform some actions (401 responses), you should connect your RTiC server using the client method set_platform_api_key

rtic_api_key = client.platform.get_rtic_token()
client.rtic.set_platform_api_key(rtic_api_key)

The following describes how to get a list of all the models registered in the Deci Platform repository, regardless of the client that loaded them –

client.platform.get_all_models()

Did this page help you?