Skip to content

Database

Archive : Workflow for Adding a New Model to the Database via the Admin API (Legacy Verison)

This documentation provides a comprehensive guide on how to add a newly trained model to the database using the Admin API. Follow these steps to ensure the model is successfully integrated and available for use.

Warning: In the deployed infrastructure, we no longer use databases or a separate Admin API. Please refer to the updated documentation for the current workflow and API endpoints.

Workflow Steps

Step 1: Access the Admin API

  • Authentication: Ensure you have the necessary authentication credentials to access the Admin API. This involves using the Bearer token that grants access to secure administrative functions.

Step 2: Prepare Model Information

  • Model Metadata: Before adding the model to the database, gather all relevant metadata. This includes the model name, project name, description, and asset type. Use /admin_api/v1/{container_name}/models to make sure the trained model is in the blob.
  • Find Project ID: Use the /admin_api/v1/projects endpoint to find the project id corresponding to the container name (your project name).

Step 3: Create a Custom Model Entry

  • Endpoint: Use the /admin_api/v1/custom-model endpoint to create a new entry for your model.
  • Request Payload:
  • Include the model metadata prepared in step 1.
  • Example payload format:
    {
    "cm_model_name": "my_new_model_name",
    "project_id": "my25characterslongID",
    "description": "explain assets used or other important remarks"
    }
    
  • HTTP Method: POST
  • Response: On success, you should receive a confirmation response with model name, the corresponding asset type etc, make sure these are identical to the ones used during training.

Step 4: Update or Modify Model

  • Endpoint: If changes are needed, use /admin_api/v1/custom-models/{model_name} to update the model entry.
  • HTTP Method: PUT
  • Request Payload: Modify the necessary fields in the model metadata as required.
  • Example payload format:
    {
    "class_descriptor": "string",
    "description": "string"
    }
    

Step 5: Monitor Model Usage

  • Tracking: Use endpoints like /admin_api/v1/jobs to monitor how and when the model is being utilized.
  • Performance Checks: Regularly check the performance metrics to ensure the model is functioning as expected.

Additional Tips

  • Documentation: Keep comprehensive documentation of the model details and any adjustments made to ensure transparency and reproducibility.
  • Testing: Before deploying the model fully, conduct thorough testing to verify its performance across various scenarios.