> ## 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.

# Deploy a checkpoint

> Turn a Loops sampler checkpoint into a dedicated inference deployment and call it.

A sampler checkpoint deploys to a Baseten inference deployment that serves the base model with your LoRA adapter loaded. Checkpoints outlive the run, so you can deploy one while the run is active or after it ends. The deployment bills for its GPU while it's live.

Deploying needs an `hf_access_token` in [workspace secrets](https://docs.baseten.co/organization/secrets.md) to download the base weights from Hugging Face. A run with `base_checkpoint_auth` deploys with those credentials. Only runs that start from Hugging Face weights can be deployed.

## Deploy from the CLI

**To deploy a checkpoint**:

Run [`baseten loops checkpoint deploy`](https://docs.baseten.co/reference/cli/baseten/loops) with the checkpoint's globally unique `id` (the `id` field from [listing checkpoints](https://docs.baseten.co/loops/quickstart.md#list-checkpoints)), by checkpoint *name* scoped to a run, or with the Truss CLI:

```bash By checkpoint ID theme={"system"}
baseten loops checkpoint deploy --checkpoint-id "<id>"
```

```bash By checkpoint name theme={"system"}
baseten loops checkpoint deploy --run-id "<run_id>" --checkpoint step-1
```

```bash Truss CLI theme={"system"}
uvx truss loops checkpoints deploy --checkpoint-ids "<id>"
```

Both Baseten CLI flags skip the checkpoint picker, but the deploy still prompts for a model name, GPU type, GPU count, and the Hugging Face secret name (default `hf_access_token`). A successful deploy prints the IDs you need to call the model:

```text Output theme={"system"}
Successfully created deployment: deployment-1
Model ID: wnpkzp03
Deployment ID: qrpg2r0
Deployment succeeded.
Set the model parameter on each request to the Loops checkpoint name (e.g. step-100).
```

The deployment downloads base weights and starts the inference server before it reaches `ACTIVE`.

Use the Baseten CLI for interactive checkpoint deployment. To inspect the generated Truss config before creating an inference deployment, pass `--dry-run`:

```bash theme={"system"}
baseten loops checkpoint deploy --checkpoint-id "<id>" --dry-run
```

The command still prompts for deployment settings, then prints the generated config without creating a deployment. Review the GPU and serving settings. Rerun without `--dry-run` when you're ready to deploy.

To customize the config, save the printed YAML as `config.yaml` in a Truss directory and edit it. Deploy with [`baseten model push`](https://docs.baseten.co/reference/cli/baseten/model#push), using the same CLI profile as the preview and the checkpoint's team:

```bash theme={"system"}
baseten --profile "<profile>" model push --dir "<directory>" --team "<checkpoint_team>"
```

The generated config doesn't store the team. Without `--team`, model push uses the organization's default team, which can differ from the checkpoint's team and cause deployment to fail. The Hugging Face secret must also be available in the checkpoint's team.

## Deploy from the REST API

**To deploy a checkpoint**:

Call [`POST /v1/loops/checkpoints/deploy`](https://docs.baseten.co/reference/loops-api/checkpoints/deploy-checkpoints). Replace `<id>` with the checkpoint's globally unique `id`, choose an instance type `id` from the [instance-type catalog](https://docs.baseten.co/reference/management-api/instance-types/gets-all-instance-types.md), and set the model name and Hugging Face secret:

```bash Request theme={"system"}
curl --request POST \
  --url "https://api.baseten.co/v1/loops/checkpoints/deploy" \
  --header "Authorization: Bearer $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "checkpoint_ids": ["<id>"],
    "model_name": "my-fine-tuned-model",
    "instance_type_id": "H100",
    "hf_secret_name": "hf_access_token"
  }'
```

The response returns the model and deployment IDs:

```json Response theme={"system"}
{
  "model_id": "<model_id>",
  "deployment_id": "<deployment_id>"
}
```

## Deploy from the dashboard

Every Loop has a page in the dashboard at `app.baseten.co/training/loop/<run_id>`, reachable from the Training tab. Its Checkpoints table lists each saved checkpoint with its `bt://` path, type, and size. Deploy one from that table; the flow matches [deploying job checkpoints](https://docs.baseten.co/training/getting-started.md#deploy-the-trained-model).

## Call the deployed model

Call the deployment's OpenAI-compatible chat completions route. The URL includes the deployment ID, and `model` is the checkpoint *name* (`checkpoint_id`), not its globally unique `id`:

```bash Request theme={"system"}
curl -X POST \
  "https://model-<model_id>.api.baseten.co/deployment/<deployment_id>/sync/v1/chat/completions" \
  -H "Authorization: Bearer $BASETEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "step-1",
    "messages": [{"role": "user", "content": "What is the capital of France?"}]
  }'
```

```json Output theme={"system"}
{
  "model": "step-1",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "The capital of France is **Paris**.\n\nLocated in northeastern France…"
      },
      "finish_reason": "length"
    }
  ]
}
```

For request options, streaming, and client libraries, see [calling your model](https://docs.baseten.co/inference/calling-your-model.md).

## Delete the deployment

Delete it with [`DELETE /v1/models/{model_id}`](https://docs.baseten.co/reference/management-api/models/deletes-a-model-by-id) when you're done:

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

```json Output theme={"system"}
{"id": "wnpkzp03", "deleted": true}
```

Deleting the deployment doesn't touch the checkpoint. You can redeploy it any time.

## Next steps

* **[Train on a chat dataset](https://docs.baseten.co/examples/sft-sdk-loop.md)**: Move from the quickstart's single example to a real training loop.
* **[Loops concepts](https://docs.baseten.co/loops/concepts.md)**: How checkpoints relate to sessions, trainers, and samplers.
