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

# Optimize Fleet RLM from the workspace

> Launch Fleet RLM optimization runs from the browser workspace, upload datasets, check holdout gates, and promote or roll back artifacts.

The **Optimization** page in the browser workspace runs Fleet's offline optimizer for you. You pick a target and a dataset, watch the run, compare the candidate with the baseline on a holdout split, and promote the artifact to live traffic. Promotion and rollback apply to every API worker without a restart.

The page runs the same optimizer as `python -m fleet_rlm.optimize`. See [Commands](https://docs.qredence.ai/fleet-rlm/reference/cli.md#optimize) to run it from a terminal instead.

## Prerequisites

* A running Fleet RLM 0.15.0 backend and browser workspace. See [Quickstart](https://docs.qredence.ai/fleet-rlm/quickstart.md).
* An isolated Neon branch for optimization runs. Configure at least one of these:
  * `FLEET_NEON_API_KEY` and `FLEET_NEON_PROJECT_ID`, so Fleet creates an ephemeral branch for each run. Set `FLEET_NEON_PARENT_BRANCH_ID` to branch from a branch other than the project default.
  * `FLEET_OPTIMIZATION_DATABASE_URL`, the URL of a Neon branch you created for optimization.
  * Neither, if you paste a branch URL each time you start a run.
* Optional: `FLEET_MLFLOW_TRACKING_URI`, to log each run to MLflow. See [Observability](https://docs.qredence.ai/fleet-rlm/guides/observability.md).

See the [configuration reference](https://docs.qredence.ai/fleet-rlm/reference/configuration.md) for every variable.

## Targets

| Target | Name in the workspace | What it changes |
| - | - | - |
| `skills` | **Skill Selector** | ReAnchor calibrates the thresholds that pick which Skills load for each Turn. |
| `memory` | **Memory Gate** | ReAnchor calibrates whether to save a memory, and its action and scope. |
| `rlm` | **Root RLM** | `dspy.GEPA` evolves the instructions of the Turn program. |

The target cards at the top of the page show what each target uses now: **Promoted artifact**, **Env artifact** (a path in `FLEET_SKILL_SELECTOR_PATH`, `FLEET_MEMORY_GATE_PATH`, or `FLEET_OPTIMIZED_PROGRAM_PATH`), or **Default baseline**. Each card also shows the holdout score of the latest scored run.

The launch dialog also offers **Skill revision evaluation**. It checks a generated Skill against matching and swapped chart data with a model you choose. It produces a report only, and you can't promote it.

## Add a dataset

Each target has a built-in dataset. To use your own, open the **Datasets** tab and upload a JSONL file:

1. Choose the **Target** the dataset is for.
2. Choose **Upload a local file…** and select a UTF-8 `.jsonl` file.
3. Optionally, enter a **Display name**. Names must be unique.
4. Choose a **Storage backend**: **Neon backend (Object Storage + Postgres)**, or a Daytona Volume. The Daytona Volume option needs a Daytona API key (`FLEET_DAYTONA_API_KEY` or `DAYTONA_API_SERVICE_KEY`) and `FLEET_DAYTONA_DATASET_VOLUME`, which defaults to `fleet-eval-datasets`.
5. Select **Upload dataset**.

Fleet validates the file before it stores it:

* The file is at most 10 MiB and 2,000 rows.
* `rlm` datasets need at least 3 rows. `skills` and `memory` datasets need at least 2.
* Every row follows the row rules for its target. See [Datasets](https://docs.qredence.ai/fleet-rlm/reference/cli.md#datasets).
* Either every row sets `split` or none does. Rows that share a `lineage` must stay in one split.
* Fleet rejects a file that appears to contain credentials, such as API keys, bearer tokens, or Postgres URLs, with `Dataset appears to contain raw credentials or API keys; remove secrets before uploading`.

A failed check returns `422` with the line number and the reason, for example `Line 4: RLM rows require a nonempty 'task'`. A file over 10 MiB returns `413` with `Dataset exceeds 10 MiB limit`.

Select a dataset and choose **Preview** to see its rows, or **Configure run** to start a run with it. You can delete custom datasets, but not built-in ones or a dataset an active run is using.

## Start a run

Select **New Run** at the top of the page, or **Run** on a target card, to open the **New Optimization Run** dialog.

1. Choose the **Target** and the **Dataset**. For **Root RLM**, the dataset can also be your past completed Neon runs. That option uses unverified answers, so a labeled dataset gives more reliable results.
2. Choose the **Neon database isolation** mode:

   | Mode | Uses |
   | - | - |
   | **Auto ephemeral Neon branch** | A new Neon branch for this run. Fleet deletes it after the run, and Neon expires it after 48 hours at the latest. |
   | **Configured optimization branch** | The branch in `FLEET_OPTIMIZATION_DATABASE_URL`. |
   | **Custom Neon branch URL** | A branch URL you paste for this run. |
   | **Primary DB (read-only JSONL only)** | Your serving database, for runs on a JSONL dataset only. You must confirm the choice. |

   Fleet refuses a configured or custom URL that points at the serving database, for example with `Custom database URL matches the primary serving database; pass an isolated Neon branch URL`.
3. Optionally, choose models for each role, such as **Root LM (agent being optimized)**, **Reflection LM (GEPA prompt editor)**, **Judge LM (semantic grader)**, and **Decision model**. Pick from the providers you registered. Unset roles use your workspace models. ChatGPT plan models work in interactive chat only.
4. Adjust the run options if you need to, such as the **Random seed**, **Train ratio override**, **GEPA max metric calls**, and **Holdout repeats**. They match the [optimizer flags](https://docs.qredence.ai/fleet-rlm/reference/cli.md#flags).
5. Select **Start optimization**.

Each target runs one job at a time. Starting a second run for a target that already has an active one returns `409` with `Target '<target>' already has an active optimization job`.

## Monitor and cancel a run

A banner shows the active run, its stage, the baseline and candidate scores, and the latest optimizer output. A run moves through `queued` and `running` to `completed`, `failed`, or `cancelled`.

To stop a run, select **Cancel run** in the banner. Fleet stops the optimizer process and changes no live artifact.

Fleet marks a run `failed` with `Optimization job timed out or worker restarted` when its worker stops reporting for `FLEET_OPTIMIZATION_HEARTBEAT_STALE_SECONDS` (default `300`).

The **Runs** tab lists past runs, with filters by target and status. Select a run to inspect it. When MLflow is configured, each run links to its MLflow run in the `<FLEET_MLFLOW_EXPERIMENT>-optimization` experiment.

## Review the holdout gate

Fleet scores the baseline and the candidate on the holdout split, then checks a promotion gate. The candidate qualifies only when every check passes.

| Target | Checks |
| - | - |
| Root RLM | Instructions changed from baseline. Holdout score improved over baseline. Correctness did not regress. Zero blocking case failures. Zero paired case regressions. |
| Skill Selector | Parameters changed from baseline. Holdout score improved over baseline. Extra Skill activations within allowance. No new explicit exclusion violations. |
| Memory Gate | Parameters changed from baseline. Holdout score improved over baseline. False-positive rate did not regress. |

A row with `"blocking": true` in an `rlm` dataset is a blocking case: if the candidate fails it, the gate fails.

A run that fails the gate saves no artifact, unless you started it with **Save artifact even if holdout gate does not improve (--force)**.

## Promote an artifact

Select **Promote** on a completed run, review the comparison with the currently active artifact, and select **Promote live**. Fleet validates the artifact's SHA-256 and contents, then activates it on every API worker from the next Turn.

* Promoting a run that saved an artifact but failed the gate requires you to confirm **I understand and confirm promoting a non-qualifying candidate**.
* A Skill Selector promotion always pins the decision model the run calibrated against. For a Memory Gate, you can turn the pin off. The pin applies only to that target.
* You can't promote a run with no saved artifact, a `dspy.Flex` run, or a Skill revision evaluation.

A promoted artifact overrides the matching `FLEET_*_PATH` variable. If Fleet can't load a promoted artifact, it falls back to the environment or default artifact and keeps serving.

## Roll back a target

Select **Rollback** on a target card, then choose what to restore:

* **Previous promotion** reactivates the artifact promoted before the current one.
* **Env / Default baseline** clears the promoted override, so the target uses its `FLEET_*_PATH` artifact or the default baseline again.

Rollback applies immediately, without restarting the API server.

## Related pages

* [Commands](https://docs.qredence.ai/fleet-rlm/reference/cli.md#optimize): run the optimizer from a terminal.
* [HTTP API reference](https://docs.qredence.ai/fleet-rlm/reference/http-api.md): the `/api/optimizations` routes behind this page.
* [Configure models](https://docs.qredence.ai/fleet-rlm/guides/models-and-providers.md): pin the decision model for calibrated artifacts.


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