---
title: "Push Training Job To Huggingface"
method: POST
path: "/felix/training-jobs/{job_id}/push-to-hub"
tags: ["felix"]
---

# Push Training Job To Huggingface

`POST /felix/training-jobs/{job_id}/push-to-hub`

Push a completed training job's model to HuggingFace Hub.

Args:
    job_id: Training job UUID.
    request: Target repo, token, and commit metadata.
    auth: Authenticated staff caller.

Returns:
    The hub push outcome.

Raises:
    HTTPException: 400/403/404/409/500 for validation, permission,
        lookup, conflict, and upload failures.

## Path parameters

- `job_id` string, required

## Request body

- HuggingFacePushModelRequest — Request to push a trained model to HuggingFace Hub
  - `repo_id` string, required — HuggingFace repo ID (e.g., 'username/model-name')
  - `hf_token` string, required — HuggingFace API token with write permissions
  - `private` boolean — Whether repo should be private
  - `commit_message` string, nullable — Optional commit message for the push

## Response `200`

Successful Response

- PushModelToHubResponse — Response model for pushing model to HuggingFace Hub
  - `success` boolean, required
  - `url` string, required
  - `repo_id` string, required
  - `job_id` string, required
  - `message` string, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-24** `1cffaad2a921` — 1 warning, 1 info
  - removed the optional property `detail` from the response with the `422` status
  - added the required property `error` to the response with the `422` status

[Change history](https://skmtc.dev/pioneer/apis/brain-api/changes/felix/training-jobs/:job_id/push-to-hub/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) · [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/1cffaad2a921?raw)
