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

# Create or replace task Automation

> Starts a run from task traffic or an existing dataset. Replacement is rejected after an active run passes collection.



## OpenAPI

````yaml /openapi/model-distillation/management.openapi.yaml put /tasks/{alias}/automation
openapi: 3.1.0
info:
  title: Model Distillation Management API
  version: 1.0.0
  description: |
    Manage providers, tasks, routing versions, datasets, relabeling, fine-tunes,
    evaluations, analytics, and closed-loop training Automation. This is the
    same API used by Model Distillation Studio.
servers:
  - url: https://distillation.training.wandb.ai/v1
    description: Production
security:
  - WandbApiKey: []
tags:
  - name: Providers
    description: OpenAI-compatible endpoints, credentials, model catalogs, and pricing.
  - name: Tasks
    description: Stable task identity and task-level information.
  - name: Routing
    description: Versioned model targets, weights, and request parameters.
  - name: Datasets
    description: >-
      Reproducible data snapshots, entries, relabeling, and reusable model
      outputs.
  - name: Fine-tunes
    description: Supervised fine-tuning jobs and hosted model artifacts.
  - name: Evaluations
    description: Head-to-head, exact-match, and categorization evaluations.
  - name: Automation
    description: Closed-loop dataset, sweep, evaluation, and promotion runs.
  - name: Analytics
    description: Task traffic, token, error, and estimated-cost read models.
  - name: Studio preferences
    description: Per-task display preferences used by Studio.
