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

# Model Directory

## Prerequisites

Read through the [Trainer Overview](../../../model-zoo/trainer-overview) and [Trainer Configuration Overview](../model-zoo/trainer-configuration-overview). In this guide, you'll use the tools and configurations outlined in those pages.

## Configure the Model Directory

Pass the `model_dir` argument to the [`Trainer`](https://training-api.cerebras.ai/en/latest/wsc/Model-zoo/api/index.html) constructor to set the model directory for trainer artifacts:

<CodeGroup>
  ```yaml YAML theme={null}

  trainer:
    init:
      ...
      model_dir: "./model_dir"

  ```

  ```python Python theme={null}
  import cerebras.pytorch as cstorch
  from cerebras.modelzoo import Trainer

  trainer = Trainer(
      ...,
      model_dir="./model_dir",
  )

  ```
</CodeGroup>

## Model Directory Structure

THe model directory contains a subdirectory named after the datetime for the run. This allows multiple runs to use the same model directory.

```bash theme={null}
model_dir/
├── 20240618_074134
│   ├── eleuther_0
│   │   └── results
│   │       ├── drop_10.json
│   │       ├── drop_5.json
│   │       ├── results_10.json
│   │       ├── results_5.json
│   │       ├── winogrande_10.json
│   │       └── winogrande_5.json
│   ├── events.out.csevents.1718721695.user.17833.0
│   │   └── ...
│   └── events.out.tfevents.1718721695.user.17833.0
├── cerebras_logs
│   ├── 20240618_074134
│   │   ├── run.log
│       └── ...
├── checkpoint_10.mdl
├── checkpoint_5.mdl
└── latest_run.log -> cerebras_logs/20240618_074134/run.log

```

Inside this subdirectory are results from the run. In the above example, you can see the results from an [Eleuther Eval Harness run](../../../model-zoo/core-workflows/downstream-validation-using-eleuther-eval-harness).

This run also used the [`TensorBoardLogger`](https://training-api.cerebras.ai/en/latest/wsc/Model-zoo/api/generated/cerebras.modelzoo.trainer.loggers.html#cerebras.modelzoo.trainer.loggers.TensorBoardLogger) and includes the event files that were written by the TensorBoard writer.

<Note>
  If you open Tensorboard to the model directory, the runs are grouped together by run.

  ```
  tensorboard --bind_all --logdir=./model_dir

  ```
</Note>

Inside the model directory, the `cerebras_logs` directory stores various logs and artifacts from compilation and execution. These logs and artifacts are organized by datetime, matching the previously mentioned subdirectory, to help associate them with specific runs.

Checkpoints taken during the run are also saved in the base model directory, allowing future runs with checkpoint autoloading enabled to access them easily. See [Checkpointing](../../../model-zoo/components/trainer-components/checkpointing) for more details.
