Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions site/developer/how-to/feature-overview.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ listing:
- id: tests
type: grid
grid-columns: 2
page-size: 4
image-placeholder: "jupyter-logo-rectangle.svg"
max-description-length: 350
image-height: "100%"
Expand All @@ -17,6 +18,7 @@ listing:
- id: data-and-datasets
type: grid
grid-columns: 2
page-size: 4
image-placeholder: "jupyter-logo-rectangle.svg"
max-description-length: 350
image-height: "100%"
Expand All @@ -25,6 +27,7 @@ listing:
- id: metrics
type: grid
grid-columns: 2
page-size: 4
image-placeholder: "jupyter-logo-rectangle.svg"
max-description-length: 350
image-height: "100%"
Expand All @@ -33,6 +36,7 @@ listing:
- id: scoring
type: grid
grid-columns: 2
page-size: 4
image-placeholder: "jupyter-logo-rectangle.svg"
max-description-length: 350
image-height: "100%"
Expand Down
5 changes: 5 additions & 0 deletions site/developer/model-documentation/_code-snippet.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Copyright © 2023-2026 ValidMind Inc. All rights reserved.
Refer to the LICENSE file in the root of this repository for details.
SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial -->

Initialize the {{< var validmind.developer >}} with the _code snippet_ unique to each model per document to connect your environment to the {{< var validmind.platform >}}, ensuring test results are uploaded to the correct model and automatically populated in the right document.
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,69 @@ aliases:
- /guide/install-and-initialize-validmind-library.html
- /guide/install-and-initialize-developer-framework.html
- install-and-initialize-client-library.html
listing:
- id: whats-next
type: grid
max-description-length: 250
sort: false
fields: [title, description]
grid-columns: 2
contents:
- store-credentials-in-env-file.qmd
- ../how-to/testing-overview.qmd
---

{{< var vm.product >}} generates a unique _code snippet_ for each registered model to connect with your developer environment. You initialize the {{< var validmind.developer >}} with this code snippet, ensuring that your documentation and tests are uploaded to the correct model.
{{< include _code-snippet.qmd >}}

::: {.attn}

## Prerequisites

- [x] {{< var link.login >}}
- [x] You are the model owner.[^1]
- [x] You are a [{{< fa code >}} Developer]{.bubble} or assigned another role with sufficient permissions to perform the tasks in this guide.[^2]
- [x] The model you want to connect to is registered in the model inventory.[^1]
- [x] The model document has a template applied.[^2]
- [x] You are the model owner, model validator, or another model stakeholder with write access to the model's documents.[^3]

In order to integrate the {{< var vm.developer >}} and to be able to upload to the {{< var vm.platform >}}, you must provide the following information through a code snippet that you copy from the {{< var validmind.platform >}}:
::: {.callout}
The {{< var validmind.developer >}} requires access to the data sources where relevant datasets and model files are stored in order to help you run tests.

:::


:::

## Installing the {{< var validmind.developer >}}

In order to upload test results from the {{< var validmind.developer >}} to the {{< var validmind.platform >}}, provide the following information through a code snippet copied from the {{< var vm.platform >}}:

| Argument | Description |
|---------------|------------------------------------|
| `api_host` | The location of the {{< var vm.product >}} API |
| `api_key` | The account API key |
| `api_secret` | The account secret key |
| `document` | The model document identifier 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.[^3]
### Get your code snippet

The {{< var vm.developer >}} 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 {{< var vm.platform >}} to populate the model documentation and validation reports.
Retrieve your code snippet for your model's selected document from the {{< var validmind.platform >}}:

:::
1. In the left sidebar, click **{{< fa cubes >}} Inventory**.

## Install {{< var vm.product >}}
2. Select a model by clicking on it or find your model by applying a filter or searching for it.[^4]

### Locate the {{< var vm.developer >}} integration instructions
3. In the left sidebar that appears for your model, click **{{< fa rocket >}} Getting Started**.

For existing models, this information can be found in the {{< var validmind.platform >}}:
4. Select the **[document]{.smallcaps}** you want to automatically upload test results to.[^5]

1. In the left sidebar, click **{{< fa cubes >}} Inventory**.
5. Click **{{< fa regular copy >}} Copy snippet to clipboard**.

2. Select a model by clicking on it or find your model by applying a filter or searching for it.[^4]
::: {.callout}
## Selecting a **[document]{.smallcaps}** to connect to requires {{< var validmind.developer >}} version >=2.12.0.[^6]