paths:
  /tasks/{alias}/automation:
    parameters:
      - $ref: '#/components/parameters/WandbEntity'
      - $ref: '#/components/parameters/TaskAlias'
    put:
      tags:
        - Automation
      summary: Create or replace task Automation
      description: >-
        Starts a run from task traffic or an existing dataset. Replacement is
        rejected after an active run passes collection.
      operationId: putAutomation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                teacher:
                  type: string
                  pattern: ^[a-z0-9][a-z0-9_-]{0,63}\/\S+$
                dataset:
                  anyOf:
                    - type: object
                      properties:
                        source:
                          type: string
                          const: task
                        task_version:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 2147483647
                        after:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                        before:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                        min_train_examples:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        sampling:
                          type: object
                          properties:
                            strategy:
                              type: string
                              const: random
                            limit:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 100000
                          required:
                            - strategy
                            - limit
                          additionalProperties: false
                        split:
                          type: object
                          properties:
                            val:
                              type: number
                              exclusiveMinimum: 0
                              exclusiveMaximum: 1
                            by:
                              type: string
                              const: trace
                          required:
                            - val
                            - by
                          additionalProperties: false
                        relabel:
                          anyOf:
                            - type: object
                              properties:
                                model_ref:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,63}\/\S+$
                                use_original_output:
                                  default: false
                                  type: boolean
                                  const: false
                              required:
                                - model_ref
                              additionalProperties: false
                            - type: object
                              properties:
                                model_ref:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,63}\/\S+$
                                use_original_output:
                                  type: boolean
                                  const: true
                                instructions:
                                  default: >-
                                    Treat the original output as correct unless
                                    it contains a clear, material error. If
                                    needed, make the smallest correction while
                                    preserving its intent, style, structure, and
                                    tool-use decision.
                                  type: string
                                  minLength: 1
                                  maxLength: 20000
                                reference_conversation_count:
                                  default: 10
                                  type: integer
                                  minimum: 0
                                  maximum: 50
                              required:
                                - model_ref
                                - use_original_output
                              additionalProperties: false
                        publish_to_weave:
                          type: boolean
                        publish_relabel_to_weave:
                          type: boolean
                      required:
                        - source
                        - after
                        - before
                      additionalProperties: false
                    - type: object
                      properties:
                        source:
                          type: string
                          const: existing
                        dataset_id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        relabel_run_id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        relabel:
                          anyOf:
                            - type: object
                              properties:
                                model_ref:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,63}\/\S+$
                                use_original_output:
                                  default: false
                                  type: boolean
                                  const: false
                              required:
                                - model_ref
                              additionalProperties: false
                            - type: object
                              properties:
                                model_ref:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,63}\/\S+$
                                use_original_output:
                                  type: boolean
                                  const: true
                                instructions:
                                  default: >-
                                    Treat the original output as correct unless
                                    it contains a clear, material error. If
                                    needed, make the smallest correction while
                                    preserving its intent, style, structure, and
                                    tool-use decision.
                                  type: string
                                  minLength: 1
                                  maxLength: 20000
                                reference_conversation_count:
                                  default: 10
                                  type: integer
                                  minimum: 0
                                  maximum: 50
                              required:
                                - model_ref
                                - use_original_output
                              additionalProperties: false
                        publish_to_weave:
                          type: boolean
                        publish_relabel_to_weave:
                          type: boolean
                      required:
                        - source
                        - dataset_id
                      additionalProperties: false
                models:
                  minItems: 1
                  maxItems: 32
                  type: array
                  items:
                    type: object
                    properties:
                      model_name:
                        type: string
                      base_model:
                        type: string
                        minLength: 1
                      model_config:
                        type: object
                        properties:
                          max_examples:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          config:
                            type: object
                            properties:
                              batch_size:
                                anyOf:
                                  - type: string
                                    const: auto
                                  - type: integer
                                    exclusiveMinimum: 0
                                    maximum: 9007199254740991
                              learning_rate:
                                anyOf:
                                  - type: number
                                    exclusiveMinimum: 0
                                  - type: array
                                    minItems: 1
                                    items:
                                      type: number
                                      minimum: 0
                              assistant_turns:
                                type: string
                                enum:
                                  - all
                                  - last
                              metric_logging:
                                type: object
                                propertyNames:
                                  type: string
                                additionalProperties: {}
                            additionalProperties: false
                          experimental_config:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                        additionalProperties: false
                    required:
                      - base_model
                    additionalProperties: false
                eval:
                  type: object
                  properties:
                    spec:
                      type: object
                      properties:
                        type:
                          type: string
                          const: h2h_judge
                        judge_model_ref:
                          type: string
                          pattern: ^[a-z0-9][a-z0-9_-]{0,63}\/\S+$
                        judge_prompt:
                          type: string
                          minLength: 1
                        reference_conversation_count:
                          type: integer
                          minimum: 0
                          maximum: 50
                      required:
                        - type
                      additionalProperties: false
                    sample_size:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                    export_eval:
                      type: boolean
                  additionalProperties: false
                rollout:
                  type: object
                  properties:
                    task_version:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 2147483647
                    min_win_rate:
                      type: number
                      minimum: 0
                      maximum: 1
                    winner_traffic:
                      type: number
                      exclusiveMinimum: 0
                      maximum: 1
                  additionalProperties: false
              required:
                - dataset
                - models
              additionalProperties: false
      responses:
        '200':
          description: Collecting configuration was replaced and a new run started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Automation'
        '201':
          description: Automation was created and its first run started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Automation'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    WandbEntity:
      name: Wandb-Entity
      in: header
      required: false
      description: >-
        Accessible personal or team entity. Omit to use the API key's default
        entity.
      schema:
        type: string
    TaskAlias:
      name: alias
      in: path
      required: true
      schema:
        type: string
        pattern: ^[a-z0-9-]{1,64}$
  schemas:
    Automation:
      type: object
      additionalProperties: true
      required:
        - config
        - revision
        - started_by
        - created_at
        - updated_at
      properties:
        config:
          $ref: '#/components/schemas/JsonObject'
        revision:
          type: integer
        started_by:
          type: string
        run:
          oneOf:
            - type: object
              additionalProperties: true
              properties:
                id:
                  type: string
                  format: uuid
                status:
                  type: string
                  enum:
                    - collecting
                    - building_dataset
                    - training
                    - evaluating
                    - promoting
                    - promoted
                    - rejected
                    - failed
                    - cancelled
                dataset_id:
                  type:
                    - string
                    - 'null'
                  format: uuid
                eval_id:
                  type:
                    - string
                    - 'null'
                  format: uuid
                error:
                  type:
                    - string
                    - 'null'
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    JsonObject:
      type: object
      additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
      example:
        error:
          message: Task 'missing' not found in entity 'your-team'
          type: not_found
  responses:
    Error:
      description: Request failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    WandbApiKey:
      type: http
      scheme: bearer
      bearerFormat: W&B API key
      description: A personal or service-account W&B API key.

````