model_customization_jobs
Creates, updates, deletes, gets or lists a model_customization_jobs resource.
Overview
| Name | model_customization_jobs |
| Type | Resource |
| Id | aws.bedrock.model_customization_jobs |
Fields
The following fields are returned by SELECT queries:
- get_model_customization_job
- list_model_customization_jobs
| Name | Datatype | Description |
|---|---|---|
base_model_arn | string | Amazon Resource Name (ARN) of the base model. (pattern: <code>arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model/[a-z0-9-]{1,63}[.]{1}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}</code>) |
client_request_token | string | The token that you specified in the CreateCustomizationJob request. (pattern: <code>[a-zA-Z0-9]([-a-zA-Z0-9]{0,254}[a-zA-Z0-9])?</code>) |
creation_time | string (date-time) | Time that the resource was created. |
customization_config | object | A model customization configuration |
customization_type | string | The type of model customization. (FINE_TUNING, CONTINUED_PRE_TRAINING, DISTILLATION, REINFORCEMENT_FINE_TUNING, IMPORTED) |
end_time | string (date-time) | Time that the resource transitioned to terminal state. |
failure_message | string | Information about why the job failed. |
hyper_parameters | object | The hyperparameter values for the job. For details on the format for different models, see Custom model hyperparameters. |
job_arn | string | The Amazon Resource Name (ARN) of the customization job. (pattern: <code>arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:model-customization-job/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}/[a-z0-9]{12}</code>) |
job_name | string | The name of the customization job. (pattern: <code>[a-zA-Z0-9](-[a-zA-Z0-9+-.])</code>) |
last_modified_time | string (date-time) | Time that the resource was last modified. |
output_data_config | object | S3 Location of the output data. |
output_model_arn | string | The Amazon Resource Name (ARN) of the output model. (pattern: <code>arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:[a-z0-9-]{1,20}:[0-9]{12}:custom-model/(imported|[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2})/[a-z0-9]{12}</code>) |
output_model_kms_key_arn | string | The custom model is encrypted at rest using this key. (pattern: <code>arn:aws(-[^:]+)?:kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}</code>) |
output_model_name | string | The name of the output model. (pattern: <code>([0-9a-zA-Z][_-]?){1,63}</code>) |
role_arn | string | The Amazon Resource Name (ARN) of the IAM role. (pattern: <code>arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+</code>) |
status | string | The status of the job. A successful job transitions from in-progress to completed when the output model is ready to use. If the job failed, the failure message contains information about why the job failed. (InProgress, Completed, Failed, Stopping, Stopped) |
status_details | object | For a Distillation job, the details about the statuses of the sub-tasks of the customization job. |
training_data_config | object | S3 Location of the training data. |
training_metrics | object | Contains training metrics from the job creation. |
validation_data_config | object | Array of up to 10 validators. |
validation_metrics | array | The loss metric for each validator that you provided in the createjob request. |
vpc_config | object | The configuration of a virtual private cloud (VPC). For more information, see Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink. |
| Name | Datatype | Description |
|---|---|---|
base_model_arn | string | Amazon Resource Name (ARN) of the base model. (pattern: <code>arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/((imported)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))(([:][a-z0-9-]{1,63}){0,2})?/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}))</code>) |
creation_time | string (date-time) | Creation time of the custom model. |
custom_model_arn | string | Amazon Resource Name (ARN) of the custom model. (pattern: <code>arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:[a-z0-9-]{1,20}:[0-9]{12}:custom-model/(imported|[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2})/[a-z0-9]{12}</code>) |
custom_model_name | string | Name of the custom model. (pattern: <code>([0-9a-zA-Z][_-]?){1,63}</code>) |
customization_type | string | Specifies whether to carry out continued pre-training of a model or whether to fine-tune it. For more information, see Custom models. (FINE_TUNING, CONTINUED_PRE_TRAINING, DISTILLATION, REINFORCEMENT_FINE_TUNING, IMPORTED) |
end_time | string (date-time) | Time that the customization job ended. |
job_arn | string | Amazon Resource Name (ARN) of the customization job. (pattern: <code>arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:model-customization-job/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}/[a-z0-9]{12}</code>) |
job_name | string | Name of the customization job. (pattern: <code>[a-zA-Z0-9](-[a-zA-Z0-9+-.])</code>) |
last_modified_time | string (date-time) | Time that the customization job was last modified. |
status | string | Status of the customization job. (InProgress, Completed, Failed, Stopping, Stopped) |
status_details | object | Details about the status of the data processing sub-task of the job. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_model_customization_job | select | job_identifier, region | Retrieves the properties associated with a model-customization job, including the status of the job. For more information, see Custom models in the Amazon Bedrock User Guide. | |
list_model_customization_jobs | select | region | creationTimeAfter, creationTimeBefore, statusEquals, nameContains, maxResults, nextToken, sortBy, sortOrder | Returns a list of model customization jobs that you have submitted. You can filter the jobs to return based on one or more criteria. For more information, see Custom models in the Amazon Bedrock User Guide. |
create_model_customization_job | insert | region, jobName, customModelName, roleArn, baseModelIdentifier, trainingDataConfig, outputDataConfig | Creates a fine-tuning job to customize a base model. You specify the base foundation model and the location of the training data. After the model-customization job completes successfully, your custom model resource will be ready to use. Amazon Bedrock returns validation loss metrics and output generations after the job completes. For information on the format of training and validation data, see Prepare the datasets. Model-customization jobs are asynchronous and the completion time depends on the base model and the training/validation data size. To monitor a job, use the GetModelCustomizationJob operation to retrieve the job status. For more information, see Custom models in the Amazon Bedrock User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
job_identifier | string | Identifier for the customization job. |
region | string | AWS region (default: us-east-1) |
creationTimeAfter | string (date-time) | Return customization jobs created after the specified time. |
creationTimeBefore | string (date-time) | Return customization jobs created before the specified time. |
maxResults | integer | The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results. |
nameContains | string | Return customization jobs only if the job name contains these characters. |
nextToken | string | If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results. |
sortBy | string | The field to sort by in the returned list of jobs. |
sortOrder | string | The sort order of the results. |
statusEquals | string | Return customization jobs with the specified status. |
SELECT examples
- get_model_customization_job
- list_model_customization_jobs
Retrieves the properties associated with a model-customization job, including the status of the job. For more information, see Custom models in the Amazon Bedrock User Guide.
SELECT
base_model_arn,
client_request_token,
creation_time,
customization_config,
customization_type,
end_time,
failure_message,
hyper_parameters,
job_arn,
job_name,
last_modified_time,
output_data_config,
output_model_arn,
output_model_kms_key_arn,
output_model_name,
role_arn,
status,
status_details,
training_data_config,
training_metrics,
validation_data_config,
validation_metrics,
vpc_config
FROM aws.bedrock.model_customization_jobs
WHERE job_identifier = '{{ job_identifier }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of model customization jobs that you have submitted. You can filter the jobs to return based on one or more criteria. For more information, see Custom models in the Amazon Bedrock User Guide.
SELECT
base_model_arn,
creation_time,
custom_model_arn,
custom_model_name,
customization_type,
end_time,
job_arn,
job_name,
last_modified_time,
status,
status_details
FROM aws.bedrock.model_customization_jobs
WHERE region = '{{ region }}' -- required
AND creationTimeAfter = '{{ creationTimeAfter }}'
AND creationTimeBefore = '{{ creationTimeBefore }}'
AND statusEquals = '{{ statusEquals }}'
AND nameContains = '{{ nameContains }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
;
INSERT examples
- create_model_customization_job
- Manifest
Creates a fine-tuning job to customize a base model. You specify the base foundation model and the location of the training data. After the model-customization job completes successfully, your custom model resource will be ready to use. Amazon Bedrock returns validation loss metrics and output generations after the job completes. For information on the format of training and validation data, see Prepare the datasets. Model-customization jobs are asynchronous and the completion time depends on the base model and the training/validation data size. To monitor a job, use the GetModelCustomizationJob operation to retrieve the job status. For more information, see Custom models in the Amazon Bedrock User Guide.
INSERT INTO aws.bedrock.model_customization_jobs (
jobName,
customModelName,
roleArn,
clientRequestToken,
baseModelIdentifier,
customizationType,
customModelKmsKeyId,
jobTags,
customModelTags,
trainingDataConfig,
validationDataConfig,
outputDataConfig,
hyperParameters,
vpcConfig,
customizationConfig,
region
)
SELECT
'{{ jobName }}' /* required */,
'{{ customModelName }}' /* required */,
'{{ roleArn }}' /* required */,
'{{ clientRequestToken }}',
'{{ baseModelIdentifier }}' /* required */,
'{{ customizationType }}',
'{{ customModelKmsKeyId }}',
'{{ jobTags }}',
'{{ customModelTags }}',
'{{ trainingDataConfig }}' /* required */,
'{{ validationDataConfig }}',
'{{ outputDataConfig }}' /* required */,
'{{ hyperParameters }}',
'{{ vpcConfig }}',
'{{ customizationConfig }}',
'{{ region }}'
RETURNING
job_arn
;
# Description fields are for documentation purposes
- name: model_customization_jobs
props:
- name: region
value: "{{ region }}"
description: Required parameter for the model_customization_jobs resource.
- name: jobName
value: "{{ jobName }}"
- name: customModelName
value: "{{ customModelName }}"
- name: roleArn
value: "{{ roleArn }}"
- name: clientRequestToken
value: "{{ clientRequestToken }}"
- name: baseModelIdentifier
value: "{{ baseModelIdentifier }}"
- name: customizationType
value: "{{ customizationType }}"
valid_values: ['FINE_TUNING', 'CONTINUED_PRE_TRAINING', 'DISTILLATION', 'REINFORCEMENT_FINE_TUNING', 'IMPORTED']
- name: customModelKmsKeyId
value: "{{ customModelKmsKeyId }}"
- name: jobTags
value:
- key: "{{ key }}"
value: "{{ value }}"
- name: customModelTags
value:
- key: "{{ key }}"
value: "{{ value }}"
- name: trainingDataConfig
description: |
S3 Location of the training data.
value:
s3Uri: "{{ s3Uri }}"
invocationLogsConfig:
usePromptResponse: {{ usePromptResponse }}
invocationLogSource:
s3Uri: "{{ s3Uri }}"
requestMetadataFilters:
equals: "{{ equals }}"
notEquals: "{{ notEquals }}"
andAll:
- equals: "{{ equals }}"
notEquals: "{{ notEquals }}"
orAll:
- equals: "{{ equals }}"
notEquals: "{{ notEquals }}"
- name: validationDataConfig
description: |
Array of up to 10 validators.
value:
validators:
- s3Uri: "{{ s3Uri }}"
- name: outputDataConfig
description: |
S3 Location of the output data.
value:
s3Uri: "{{ s3Uri }}"
- name: hyperParameters
value: "{{ hyperParameters }}"
- name: vpcConfig
description: |
The configuration of a virtual private cloud (VPC). For more information, see Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink.
value:
subnetIds:
- "{{ subnetIds }}"
securityGroupIds:
- "{{ securityGroupIds }}"
- name: customizationConfig
description: |
A model customization configuration
value:
distillationConfig:
teacherModelConfig:
teacherModelIdentifier: "{{ teacherModelIdentifier }}"
maxResponseLengthForInference: {{ maxResponseLengthForInference }}
rftConfig:
graderConfig:
lambdaGrader:
lambdaArn: "{{ lambdaArn }}"
hyperParameters:
epochCount: {{ epochCount }}
batchSize: {{ batchSize }}
learningRate: {{ learningRate }}
maxPromptLength: {{ maxPromptLength }}
trainingSamplePerPrompt: {{ trainingSamplePerPrompt }}
inferenceMaxTokens: {{ inferenceMaxTokens }}
reasoningEffort: "{{ reasoningEffort }}"
evalInterval: {{ evalInterval }}