3. In the left sidebar that appears for your model, click **{{< fa rocket >}} Getting Started**.
A template must already be applied to your selected document to populate test results in the {{< var validmind.platform >}}. Attempting to initialize the {{< var vm.developer >}} with a document that does not have a template applied will result in an error.

4. Locate the code snippet and click **{{< fa regular copy >}} Copy snippet to clipboard**.
:::

### Install the {{< var vm.developer >}}

Expand All @@ -70,21 +93,27 @@ vm.init(
api_host = "{{< var api.host >}}/tracking",
api_key = "API_KEY",
api_secret = "API_SECRET",
document="document-key", # requires library >=2.12.0
model = "MODEL_IDENTIFIER"
)
```

:::{.callout}
To also enable monitoring, add `monitoring=True` to the `vm.init` method in your code snippet. [^5]
To also enable monitoring, add `monitoring=True` to the `vm.init` method in your code snippet. [^7]
:::

After you have pasted the code snippet into your development source code and run your code, the {{< var validmind.developer >}} will connect and register with the {{< var validmind.platform >}}. You can now use the {{< var vm.developer >}} to document and test your models, and to upload model documentation and test results to the {{< var vm.platform >}}.
::: {.feature}
#### **Automate with {{< var vm.product >}}**

After you run the code snippet in your environment, the {{< var validmind.developer >}} will connect to your model and selected document in the {{< var validmind.platform >}}. Automate your workflow by using the {{< var vm.developer >}} to run tests, then seamlessly upload your test results to the {{< var vm.platform >}}.

:::

## Upgrade {{< var vm.product >}}
## Upgrade the {{< var validmind.developer >}}

After installing {{< var vm.product >}},[^6] you'll want to periodically make sure you are on the latest version to access any new features and other enhancements:
After installing the {{< var validmind.developer >}},[^8] you'll want to periodically make sure you are on the latest version to access any new features and other enhancements:

1. In your Jupyter Notebook or developer environment, retrieve the information for the currently installed version of {{< var vm.product >}}:
1. In your Jupyter Notebook or developer environment, retrieve the information for the currently installed version of the {{< var vm.developer >}}:

```python
%pip show validmind
Expand All @@ -94,29 +123,39 @@ After installing {{< var vm.product >}},[^6] you'll want to periodically make su
**Example output:**
```bash
Name: validmind
Version: 2.5.15
Version: 2.11.0
...
```
:::

2. If the version returned is lower than the version indicated in our production open-source code,[^7] run the following command:
2. If the version returned is lower than the version indicated in our production open-source code,[^9] run the following command:

```python
%pip install --upgrade validmind
```

## What's next

:::{#whats-next}
:::


<!-- FOOTNOTES -->

[^1]: [Manage model stakeholders](/guide/model-inventory/edit-model-inventory-fields.qmd#manage-model-stakeholders)
[^1]: [Register models in the inventory](/guide/model-inventory/register-models-in-inventory.qmd)

[^2]: [Manage permissions](/guide/configuration/manage-permissions.qmd)
[^2]: [Working with templates](/guide/templates/working-with-document-templates.qmd)

[^3]: [Register models in the inventory](/guide/model-inventory/register-models-in-inventory.qmd)
[^3]: [Manage model stakeholders](/guide/model-inventory/edit-model-inventory-fields.qmd#manage-model-stakeholders)

[^4]: [Working with the model inventory](/guide/model-inventory/working-with-model-inventory.qmd#search-filter-and-sort-models)

[^5]: [Ongoing monitoring](/guide/monitoring/ongoing-monitoring.qmd)
[^5]: [Working with model documents](/guide/templates/working-with-model-documents.qmd)

[^6]: [Upgrade the {{< var validmind.developer >}}](#upgrade-the)

[^7]: [Ongoing monitoring](/guide/monitoring/ongoing-monitoring.qmd)

[^6]: [Install {{< var vm.product >}}](#install-validmind)
[^8]: [Install {{< var vm.product >}}](#install-validmind)

[^7]: **ValidMind GitHub:** [validmind-library/validmind/&lowbar;&lowbar;version&lowbar;&lowbar;.py](https://github.com/validmind/validmind-library/blob/prod/validmind/__version__.py)
[^9]: **ValidMind GitHub:** [validmind-library/validmind/&lowbar;&lowbar;version&lowbar;&lowbar;.py](https://github.com/validmind/validmind-library/blob/prod/validmind/__version__.py)
Loading
Loading