{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-sagemaker/json-schema/amazon-sagemaker-create-compilation-job-request-schema.json",
  "title": "CreateCompilationJobRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-sagemaker-compilation-job-api-openapi.yml#/components/schemas/CreateCompilationJobRequest",
  "type": "object",
  "properties": {
    "CompilationJobName": {
      "type": "string",
      "description": "A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account."
    },
    "RoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf. During model compilation, Amazon SageMaker AI needs your permission to: Read input data from an S3 bucket Write model artifacts to an S3 bucket Write logs to Amazon CloudWatch Logs Publish metrics to Amazon CloudWatch You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker AI Roles."
    },
    "ModelPackageVersionArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of a versioned model package. Provide either a ModelPackageVersionArn or an InputConfig object in the request syntax. The presence of both objects in the CreateCompilationJob request will return an exception."
    },
    "InputConfig": {
      "$ref": "#/$defs/InputConfig"
    },
    "OutputConfig": {
      "$ref": "#/$defs/OutputConfig"
    },
    "VpcConfig": {
      "$ref": "#/$defs/NeoVpcConfig"
    },
    "StoppingCondition": {
      "$ref": "#/$defs/StoppingCondition"
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources."
    }
  },
  "required": [
    "CompilationJobName",
    "RoleArn",
    "OutputConfig",
    "StoppingCondition"
  ],
  "$defs": {
    "InputConfig": {
      "type": "object",
      "properties": {
        "S3Uri": {
          "type": "string",
          "description": "The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix)."
        },
        "DataInputConfig": {
          "type": "string",
          "description": "Specifies the name and shape of the expected data inputs for your trained model with a JSON dictionary form. The data inputs are Framework specific. TensorFlow: You must specify the name and shape (NHWC format) of the expected data inputs using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different. Examples for one input: If using the console, {\"input\":[1,1024,1024,3]} If using the CLI, {\\\"input\\\":[1,1024,1024,3]} Examples for two inputs: If using the console, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]} If using the CLI, {\\\"data1\\\": ["
        },
        "Framework": {
          "type": "string",
          "enum": [
            "TENSORFLOW",
            "KERAS",
            "MXNET",
            "ONNX",
            "PYTORCH",
            "XGBOOST",
            "TFLITE",
            "DARKNET",
            "SKLEARN"
          ],
          "description": "Identifies the framework in which the model was trained. For example: TENSORFLOW."
        },
        "FrameworkVersion": {
          "type": "string",
          "description": "Specifies the framework version to use. This API field is only supported for the MXNet, PyTorch, TensorFlow and TensorFlow Lite frameworks. For information about framework versions supported for cloud targets and edge devices, see Cloud Supported Instance Types and Frameworks and Edge Supported Frameworks."
        }
      },
      "required": [
        "S3Uri",
        "Framework"
      ]
    },
    "NeoVpcConfig": {
      "type": "object",
      "properties": {
        "SecurityGroupIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The VPC security group IDs. IDs have the form of sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field."
        },
        "Subnets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The ID of the subnets in the VPC that you want to connect the compilation job to for accessing the model in Amazon S3."
        }
      },
      "required": [
        "SecurityGroupIds",
        "Subnets"
      ]
    },
    "OutputConfig": {
      "type": "object",
      "properties": {
        "S3OutputLocation": {
          "type": "string",
          "description": "Identifies the S3 bucket where you want Amazon SageMaker AI to store the model artifacts. For example, s3://bucket-name/key-name-prefix."
        },
        "TargetDevice": {
          "type": "string",
          "enum": [
            "lambda",
            "ml_m4",
            "ml_m5",
            "ml_m6g",
            "ml_c4",
            "ml_c5",
            "ml_c6g",
            "ml_p2",
            "ml_p3",
            "ml_g4dn",
            "ml_inf1",
            "ml_inf2",
            "ml_trn1",
            "ml_eia2",
            "jetson_tx1",
            "jetson_tx2",
            "jetson_nano",
            "jetson_xavier",
            "rasp3b",
            "rasp4b",
            "imx8qm",
            "deeplens",
            "rk3399",
            "rk3288",
            "aisage",
            "sbe_c",
            "qcs605",
            "qcs603",
            "sitara_am57x",
            "amba_cv2",
            "amba_cv22",
            "amba_cv25",
            "x86_win32",
            "x86_win64",
            "coreml",
            "jacinto_tda4vm",
            "imx8mplus"
          ],
          "description": "Identifies the target device or the machine learning instance that you want to run your model on after the compilation has completed. Alternatively, you can specify OS, architecture, and accelerator using TargetPlatform fields. It can be used instead of TargetPlatform. Currently ml_trn1 is available only in US East (N. Virginia) Region, and ml_inf2 is available only in US East (Ohio) Region."
        },
        "TargetPlatform": {
          "$ref": "#/$defs/TargetPlatform"
        },
        "CompilerOptions": {
          "type": "string",
          "description": "Specifies additional parameters for compiler options in JSON format. The compiler options are TargetPlatform specific. It is required for NVIDIA accelerators and highly recommended for CPU compilations. For any other cases, it is optional to specify CompilerOptions. DTYPE: Specifies the data type for the input. When compiling for ml_* (except for ml_inf) instances using PyTorch framework, provide the data type (dtype) of the model's input. \"float32\" is used if \"DTYPE\" is not specified. Options for data type are: float32: Use either \"float\" or \"float32\". int64: Use either \"int64\" or \"long\". For"
        },
        "KmsKeyId": {
          "type": "string",
          "description": "The Amazon Web Services Key Management Service key (Amazon Web Services KMS) that Amazon SageMaker AI uses to encrypt your output models with Amazon S3 server-side encryption after compilation job. If you don't provide a KMS key ID, Amazon SageMaker AI uses the default KMS key for Amazon S3 for your role's account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide. The KmsKeyId can be any of the following formats: Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-12345678"
        }
      },
      "required": [
        "S3OutputLocation"
      ]
    },
    "StoppingCondition": {
      "type": "object",
      "properties": {
        "MaxRuntimeInSeconds": {
          "type": "integer",
          "description": "The maximum length of time, in seconds, that a training or compilation job can run before it is stopped. For compilation jobs, if the job does not complete during this time, a TimeOut error is generated. We recommend starting with 900 seconds and increasing as necessary based on your model. For all other jobs, if the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxRuntimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt. The default value is 1 day. The maximum value is 28 day"
        },
        "MaxWaitTimeInSeconds": {
          "type": "integer",
          "description": "The maximum length of time, in seconds, that a managed Spot training job has to complete. It is the amount of time spent waiting for Spot capacity plus the amount of time the job can run. It must be equal to or greater than MaxRuntimeInSeconds. If the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxWaitTimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt."
        },
        "MaxPendingTimeInSeconds": {
          "type": "integer",
          "description": "The maximum length of time, in seconds, that a training or compilation job can be pending before it is stopped. When working with training jobs that use capacity from training plans, not all Pending job states count against the MaxPendingTimeInSeconds limit. The following scenarios do not increment the MaxPendingTimeInSeconds counter: The plan is in a Scheduled state: Jobs queued (in Pending status) before a plan's start date (waiting for scheduled start time) Between capacity reservations: Jobs temporarily back to Pending status between two capacity reservation periods MaxPendingTimeInSeconds"
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The tag key. Tag keys must be unique per resource."
        },
        "Value": {
          "type": "string",
          "description": "The tag value."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "TargetPlatform": {
      "type": "object",
      "properties": {
        "Os": {
          "type": "string",
          "enum": [
            "ANDROID",
            "LINUX"
          ],
          "description": "Specifies a target platform OS. LINUX: Linux-based operating systems. ANDROID: Android operating systems. Android API level can be specified using the ANDROID_PLATFORM compiler option. For example, \"CompilerOptions\": {'ANDROID_PLATFORM': 28}"
        },
        "Arch": {
          "type": "string",
          "enum": [
            "X86_64",
            "X86",
            "ARM64",
            "ARM_EABI",
            "ARM_EABIHF"
          ],
          "description": "Specifies a target platform architecture. X86_64: 64-bit version of the x86 instruction set. X86: 32-bit version of the x86 instruction set. ARM64: ARMv8 64-bit CPU. ARM_EABIHF: ARMv7 32-bit, Hard Float. ARM_EABI: ARMv7 32-bit, Soft Float. Used by Android 32-bit ARM platform."
        },
        "Accelerator": {
          "type": "string",
          "enum": [
            "INTEL_GRAPHICS",
            "MALI",
            "NVIDIA",
            "NNA"
          ],
          "description": "Specifies a target platform accelerator (optional). NVIDIA: Nvidia graphics processing unit. It also requires gpu-code, trt-ver, cuda-ver compiler options MALI: ARM Mali graphics processor INTEL_GRAPHICS: Integrated Intel graphics"
        }
      },
      "required": [
        "Os",
        "Arch"
      ]
    }
  }
}