createAIBenchmarkJob method

Future<CreateAIBenchmarkJobResponse> createAIBenchmarkJob({
  1. required String aIBenchmarkJobName,
  2. required String aIWorkloadConfigIdentifier,
  3. required AIBenchmarkTarget benchmarkTarget,
  4. required AIBenchmarkOutputConfig outputConfig,
  5. required String roleArn,
  6. AIBenchmarkNetworkConfig? networkConfig,
  7. List<Tag>? tags,
})

Creates a benchmark job that runs performance benchmarks against inference infrastructure using a predefined AI workload configuration. The benchmark job measures metrics such as latency, throughput, and cost for your generative AI inference endpoints.

May throw ResourceInUse. May throw ResourceLimitExceeded. May throw ResourceNotFound.

Parameter aIBenchmarkJobName : The name of the AI benchmark job. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.

Parameter aIWorkloadConfigIdentifier : The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this benchmark job.

Parameter benchmarkTarget : The target endpoint to benchmark. Specify a SageMaker endpoint by providing its name or Amazon Resource Name (ARN).

Parameter outputConfig : The output configuration for the benchmark job, including the Amazon S3 location where benchmark results are stored.

Parameter roleArn : The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.

Parameter networkConfig : The network configuration for the benchmark job, including VPC settings.

Parameter tags : The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define.

Implementation

Future<CreateAIBenchmarkJobResponse> createAIBenchmarkJob({
  required String aIBenchmarkJobName,
  required String aIWorkloadConfigIdentifier,
  required AIBenchmarkTarget benchmarkTarget,
  required AIBenchmarkOutputConfig outputConfig,
  required String roleArn,
  AIBenchmarkNetworkConfig? networkConfig,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateAIBenchmarkJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AIBenchmarkJobName': aIBenchmarkJobName,
      'AIWorkloadConfigIdentifier': aIWorkloadConfigIdentifier,
      'BenchmarkTarget': benchmarkTarget,
      'OutputConfig': outputConfig,
      'RoleArn': roleArn,
      if (networkConfig != null) 'NetworkConfig': networkConfig,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateAIBenchmarkJobResponse.fromJson(jsonResponse.body);
}