---
title: "Deploy a model to a project"
method: POST
path: "/projects/{project_id}/deployments"
tags: ["deployments"]
---

# Deploy a model to a project

`POST /projects/{project_id}/deployments`

Activate a model as the project's active model and record the swap.

Exactly one of ``training_job_id`` (a fine-tuned checkpoint) or
``base_model`` (a stock HuggingFace base model) must be supplied in the
request body; this is enforced by the ``DeploymentCreate`` schema.

Args:
    project_id: ID of the project to update.
    request: Deployment target (training job or base model) and optional
        reason.
    auth: Authenticated user.

Returns:
    DeploymentResponse with the new history record.

Raises:
    400: If the supplied base model is not in the catalog.
    403: If the user does not have access to the project.
    404: If the project or training job is not found.

## Path parameters

- `project_id` string, uuid, required

## Request body

- DeploymentCreate — Request body for deploying a model to a project. Exactly one of ``training_job_id`` or ``base_model`` must be supplied. Attributes: training_job_id: UUID of a completed training job to activate. base_model: HuggingFace base model ID to activate (e.g. ``fastino/gliner2-base-v1``). Used when rolling back from a fine-tuned checkpoint to the original base model. reason: Optional human-readable reason for the swap. project_id: Project ID -- used only by the deprecated /felix/deployments endpoint. For new clients, supply project_id in the URL path instead.
  - `training_job_id` string, nullable — UUID of the training job to deploy
  - `base_model` string, nullable — HuggingFace base model ID to deploy (e.g. 'fastino/gliner2-base-v1'). Mutually exclusive with training_job_id.
  - `reason` string, nullable — Optional reason for this deployment
  - `project_id` string, nullable — [Deprecated] Project ID. Provide in the URL path (/projects/{project_id}/deployments) instead.

## Response `200`

Successful Response

- DeploymentResponse — A single deployment history record. A deployment targets exactly one of ``training_job_id`` or ``base_model``: the trained adapter that was activated, or the base catalog model that was activated when no adapter is in use. Attributes: id: Unique deployment record ID. project_id: The project whose active model was changed. training_job_id: Training job that was deployed (training-job shape). base_model: HuggingFace base model ID that was deployed (base-model shape). deployed_by: User ID who triggered the deployment. reason: Optional reason for the swap. deployed_at: When the swap occurred.
  - `id` string, required
  - `project_id` string, required
  - `training_job_id` string, nullable
  - `base_model` string, nullable
  - `deployed_by` string, required
  - `reason` string, nullable, required
  - `deployed_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

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