Install and initialize the ValidMind Library
ValidMind generates a unique code snippet for each registered model to connect with your developer environment. You initialize the ValidMind Library with this code snippet, ensuring that your documentation and tests are uploaded to the correct model.
Prerequisites
In order to integrate the library and to be able to upload to the platform, you must provide the following information through a code snippet that you copy from the ValidMind Platform:
Argument | Description |
---|---|
api_host |
The location of the ValidMind API |
api_key |
The account API key |
api_secret |
The account secret key |
model |
The model identifier |
If you do not have a suitable model with a code snippet to use, you can register a model first.2
The library also requires access to the data sources where data sets used for training, testing, and trained model files are stored. This access is needed to run model documentation and validation tests, and to upload to the platform to populate the model documentation and validation reports.
Install ValidMind
Locate the library integration instructions
For existing models, this information can be found in the ValidMind Platform:
In the left sidebar, click Model Inventory.
Select a model by clicking on it or find your model by applying a filter or searching for it.3
In the left sidebar that appears for your model, click Getting Started.
Locate the code snippet and click Copy snippet to clipboard.
Install the library
To install the library:
%pip install validmind
Initialize the library
To initialize the library, paste the code snippet with the client integration details directly into your development source code, replacing this example with your own:
import validmind as vm
vm.init(= "https://API_HOST.validmind.ai/api/v1/tracking",
api_host = "API_KEY",
api_key = "API_SECRET",
api_secret = "MODEL_IDENTIFIER"
model )
After you have pasted the code snippet into your development source code and run your code, the ValidMind Library will connect and register with the ValidMind Platform. You can now use the library to document and test your models, and to upload model documentation and test results to the platform.
Upgrade ValidMind
After installing ValidMind,5 you’ll want to periodically make sure you are on the latest version to access any new features and other enhancements:
In your Jupyter Notebook or developer environment, retrieve the information for the currently installed version of ValidMind:
%pip show validmind
Example output:
Name: validmind
Version: 2.5.15
...
If the version returned is lower than the version indicated in our production open-source code,6 run the following command:
%pip install --upgrade validmind
6 ValidMind GitHub: validmind-library/validmind/__version__.py