Skip to content

create_ai_workload_config

create_ai_workload_config(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    ai_workload_config_name: Optional[AIEntityName] = None,
    dataset_config: Optional[AIDatasetConfig] = None,
    ai_workload_configs: Optional[AIWorkloadConfigs] = None,
    tags: Optional[TagList] = None,
) -> CreateAIWorkloadConfigResponse

Creates a reusable AI workload configuration that defines datasets, data sources, and benchmark tool settings for consistent performance testing of generative AI inference deployments on Amazon SageMaker AI.

Parameters:

  • ai_workload_config_name (Optional[AIEntityName], default: None ) –

    The name of the AI workload configuration. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.

  • dataset_config (Optional[AIDatasetConfig], default: None ) –

    The dataset configuration for the workload. Specify input data channels with their data sources for benchmark workloads.

  • ai_workload_configs (Optional[AIWorkloadConfigs], default: None ) –

    The benchmark tool configuration and workload specification. Provide the specification as an inline YAML or JSON string.

  • tags (Optional[TagList], default: None ) –

    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. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_ai_workload_config(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    ai_workload_config_name: Optional[
        "capo_sagemaker.types.ai_entity_name.AIEntityName"
    ] = None,
    dataset_config: Optional[
        "capo_sagemaker.types.ai_dataset_config.AIDatasetConfig"
    ] = None,
    ai_workload_configs: Optional[
        "capo_sagemaker.types.ai_workload_configs.AIWorkloadConfigs"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_ai_workload_config_response.CreateAIWorkloadConfigResponse":
    """<p>Creates a reusable AI workload configuration that defines datasets, data sources, and benchmark tool settings for consistent performance testing of generative AI inference deployments on Amazon SageMaker AI.</p>

    Args:
        ai_workload_config_name: <p>The name of the AI workload configuration. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.</p>
        dataset_config: <p>The dataset configuration for the workload. Specify input data channels with their data sources for benchmark workloads.</p>
        ai_workload_configs: <p>The benchmark tool configuration and workload specification. Provide the specification as an inline YAML or JSON string.</p>
        tags: <p>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. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in the Amazon Web Services General Reference.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_ai_workload_config_request.CreateAIWorkloadConfigRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_ai_workload_config_response.CreateAIWorkloadConfigResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_ai_workload_config

        output, http_response = (
            capo_sagemaker._operations.sage_maker.create_ai_workload_config.create_ai_workload_config(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAIWorkloadConfig")
    )
    input_: capo_sagemaker.types.create_ai_workload_config_request.CreateAIWorkloadConfigRequest = {}
    if ai_workload_config_name is not None:
        input_["ai_workload_config_name"] = ai_workload_config_name
    if dataset_config is not None:
        input_["dataset_config"] = dataset_config
    if ai_workload_configs is not None:
        input_["ai_workload_configs"] = ai_workload_configs
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output