# Key values

> Key values - Manage key-value configuration for models, deployments, and other entities with the
> Python API client.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-04-24T16:03:56.284059+00:00` (UTC).

## Primary page

- [Key values](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html): Full documentation for this topic (HTML).

## Sections on this page

- [Manage key values](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#manage-key-values): In-page section heading.
- [Create a key value](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#create-a-key-value): In-page section heading.
- [List key values](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#list-key-values): In-page section heading.
- [Retrieve a key value](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#retrieve-a-key-value): In-page section heading.
- [Find key values by name](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#find-key-values-by-name): In-page section heading.
- [Update key values](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#update-key-values): In-page section heading.
- [Get key value data](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#get-key-value-data): In-page section heading.
- [Delete key values](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/key_values.html#delete-key-values): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [Developer learning](https://docs.datarobot.com/en/docs/api/dev-learning/index.html): Linked from this page.
- [Python API client user guide](https://docs.datarobot.com/en/docs/api/dev-learning/python/index.html): Linked from this page.
- [MLOps](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/index.html): Linked from this page.

## Documentation content

# Key values

Key values associated with a DataRobot model, deployment, job, or other DataRobot entities are key-value pairs containing information about the related entity.
Each key-value pair has the following:

- Name : The unique and descriptive name of the key (for the model package or version).
- Value type : The data type of the value associated with the key. The possible types are string, numeric, boolean, URL, image, dataset, pickle, binary, JSON, or YAML.
- Category : The type of model information provided by the key value. The possible types are training parameter, metric, tag, artifact, and runtime parameter.
- Value : The stored data or file.

You can include string, numeric, boolean, image, and dataset key values in custom compliance documentation templates.

In addition, with key values for registered models, when you generate compliance documentation for a model package and reference a supported key value in the template, DataRobot inserts the matching values from the associated model package.

## Manage key values

Use the following commands to manage key values.

### Create a key value

To create a key value, use `dr.KeyValue.create`:

```
import datarobot as dr

registered_model_id = "65ccb597732422fa2297199e"

key_value = dr.KeyValue.create(
    registered_model_id,
    dr.KeyValueEntityType.REGISTERED_MODEL,
    "my-kv-name",
    dr.KeyValueCategory.TAG,
    dr.KeyValueType.STRING,
    "tag-name",
)

key_value.id
>>> '65f32822be17d11dec9ebdfb'
```

### List key values

To list all key values available to the current user, use `dr.KeyValue.list`:

```
import datarobot as dr

registered_model_id = "65ccb597732422fa2297199e"

key_values = dr.KeyValue.list(registered_model_id, dr.KeyValueEntityType.REGISTERED_MODEL)

key_values
>>> [KeyValue('my-kv-name')]
```

### Retrieve a key value

To get a key value by unique identifier, use `dr.KeyValue.get`:

```
import datarobot as dr

key_value = dr.KeyValue.get("65f32822be17d11dec9ebdfb")

key_value
>>> KeyValue('my-kv-name')
```

### Find key values by name

To find a key value by name, use `dr.KeyValue.find`. Provide the entity ID, entity type, and key value name:

```
import datarobot as dr

key_value = dr.KeyValue.find("65f32822be17d11dec9ebdfb", dr.KeyValueEntityType.REGISTERED_MODEL, "my-kv-name")

key_value
>>> KeyValue('my-kv-name')
```

### Update key values

To get a key value by unique identifier and update it, use `dr.KeyValue.get()` and then `update()`:

```
import datarobot as dr

key_value = dr.KeyValue.get("65f32822be17d11dec9ebdfb")

key_value.update(value=4.7)
key_value.update(value_type=dr.KeyValueType.STRING, value="abc")
key_value.update(name="new-kv-name")
```

### Get key value data

To get the value from a key value, use `dr.KeyValue.get_value()`. Provide the key value ID:

```
import datarobot as dr

key_value = dr.KeyValue.get("65f32822be17d11dec9ebdfb")

key_value.update(value=4.7)
key_value.get_value()
>>> 4.7

key_value.update(value_type=dr.KeyValueType.STRING, value="abc")
key_value.get_value()
>>> "abc"

key_value.update(value_type=dr.KeyValueType.BOOLEAN, value=True)
key_value.get_value()
>>> True
```

### Delete key values

To get a key value by unique identifier and delete it, use `dr.KeyValue.get()` and then `delete()`:

```
import datarobot as dr

key_value = dr.KeyValue.get("65f32822be17d11dec9ebdfb")
key_value.delete()
```
