Enable monitoring

Published

April 7, 2026

To start uploading ongoing monitoring results for a model to ​ValidMind, enable monitoring in your code snippet within the ValidMind Platform and then select a monitoring template. You can enable monitoring for both new and existing models.

NoneTo try out monitoring, check out the code sample for ongoing monitoring of models.

Prerequisites

Steps

Initialize the ValidMind Library with the code snippet unique to each model per document to connect your environment to the ValidMind Platform, ensuring test results are uploaded to the correct model and automatically populated in the right document.

To enable ongoing monitoring for a model, add monitoring=True to your code snippet:

  1. In the ValidMind Platform, either register a new model2 or locate an existing model:

    • In the left sidebar, click Inventory.
    • Select a model or find your model by applying a filter or searching for it.3
  2. Copy the code snippet for the model:

    • In the left sidebar that appears for your model, click Getting Started.
    • Select a Monitoring document type from the document drop-down menu.4
    • Set enable monitoring? to true.
    • Click Copy snippet to clipboard.

4 Selecting a document to connect to requires ValidMind Library version >=2.12.0.

Before you can start sending ongoing monitoring data using the ValidMind Library to the ValidMind Platform, you must select a monitoring template:

  1. In the ValidMind Platform, click Inventory in the left sidebar.

  2. Select a model or find your model by applying a filter or searching for it.5

  3. In the left sidebar that appears for your model, click Documents and select the Latest tab.6

  4. Click on a Monitoring type file.7

  5. From the template drop-down, select one of the available monitoring templates.

  6. Click Use Template to apply your desired template.

    • After you select a template, the initial document where your ongoing monitoring results will be stored becomes available.
    • Review this documents structure to confirm that it meets your requirements, then start running your code to populate the template with monitoring results.
  1. Paste the code snippet into your Jupyter Notebook or other development environment.

  2. Confirm that monitoring=True is present in the vm.init method, similar to this example:

    import validmind as vm
    
    vm.init(
        api_host="https://api.prod.validmind.ai/api/v1/tracking",
        api_key="...",
        api_secret="...",
        model="...",
        document="monitoring", # Unique key for your monitoring document
        monitoring=True
    )


    Load your model credentials from your .env file, then remove the inline credentials from vm.init() after importing the library.

    You’ll still need to include your document key and the monitoring flag.

    Store model credentials in .env files

    %load_ext dotenv
    %dotenv .env
    
    import validmind as vm
    
    vm.init(
       document="monitoring",
       monitoring=True
    )
  3. Run the code snippet to initialize the ValidMind Library and connect to the selected monitoring document for your model in the ValidMind Platform.8

NoneA template must already be applied to your selected document to populate monitoring test results in the ValidMind Platform.

Attempting to initialize the library with a document that does not have a template applied will result in an error.

What’s next

After you have enabled ongoing monitoring and run your code to generate some output, you can start reviewing the monitoring results.9