SageMaker / Client / create_job

create_job

SageMaker.Client.create_job(**kwargs)

Creates a model customization job in Amazon SageMaker. A job runs a workload based on the job category and configuration you provide. You specify the job category, a schema-versioned configuration document, and an IAM role that grants Amazon SageMaker permission to access resources on your behalf.

Use the AgentRFT category to fine-tune a model using multi-turn reinforcement learning with reward signals. Use the AgentRFTEvaluation category to evaluate a fine-tuned or base model by running multi-turn rollouts against a held-out prompt dataset and computing metrics such as pass@k and mean reward.

Before creating a job, call ListJobSchemaVersions and DescribeJobSchemaVersion to retrieve the configuration schema for your job category. The JobConfigDocument must conform to the schema specified by JobConfigSchemaVersion.

The following operations are related to CreateJob:

  • DescribeJob

  • ListJobs

  • StopJob

  • DeleteJob

  • ListJobSchemaVersions

  • DescribeJobSchemaVersion

See also: AWS API Documentation

Request Syntax

response = client.create_job(
    JobName='string',
    RoleArn='string',
    JobCategory='AgentRFT'|'AgentRFTEvaluation',
    JobConfigSchemaVersion='string',
    JobConfigDocument='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters:
  • JobName (string) –

    [REQUIRED]

    The name of the job. The name must be unique within your account and Amazon Web Services Region.

  • RoleArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.

  • JobCategory (string) –

    [REQUIRED]

    The category of the job. The category determines the type of workload that the job runs.

  • JobConfigSchemaVersion (string) –

    [REQUIRED]

    The version of the configuration schema to use for the job configuration document. Use ListJobSchemaVersions to get available schema versions for a job category.

  • JobConfigDocument (string) –

    [REQUIRED]

    The JSON configuration document for the job. The document must conform to the schema specified by JobConfigSchemaVersion. Use DescribeJobSchemaVersion to retrieve the schema for validation.

  • Tags (list) –

    An array of key-value pairs to apply to the job as tags. For more information, see Tagging Amazon Web Services Resources.

    • (dict) –

      A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

      You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

      For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

      • Key (string) – [REQUIRED]

        The tag key. Tag keys must be unique per resource.

      • Value (string) – [REQUIRED]

        The tag value.

Return type:

dict

Returns:

Response Syntax

{
    'JobArn': 'string'
}

Response Structure

  • (dict) –

    • JobArn (string) –

      The Amazon Resource Name (ARN) of the job.

Exceptions