---
title: "Creates a Loops run"
method: POST
path: "/v1/loops/runs"
---

# Creates a Loops run

`POST /v1/loops/runs`

Creates a Loops run with an associated sampler in the given session.

## Request body

- CreateLoopsRunRequestV1
  - `session_id` string, required — ID of the Loops session this run belongs to.
  - `base_model` string, required — Base model ID (e.g. 'Qwen/Qwen3-8B').
  - `name` string, nullable — Optional display name for the run. Defaults to the base model name when omitted.
  - `max_seq_len` integer, nullable — Maximum prompt length (in tokens) the run must handle. Set this to the longest training example you plan to send. Defaults to the maximum supported by the model configuration.
  - `lora_rank` integer — LoRA rank.
  - `seed` integer, nullable — Random seed for reproducibility.
  - `scale_down_delay_seconds` integer — Seconds of inactivity before the run scales to zero. Must be between 1 and 3600 (1 hour). Defaults to 3600.
  - `replicas` integer — Number of data-parallel trainer replicas. Each replica is one full copy of the model's preset node group, so the trainer deployment runs (preset node_count * replicas) nodes (e.g. replicas=4 on a 4-node preset → 16 nodes, 4 DP workers). Must be a positive integer. Defaults to 1.
  - `path` string, nullable — Optional bt:// URI of an existing checkpoint to load weights from on startup. Form: bt://loops:<run_id>/weights/<checkpoint_name>.
  - `reuse_from_session_id` string, nullable — Optional Loops session ID whose trainer deployment should be reused for this run, sharing the infrastructure across sessions instead of provisioning fresh. The named session must belong to the same team. Reuse is best-effort: if the prior deployment is stopped, failed, its sampler is unhealthy, or this run requests replicas != 1, a new deployment is provisioned instead.

## Response `200`

- CreateLoopsRunResponseV1
  - `run` LoopsRunV1, required
    - `id` string, required — The run ID.
    - `session_id` string, required — The session ID this run belongs to.
    - `deployment_id` string, required — The ID of the Loops deployment the run executes on.
    - `name` string, required — The run's display name.
    - `base_model` string, required — The HuggingFace base model the run is fine-tuning.
    - `base_url` string, required — The run's base URL.
    - `created_at` string, date-time, required — Time the run was created in ISO 8601 format
    - `sampler` LoopsSamplerV1
      - `id` string, required
      - `base_url` string, required
      - `base_model` string, required — The HuggingFace base model the sampler is serving.
      - `created_at` string, date-time, required — Time the sampler was created in ISO 8601 format
      - `model_id` string, required — Hashid of the underlying Baseten model.
      - `deployment_id` string, required — Hashid of the specific model deployment (version).
      - `status` LoopsSamplerStatusV1, required — The current status of a Loops sampler.
        - `name` 'BUILDING' | 'DEPLOYING' | 'DEPLOY_FAILED' | 'LOADING_MODEL' | 'ACTIVE' | 'UNHEALTHY' | 'BUILD_FAILED' | 'BUILD_STOPPED' | 'DEACTIVATING' | 'INACTIVE' | 'FAILED' | 'UPDATING' | 'SCALED_TO_ZERO' | 'WAKING_UP', required — The status of a deployment.

---

[API](https://skmtc.net/baseten/apis/baseten-inference-api.md) · [All operations](https://skmtc.net/baseten/apis/baseten-inference-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/baseten/baseten-inference-api/versions/a55a2f64c3c5/schema)
