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

# Manage the deployment lifecycle

> Promote, deactivate, activate, and delete deployments from the console, CLI, or Management API.

Manage your deployment through its lifecycle. After you push a model,
promote its deployment to serve an environment, deactivate it to stop
compute spend, activate it to bring it back, and delete it when you no
longer need it. For what each deployment state means, see
[Deployments](/deployment/deployments).

## Promote to an environment

Promote a validated deployment to production (or a custom environment) to
route that environment's traffic to it. What happens to the previously
promoted deployment is controlled by the target environment's promotion
cleanup strategy; see [Environments](/deployment/environments) for the
concepts and [Rolling deployments](/deployment/rolling-deployments) for
incremental traffic shifting.

<Tabs>
  <Tab title="UI">
    **To promote a deployment**:

    1. Sign in to your workspace at
       [app.baseten.co](https://app.baseten.co) and choose **Dedicated Inference** in the
       sidebar.
    2. Select your model.
    3. Select the deployment under **Deployments**.
    4. Choose **Promote to...**.
    5. In the **Promote deployment** dialog, choose the target environment.
    6. Choose **Promote** to confirm.
  </Tab>

  <Tab title="Baseten CLI">
    **To promote a deployment**:

    Promote to production (the CLI's default target):

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model deployment promote --model-id <model-id> --deployment-id <deployment-id>
      ```

      ```txt Output theme={"system"}
      Promoted deployment <deployment-id> to environment production
      ```
    </CodeGroup>

    Promote to another environment with `--environment <name>`:

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model deployment promote --model-id <model-id> --deployment-id <deployment-id> --environment staging
      ```

      ```txt Output theme={"system"}
      Promoted deployment <deployment-id> to environment staging
      ```
    </CodeGroup>
  </Tab>

  <Tab title="REST API">
    **To promote a deployment**:

    Promote to production:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl -X POST "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/promote" \
        -H "Authorization: Bearer $BASETEN_API_KEY"
      ```

      ```json Response theme={"system"}
      {
        "id": "{deployment_id}",
        "name": "deployment-2",
        "model_id": "{model_id}",
        "is_production": true,
        "is_development": false,
        "status": "ACTIVE",
        "active_replica_count": 1,
        "environment": "production",
        "instance_type_name": "1x2 - 1 vCPU, 2 GiB RAM",
        "autoscaling_settings": {
          "min_replica": 0,
          "max_replica": 1,
          "autoscaling_window": 60,
          "scale_down_delay": 900,
          "concurrency_target": 1,
          "target_utilization_percentage": 70
        },
        "created_at": "2026-07-07T18:29:11.147Z",
        "labels": {}
      }
      ```
    </CodeGroup>

    Promote to another environment by POSTing the deployment ID to that
    environment's own promote endpoint:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl -X POST "https://api.baseten.co/v1/models/{model_id}/environments/staging/promote" \
        -H "Authorization: Bearer $BASETEN_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{"deployment_id": "{deployment_id}"}'
      ```

      ```json Response theme={"system"}
      {
        "id": "{deployment_id}",
        "name": "deployment-2",
        "model_id": "{model_id}",
        "is_production": false,
        "is_development": false,
        "status": "ACTIVE",
        "active_replica_count": 1,
        "environment": "staging",
        "instance_type_name": "1x2 - 1 vCPU, 2 GiB RAM",
        "autoscaling_settings": {
          "min_replica": 0,
          "max_replica": 1,
          "autoscaling_window": 60,
          "scale_down_delay": 900,
          "concurrency_target": 1,
          "target_utilization_percentage": 70
        },
        "created_at": "2026-07-07T18:29:11.147Z",
        "labels": {}
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="CI/CD">
    **To promote from CI/CD**:

    Each push to `main` deploys the Truss and promotes the new deployment to
    production:

    ```yaml .github/workflows/deploy.yml theme={"system"}
    name: Deploy to production

    on:
      push:
        branches: [main]

    jobs:
      deploy:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4

          - uses: basetenlabs/action-truss-push@v0.1
            with:
              truss-directory: "./my-model"
              baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
              environment: "production"
              cleanup: false
    ```

    For more information, see [CI/CD](/deployment/ci-cd) and the
    [Truss Push GitHub Action reference](/reference/ci/github-action).
  </Tab>
</Tabs>

Promotion routes the environment's traffic to the new deployment. Verify
it:

<Tabs>
  <Tab title="UI">
    **To verify the promotion**:

    1. Sign in to your workspace at
       [app.baseten.co](https://app.baseten.co) and choose **Dedicated Inference** in the
       sidebar.
    2. Select your model.
    3. On the model's overview, confirm the environment card's
       **Current deployment** shows your deployment.
  </Tab>

  <Tab title="Baseten CLI">
    **To verify the promotion**:

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model deployment describe --model-id <model-id> --deployment-id <deployment-id> --jq '.environment'
      ```

      ```json Output theme={"system"}
      "production"
      ```
    </CodeGroup>
  </Tab>

  <Tab title="REST API">
    **To verify the promotion**:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}" \
        -H "Authorization: Bearer $BASETEN_API_KEY"
      ```

      ```json Response theme={"system"}
      {
        "id": "def456",
        "environment": "production",
        "is_production": true,
        "status": "ACTIVE",
        ...
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

For more information, see the
[promote deployment](/reference/management-api/deployments/promote/promotes-a-deployment-to-production)
and [promote to environment](/reference/management-api/deployments/promote/promotes-a-deployment-to-an-environment)
endpoints.

## Deactivate a deployment

Deactivate a deployment to stop compute spend without deleting it. The
deployment keeps its configuration and stays visible in the dashboard, but
releases its replicas. Requests to a deactivated deployment fail with a
`400` error; see
[troubleshooting](/troubleshooting/deployments#issue-requests-fail-with-model-version-is-deactivated)
for the error and recovery.

<Tabs>
  <Tab title="UI">
    **To deactivate a deployment**:

    1. Sign in to your workspace at
       [app.baseten.co](https://app.baseten.co) and choose **Dedicated Inference** in the
       sidebar.
    2. Select your model.
    3. Select the deployment under **Deployments**.
    4. Choose **Deactivate deployment**.
    5. Choose **Yes, deactivate** to confirm.
  </Tab>

  <Tab title="Baseten CLI">
    **To deactivate a deployment**:

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model deployment deactivate --model-id <model-id> --deployment-id <deployment-id>
      ```

      ```txt Output theme={"system"}
      Deactivated deployment <deployment-id>
      ```
    </CodeGroup>

    The CLI prompts for confirmation; pass `--yes` to skip it (required when
    scripting).
  </Tab>

  <Tab title="REST API">
    **To deactivate a deployment**:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl -X POST "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/deactivate" \
        -H "Authorization: Bearer $BASETEN_API_KEY"
      ```

      ```json Response theme={"system"}
      {"success": true}
      ```
    </CodeGroup>
  </Tab>
</Tabs>

The deployment's `status` moves to `INACTIVE` within a few seconds.

If you want the deployment to keep serving but stop paying for idle replicas,
[scale to zero](/deployment/manage/scaling#scale-to-zero) instead.

## Activate a deployment

Activate an inactive deployment to bring it back. Activation redeploys the
model, so the deployment passes through `DEPLOYING` before reaching `ACTIVE`.

<Tabs>
  <Tab title="UI">
    **To activate a deployment**:

    1. Sign in to your workspace at
       [app.baseten.co](https://app.baseten.co) and choose **Dedicated Inference** in the
       sidebar.
    2. Select your model.
    3. Select the inactive deployment under **Deployments**.
    4. Choose **Activate deployment**.
  </Tab>

  <Tab title="Baseten CLI">
    **To activate a deployment**:

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model deployment activate --model-id <model-id> --deployment-id <deployment-id>
      ```

      ```txt Output theme={"system"}
      Activated deployment <deployment-id>
      ```
    </CodeGroup>
  </Tab>

  <Tab title="REST API">
    **To activate a deployment**:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl -X POST "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/activate" \
        -H "Authorization: Bearer $BASETEN_API_KEY"
      ```

      ```json Response theme={"system"}
      {"success": true}
      ```
    </CodeGroup>
  </Tab>
</Tabs>

For more information, see
[`activate`](/reference/cli/baseten/model-deployment#activate)
and the [activate endpoint](/reference/management-api/deployments/activate/activates-a-deployment).

## Delete a deployment

Delete deployments to clean up finished experiments and stale versions.

<Warning>
  Deletion is irreversible, and requests to a deleted deployment return `404`.
  [Deactivate](#deactivate-a-deployment) instead if you might need the
  deployment again.
</Warning>

A deployment that's associated with an environment, or is the only deployment
of a model, can't be deleted;
[push a new deployment](/reference/cli/truss/push) and promote it first, or
delete the whole model.

<Tabs>
  <Tab title="UI">
    **To delete a deployment**:

    1. Sign in to your workspace at
       [app.baseten.co](https://app.baseten.co) and choose **Dedicated Inference** in the
       sidebar.
    2. Select your model.
    3. Select the deployment under **Deployments**.
    4. Choose **Delete deployment** and confirm.

    The button is disabled while the deployment serves an environment or is
    the model's only deployment.
  </Tab>

  <Tab title="Baseten CLI">
    **To delete a deployment**:

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model deployment delete --model-id <model-id> --deployment-id <deployment-id>
      ```

      ```txt Output theme={"system"}
      Deleted deployment <deployment-id>
      ```
    </CodeGroup>
  </Tab>

  <Tab title="REST API">
    **To delete a deployment**:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl -X DELETE "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}" \
        -H "Authorization: Bearer $BASETEN_API_KEY"
      ```

      ```json Response theme={"system"}
      {"id": "{deployment_id}", "deleted": true, "model_id": "{model_id}"}
      ```
    </CodeGroup>
  </Tab>
</Tabs>

You can also delete the model itself, which removes all of its deployments:

<Tabs>
  <Tab title="UI">
    **To delete a model**:

    1. Sign in to your workspace at
       [app.baseten.co](https://app.baseten.co) and choose **Dedicated Inference** in the
       sidebar.
    2. Select your model.
    3. On the model's overview, choose **Actions**, then **Delete model**.
    4. Type the model's name to confirm, then choose **Delete**.
  </Tab>

  <Tab title="Baseten CLI">
    **To delete a model**:

    <CodeGroup>
      ```bash Command theme={"system"}
      baseten model delete --model-id <model-id>
      ```

      ```txt Output theme={"system"}
      Deleted model <model-name> (<model-id>)
      ```
    </CodeGroup>
  </Tab>

  <Tab title="REST API">
    **To delete a model**:

    <CodeGroup>
      ```bash Request theme={"system"}
      curl -X DELETE "https://api.baseten.co/v1/models/{model_id}" \
        -H "Authorization: Bearer $BASETEN_API_KEY"
      ```

      ```json Response theme={"system"}
      {"id": "{model_id}", "deleted": true}
      ```
    </CodeGroup>
  </Tab>
</Tabs>

For more information, see the
[delete deployment](/reference/management-api/deployments/deletes-a-models-deployment-by-id)
and [delete model](/reference/management-api/models/deletes-a-model-by-id)
endpoints, and the CLI's [`delete`](/reference/cli/baseten/model-deployment#delete)
reference.

## Next steps

With lifecycle transitions scripted, the same commands slot into CI jobs,
cron cleanups, and incident runbooks.

* [Scale a deployment](/deployment/manage/scaling) to change replica behavior
  without a lifecycle change.
* [Pull logs and metrics](/deployment/manage/logs-and-metrics) to verify a
  deployment's health after a transition.
* [CI/CD](/deployment/ci-cd) to run deploys and promotions from GitHub
  Actions.
