> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trymonte.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Environments and their versions

These commands create an environment, add it as a version, and move it between instances and artifact storage. [Environments](https://docs.trymonte.ai/environments/overview.md) explains the tasks, the server, and the grader of an environment.

| Command | Description |
| - | - |
| [`monte env create`](#monte-env-create) | Create a new environment from a template |
| [`monte env add`](#monte-env-add) | Add an eval or a training environment as a new version |
| [`monte env list`](#monte-env-list) | List environments |
| [`monte env show`](#monte-env-show) | Show one environment |
| [`monte env install`](#monte-env-install) | Install an environment version on this machine |
| [`monte env delete`](#monte-env-delete) | Remove an environment from artifact storage |

## monte env create

```text theme={null}
monte env create <name> [--json]
```

Write a new NeMo Gym resources server from the Gym template: `app.py` for the grader, a server config, and a `data/` directory. The files go under `monte-gym/resources_servers/<name>/`, or under the first directory in `MONTE_GYM_ROOTS`.

| Flag | Type | Default | Description |
| - | - | - | - |
| `<name>` | argument | required | Lowercase letters, digits, and `_`, for example `support_escalation` |
| `--json` | flag | off | Print JSON on stdout |

```bash theme={null}
monte env create support_escalation
```

```text theme={null}
Created monte-gym/resources_servers/support_escalation/
  app.py
  configs/support_escalation.yaml
  data/
Write the verify method in app.py, then add it with monte env add.
```

| Error | Cause |
| - | - |
| `E_REFUSAL` | The directory exists, or the name has a character other than lowercase letters, digits, and `_` |

## monte env add

```text theme={null}
monte env add --eval <benchmark> --as <name> [--json]
monte env add --training <grader> --as <name> [--json]
```

Add an environment as an immutable version. The command runs Gym's prepare or collate step once, hashes the grader code, the task rows, and the configs, and writes a manifest and a fingerprint. Then it pushes the result to artifact storage. Each add of a name makes a new version: `support-escalation@1`, then `support-escalation@2`.

| Flag | Type | Default | Description |
| - | - | - | - |
| `--eval` | string | | An eval config under `monte-gym/benchmarks/`. The result is an eval environment. |
| `--training` | string | | A resources server whose config declares a task file of `type: train`. The result is a training environment. |
| `--as` | string | required | The environment name, with lowercase letters, digits, and `-` |
| `--json` | flag | off | Print JSON on stdout |

State `--eval` or `--training`, never both.

```bash theme={null}
monte env add --eval support_escalation --as support-escalation
```

```text theme={null}
prepared    benchmarks/support_escalation/prepare.py -> 200 tasks
grader      support_escalation  sha256 7a3c1f88...
tasks       sha256 c90d4e12...
added       support-escalation@1 (eval)  fingerprint 3f9a1c0e7b2d4a61
pushed      gs://helpdesk-monte-artifacts/environments/support-escalation/1
```

| Error | Cause |
| - | - |
| `E_REFUSAL` | The config declares no task file of the right type, or a training environment names a closed-weight judge |
| `E_NOT_FOUND` | No eval config or resources server has that name |
| `E_STORAGE` | Artifact storage is unreachable |

## monte env list

```text theme={null}
monte env list [--stored] [--json]
```

List the environment versions on this machine.

| Flag | Type | Default | Description |
| - | - | - | - |
| `--stored` | flag | off | List the environments in artifact storage |
| `--json` | flag | off | Print JSON on stdout |

```bash theme={null}
monte env list
```

```text theme={null}
NAME                       KIND       VERSION   TASKS   FINGERPRINT
support-escalation         eval       1         200     3f9a1c0e7b2d4a61
support-escalation-dev     eval       2         200     d18b2e70c4a95f13
support-escalation-train   training   1         4,800   90c3b7e1a25d0f44
```

## monte env show

```text theme={null}
monte env show <name>[@<version>] [--json]
```

Show one environment: its kind, its versions, its fingerprint, its task count, the hashes of its grader and its rows, and the experiments that pin it.

| Flag | Type | Default | Description |
| - | - | - | - |
| `<name>[@<version>]` | argument | required | The environment. A bare name means the newest version. |
| `--json` | flag | off | Print JSON on stdout |

```bash theme={null}
monte env show support-escalation-dev
```

```text theme={null}
environment support-escalation-dev@2 (eval)  versions 1, 2
fingerprint d18b2e70c4a95f13
tasks       200  sha256 51e7a0c3... (same as @1)
grader      support_escalation  sha256 e41b09d2...  (@1: 7a3c1f88...)
domain      other
pinned by   support-triage-v2
```

## monte env install

```text theme={null}
monte env install <name>[@<version>] | --all [--force] [--json]
```

Fetch an environment from artifact storage and install it on this machine. The command checks every hash against the manifest before it writes a file.

| Flag | Type | Default | Description |
| - | - | - | - |
| `<name>[@<version>]` | argument | | The environment to install |
| `--all` | flag | off | Install every environment in artifact storage |
| `--force` | flag | off | Install again when the local copy is complete |
| `--json` | flag | off | Print JSON on stdout |

```bash theme={null}
monte env install support-escalation
```

```text theme={null}
support-escalation@1  verified 3 files against the manifest, installed in ~/monte-data/environments/support-escalation/1
```

| Error | Cause |
| - | - |
| `E_CORRUPT_STATE` | A file fails its hash |
| `E_NOT_FOUND` | Artifact storage holds no environment with that name |

## monte env delete

```text theme={null}
monte env delete <name>[@<version>] [--yes] [--json]
```

Remove an environment from artifact storage and from this machine. A bare name removes every version.

| Flag | Type | Default | Description |
| - | - | - | - |
| `<name>[@<version>]` | argument | required | The environment, or one version of it |
| `--yes` | flag | off | Skip the prompt |
| `--json` | flag | off | Print JSON on stdout |

```bash theme={null}
monte env delete support-escalation-dev@1
```

```text theme={null}
E_IN_USE: support-escalation-dev@1 is pinned by experiment support-triage (delete the experiment first, or keep the version)
```

| Error | Cause |
| - | - |
| `E_IN_USE` | An experiment pins the version |

A training environment is not pinned by an experiment, so its delete proceeds. Run history keeps the record that a run trained on it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.