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

# Start training a model

> Start training an ACT or gr00t model on the specified dataset. This will upload a trained model to the Hugging Face Hub using the main branch of the specified dataset.



## OpenAPI

````yaml post /training/start
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /training/start:
    post:
      tags:
        - training
      summary: Start training a model
      description: >-
        Start training an ACT or gr00t model on the specified dataset. This will
        upload a trained model to the Hugging Face Hub using the main branch of
        the specified dataset.
      operationId: start_training_training_start_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartTrainingResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    TrainingRequest:
      description: >-
        Pydantic model for training request validation.

        This version consolidates all model name and parameter logic into a
        single

        validator to prevent redundant operations and fix the duplicate suffix
        bug.
      properties:
        dataset_name:
          description: Dataset repository ID on Hugging Face, should be a public dataset
          title: Dataset Name
          type: string
        model_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Name of the trained model to upload to Hugging Face, should be in
            the format phospho-app/<model_name> or <model_name>
          title: Model Name
        model_type:
          description: Type of model to train, supports 'ACT', 'gr00t', and 'pi0'
          enum:
            - ACT
            - ACT_BBOX
            - gr00t
            - pi0
            - custom
          title: Model Type
          type: string
        private_mode:
          default: false
          description: Whether to use private training (PRO users only)
          title: Private Mode
          type: boolean
        training_params:
          anyOf:
            - $ref: '#/components/schemas/TrainingParamsAct'
            - $ref: '#/components/schemas/TrainingParamsActWithBbox'
            - $ref: '#/components/schemas/TrainingParamsGr00T'
            - $ref: '#/components/schemas/TrainingParamsPi0'
            - type: 'null'
          description: Training parameters for the model.
          title: Training Params
        user_hf_token:
          anyOf:
            - type: string
            - type: 'null'
          description: User's personal HF token for private training
          title: User Hf Token
        wandb_api_key:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            WandB API key for tracking training, you can find it at
            https://wandb.ai/authorize
          title: Wandb Api Key
      required:
        - model_type
        - dataset_name
      title: TrainingRequest
      type: object
    StartTrainingResponse:
      additionalProperties: true
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        model_url:
          anyOf:
            - type: string
            - type: 'null'
          description: URL to the Hugging Face model card.
          title: Model Url
        status:
          default: ok
          enum:
            - ok
            - error
          title: Status
          type: string
        training_id:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            ID of the training to start. This is the ID returned by the training
            request.
          title: Training Id
      required:
        - training_id
      title: StartTrainingResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    TrainingParamsAct:
      additionalProperties: true
      description: >-
        Training parameters are left to None by default and are set depending on
        the dataset in the training pipeline.
      properties:
        batch_size:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 150
              type: integer
            - type: 'null'
          description: >-
            Batch size for training, we run this on an A10G. Leave it to None to
            auto-detect based on your dataset
          title: Batch Size
        save_freq:
          default: 5000
          description: Number of steps between saving the model.
          exclusiveMinimum: 0
          maximum: 1000000
          title: Save Freq
          type: integer
        steps:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 1000000
              type: integer
            - type: 'null'
          description: >-
            Number of training steps. Leave it to None to auto-detect based on
            your dataset
          title: Steps
      title: TrainingParamsAct
      type: object
    TrainingParamsActWithBbox:
      additionalProperties: true
      description: Training parameters for ACT with bounding box
      properties:
        batch_size:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 150
              type: integer
            - type: 'null'
          description: >-
            Batch size for training, we run this on an A10G. Leave it to None to
            auto-detect based on your dataset
          title: Batch Size
        image_key:
          default: main
          description: Key for the image to run detection on, e.g. 'main' or 'images.main'
          examples:
            - main
            - images.main
          minLength: 1
          title: Image Key
          type: string
        image_keys_to_keep:
          description: >-
            Optional list of image keys to keep. If none, all image keys will be
            dropped.
          items:
            type: string
          title: Image Keys To Keep
          type: array
        save_freq:
          default: 5000
          description: Number of steps between saving the model.
          exclusiveMinimum: 0
          maximum: 1000000
          title: Save Freq
          type: integer
        steps:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 1000000
              type: integer
            - type: 'null'
          description: >-
            Number of training steps. Leave it to None to auto-detect based on
            your dataset
          title: Steps
        target_detection_instruction:
          default: 'e.g.: green lego brick, red ball, blue plushy...'
          description: >-
            Instruction for the target object to detect, e.g. 'red/orange lego
            brick'
          examples:
            - red/orange lego brick
            - brown plushy
            - blue ball
          minLength: 4
          title: Target Detection Instruction
          type: string
      title: TrainingParamsActWithBbox
      type: object
    TrainingParamsGr00T:
      additionalProperties: true
      properties:
        batch_size:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 128
              type: integer
            - type: 'null'
          default: 64
          description: >-
            Batch size for training. Decrease it if you get an Out Of Memory
            (OOM) error
          title: Batch Size
        data_dir:
          default: data/
          description: The directory to save the dataset to
          title: Data Dir
          type: string
        learning_rate:
          default: 0.0001
          description: Learning rate for training.
          exclusiveMinimum: 0
          maximum: 1
          title: Learning Rate
          type: number
        num_epochs:
          default: 10
          description: Number of epochs to train for.
          exclusiveMinimum: 0
          maximum: 100
          title: Num Epochs
          type: integer
        output_dir:
          default: outputs/
          description: The directory to save the model to
          title: Output Dir
          type: string
        save_steps:
          default: 1000
          description: Number of steps between saving the model.
          exclusiveMinimum: 0
          maximum: 100000
          title: Save Steps
          type: integer
        validation_data_dir:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Optional directory to save the validation dataset to. If None,
            validation is not run.
          title: Validation Data Dir
        validation_dataset_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional dataset repository ID on Hugging Face to use for validation
          title: Validation Dataset Name
      title: TrainingParamsGr00T
      type: object
    TrainingParamsPi0:
      additionalProperties: false
      description: Training parameters for Pi0 model
      properties:
        batch_size:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 128
              type: integer
            - type: 'null'
          description: >-
            Batch size for training, leave it to None to auto-detect based on
            your dataset
          title: Batch Size
        data_dir:
          default: data/
          description: The directory to save the dataset to
          title: Data Dir
          type: string
        epochs:
          default: 10
          description: Number of epochs to train for, default is 10
          exclusiveMinimum: 0
          maximum: 50
          title: Epochs
          type: integer
        learning_rate:
          default: 0.0001
          description: Learning rate for training, default is 0.0001
          exclusiveMinimum: 0
          maximum: 1
          title: Learning Rate
          type: number
        output_dir:
          default: outputs/
          description: The directory to save the model to
          title: Output Dir
          type: string
        path_to_pi0_repo:
          default: .
          description: >-
            The path to the openpi repo. If not provided, will assume we are in
            the repo.
          title: Path To Pi0 Repo
          type: string
        train_test_split:
          default: 1
          description: >-
            Train test split ratio, default is 1.0 (no split), should be between
            0 and 1
          exclusiveMinimum: 0
          maximum: 1
          title: Train Test Split
          type: number
        validation_dataset_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional dataset repository ID on Hugging Face to use for validation
          title: Validation Dataset Name
      title: TrainingParamsPi0
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````