---
name: customization
description: Run model fine-tuning and customization jobs
version: "0.2"
---

# Customization

Fine-tune a model on your own data to improve its performance on domain-specific tasks.

## Prerequisites

Confirm the base model you want to fine-tune is available:

```bash
nemo models list
```

You need a training dataset on your local machine in a format accepted by the customization service (JSONL is typical).

## Upload Training Data

First, create a fileset to hold the training data:

```bash
nemo files filesets create my-training-data --description "Training data for fine-tuning"
```

Then upload your data file (the local path is a positional argument):

```bash
nemo files upload ./data/train.jsonl my-training-data
```

Alternatively, omit `--fileset` to auto-create a fileset:

```bash
nemo files upload ./data/train.jsonl
```

Verify the fileset and files:

```bash
nemo files filesets list
nemo files list my-training-data
```

## Create a Customization Job

The `create` command takes a `--spec` JSON string (or `--input-file` / `--input-data`). The spec requires:
- `dataset`: a fileset URI in `fileset://{workspace}/{fileset-name}` format
- `model`: the model entity name
- `training`: an object with a `type` discriminator (e.g., `"sft"` for supervised fine-tuning)

### Using --spec (inline JSON)

```bash
nemo customization jobs create my-finetune-job \
  --spec '{
    "model": "meta-llama-3-2-1b-instruct",
    "dataset": "fileset://my-workspace/my-training-data",
    "training": {"type": "sft"}
  }'
```

Replace `my-workspace` with your actual workspace name (check with `nemo config view`).

### Using --input-file (JSON file)

Create a file `job-config.json`:

```json
{
  "name": "my-finetune-job",
  "spec": {
    "model": "meta-llama-3-2-1b-instruct",
    "dataset": "fileset://my-workspace/my-training-data",
    "training": {"type": "sft"}
  }
}
```

Then run:

```bash
nemo customization jobs create --input-file job-config.json
```

## Monitor a Job

List all customization jobs:

```bash
nemo customization jobs list
nemo customization jobs list -f json
```

Check the status of a specific job by name:

```bash
nemo customization jobs get-status my-finetune-job
```

Stream logs while a job is running:

```bash
nemo customization jobs get-logs my-finetune-job
```

## Pause, Resume, and Cancel

Temporarily pause a running job:

```bash
nemo customization jobs pause JOB_NAME
```

Resume a paused job:

```bash
nemo customization jobs resume JOB_NAME
```

Cancel a job that is no longer needed:

```bash
nemo customization jobs cancel JOB_NAME
```

## View Results

Once a job reaches the `COMPLETED` status, list the output artifacts:

```bash
nemo customization jobs results list --job-id JOB_NAME
```

The results are stored in a fileset. Download them to a local directory:

```bash
nemo files download RESULT_FILESET -o ./output/my-finetune
```

Replace `RESULT_FILESET` with the fileset name shown in the results list output.

## Typical Workflow

1. `nemo models list` — confirm base model is available
2. `nemo files filesets create NAME` — create a fileset for training data
3. `nemo files upload ./data/train.jsonl NAME` — upload training data
4. `nemo files list NAME` — verify upload
5. `nemo customization jobs create JOB --spec '{"model": "...", "dataset": "fileset://WORKSPACE/NAME", "training": {"type": "sft"}}'` — start the job
6. `nemo customization jobs list` — find your job and check status
7. `nemo customization jobs get-logs JOB` — watch progress
8. `nemo customization jobs results list --job-id JOB` — find result fileset
9. `nemo files download RESULT_FILESET -o ./output/` — download the model
