Skip to main content

model_invocation_jobs

Creates, updates, deletes, gets or lists a model_invocation_jobs resource.

Overview

Namemodel_invocation_jobs
TypeResource
Idaws.bedrock.model_invocation_jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
client_request_tokenstringA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency. (pattern: <code>[a-zA-Z0-9]{1,256}(-*[a-zA-Z0-9]){0,256}</code>)
end_timestring (date-time)The time at which the batch inference job ended.
error_record_countinteger (int64)The number of records that failed to process in the batch inference job.
input_data_configobjectDetails about the location of the input to the batch inference job.
job_arnstringThe Amazon Resource Name (ARN) of the batch inference job. (pattern: <code>(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:model-invocation-job/[a-z0-9]{12})</code>)
job_expiration_timestring (date-time)The time at which the batch inference job times or timed out.
job_namestringThe name of the batch inference job. (pattern: <code>[a-zA-Z0-9]{1,63}(-*[a-zA-Z0-9+-.]){0,63}</code>)
last_modified_timestring (date-time)The time at which the batch inference job was last modified.
messagestringIf the batch inference job failed, this field contains a message describing why the job failed.
model_idstringThe unique identifier of the foundation model used for model inference. (pattern: <code>(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-:]{1,63}/[a-z0-9]{12}$)|(:foundation-model/([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2})|(([0-9a-zA-Z][-]?)+)$)|([0-9]{12}:(inference-profile|application-inference-profile)/[a-zA-Z0-9-:.]+$)))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.]?[a-z0-9-]{1,63})([:][a-z0-9-]{1,63}){0,2})|(([0-9a-zA-Z][-]?)+)</code>)
model_invocation_typestringThe invocation endpoint for ModelInvocationJob (InvokeModel, Converse)
output_data_configobjectContains the configuration of the S3 location of the output data.
processed_record_countinteger (int64)The number of records that have been processed in the batch inference job.
role_arnstringThe Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference. (pattern: <code>arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+</code>)
statusstringThe status of the batch inference job. The following statuses are possible: Submitted – This job has been submitted to a queue for validation. Validating – This job is being validated for the requirements described in Format and upload your batch inference data. The criteria include the following: Your IAM service role has access to the Amazon S3 buckets containing your files. Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the modelInput value matches the request body for the model. Your files fulfill the requirements for file size and number of records. For more information, see Quotas for Amazon Bedrock. Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn. Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request. InProgress – This job has begun. You can start viewing the results in the output S3 location. Completed – This job has successfully completed. View the output files in the output S3 location. PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location. Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the Amazon Web Services Support Center. Stopped – This job was stopped by a user. Stopping – This job is being stopped by a user. (Submitted, InProgress, Completed, Failed, Stopping, Stopped, PartiallyCompleted, Expired, Validating, Scheduled)
submit_timestring (date-time)The time at which the batch inference job was submitted.
success_record_countinteger (int64)The number of records that were successfully processed in the batch inference job.
timeout_duration_in_hoursintegerThe number of hours after which batch inference job was set to time out.
total_record_countinteger (int64)The total number of records in the batch inference job.
vpc_configobjectThe configuration of a virtual private cloud (VPC). For more information, see Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_model_invocation_jobselectjob_identifier, regionGets details about a batch inference job. For more information, see Monitor batch inference jobs
list_model_invocation_jobsselectregionsubmitTimeAfter, submitTimeBefore, statusEquals, nameContains, maxResults, nextToken, sortBy, sortOrderLists all batch inference jobs in the account. For more information, see View details about a batch inference job.
create_model_invocation_jobinsertregion, jobName, roleArn, modelId, inputDataConfig, outputDataConfigCreates a batch inference job to invoke a model on multiple prompts. Format your data according to Format your inference data and upload it to an Amazon S3 bucket. For more information, see Process multiple prompts with batch inference. The response returns a jobArn that you can use to stop or get details about the job.

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.

NameDatatypeDescription
job_identifierstringThe Amazon Resource Name (ARN) of the batch inference job.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return. If there are more results than the number that you specify, a nextToken value is returned. Use the nextToken in a request to return the next batch of results.
nameContainsstringSpecify a string to filter for batch inference jobs whose names contain the string.
nextTokenstringIf there were more results than the value you specified in the maxResults field in a previous ListModelInvocationJobs request, the response would have returned a nextToken value. To see the next batch of results, send the nextToken value in another request.
sortBystringAn attribute by which to sort the results.
sortOrderstringSpecifies whether to sort the results by ascending or descending order.
statusEqualsstringSpecify a status to filter for batch inference jobs whose statuses match the string you specify. The following statuses are possible: Submitted – This job has been submitted to a queue for validation. Validating – This job is being validated for the requirements described in Format and upload your batch inference data. The criteria include the following: Your IAM service role has access to the Amazon S3 buckets containing your files. Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the modelInput value matches the request body for the model. Your files fulfill the requirements for file size and number of records. For more information, see Quotas for Amazon Bedrock. Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn. Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request. InProgress – This job has begun. You can start viewing the results in the output S3 location. Completed – This job has successfully completed. View the output files in the output S3 location. PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location. Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the Amazon Web Services Support Center. Stopped – This job was stopped by a user. Stopping – This job is being stopped by a user.
submitTimeAfterstring (date-time)Specify a time to filter for batch inference jobs that were submitted after the time you specify.
submitTimeBeforestring (date-time)Specify a time to filter for batch inference jobs that were submitted before the time you specify.

SELECT examples

Gets details about a batch inference job. For more information, see Monitor batch inference jobs

SELECT
client_request_token,
end_time,
error_record_count,
input_data_config,
job_arn,
job_expiration_time,
job_name,
last_modified_time,
message,
model_id,
model_invocation_type,
output_data_config,
processed_record_count,
role_arn,
status,
submit_time,
success_record_count,
timeout_duration_in_hours,
total_record_count,
vpc_config
FROM aws.bedrock.model_invocation_jobs
WHERE job_identifier = '{{ job_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a batch inference job to invoke a model on multiple prompts. Format your data according to Format your inference data and upload it to an Amazon S3 bucket. For more information, see Process multiple prompts with batch inference. The response returns a jobArn that you can use to stop or get details about the job.

INSERT INTO aws.bedrock.model_invocation_jobs (
jobName,
roleArn,
clientRequestToken,
modelId,
inputDataConfig,
outputDataConfig,
vpcConfig,
timeoutDurationInHours,
tags,
modelInvocationType,
region
)
SELECT
'{{ jobName }}' /* required */,
'{{ roleArn }}' /* required */,
'{{ clientRequestToken }}',
'{{ modelId }}' /* required */,
'{{ inputDataConfig }}' /* required */,
'{{ outputDataConfig }}' /* required */,
'{{ vpcConfig }}',
{{ timeoutDurationInHours }},
'{{ tags }}',
'{{ modelInvocationType }}',
'{{ region }}'
RETURNING
job_arn
;