{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-sagemaker/json-schema/amazon-sagemaker-create-airecommendation-job-request-schema.json",
  "title": "CreateAIRecommendationJobRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-sagemaker-ai-recommendation-job-api-openapi.yml#/components/schemas/CreateAIRecommendationJobRequest",
  "type": "object",
  "properties": {
    "AIRecommendationJobName": {
      "type": "string",
      "description": "The name of the AI recommendation job. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region."
    },
    "ModelSource": {
      "$ref": "#/$defs/AIModelSource"
    },
    "OutputConfig": {
      "$ref": "#/$defs/AIRecommendationOutputConfig"
    },
    "AIWorkloadConfigIdentifier": {
      "type": "string",
      "description": "The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this recommendation job."
    },
    "PerformanceTarget": {
      "$ref": "#/$defs/AIRecommendationPerformanceTarget"
    },
    "RoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf."
    },
    "InferenceSpecification": {
      "$ref": "#/$defs/AIRecommendationInferenceSpecification"
    },
    "OptimizeModel": {
      "type": "boolean",
      "description": "Whether to allow model optimization techniques such as quantization, speculative decoding, and kernel tuning. The default is true."
    },
    "ComputeSpec": {
      "$ref": "#/$defs/AIRecommendationComputeSpec"
    },
    "AdapterSource": {
      "$ref": "#/$defs/AIAdapterSource"
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "The metadata that you apply to Amazon Web Services resources to help you categorize and organize them."
    }
  },
  "required": [
    "AIRecommendationJobName",
    "ModelSource",
    "OutputConfig",
    "AIWorkloadConfigIdentifier",
    "PerformanceTarget",
    "RoleArn"
  ],
  "$defs": {
    "AIAdapterModelPackageEntry": {
      "type": "object",
      "properties": {
        "AdapterId": {
          "type": "string",
          "description": "A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long."
        },
        "ModelPackageArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the model package that contains the LoRA adapter artifacts."
        }
      },
      "required": [
        "AdapterId",
        "ModelPackageArn"
      ]
    },
    "AIAdapterS3Entry": {
      "type": "object",
      "properties": {
        "AdapterId": {
          "type": "string",
          "description": "A unique identifier for the adapter. This ID is used as the inference component name when the adapter is deployed. The ID must start and end with an alphanumeric character, can contain hyphens between alphanumeric characters, and can be up to 63 characters long."
        },
        "S3Uri": {
          "type": "string",
          "description": "The Amazon S3 URI of the directory that contains the LoRA adapter artifacts in PEFT format."
        }
      },
      "required": [
        "AdapterId",
        "S3Uri"
      ]
    },
    "AIAdapterSource": {
      "type": "object",
      "properties": {
        "ModelPackageArns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AIAdapterModelPackageEntry"
          },
          "description": "A list of LoRA adapters identified by their model package ARNs. Use this when your adapters were produced by a SageMaker AI fine-tuning workflow that registers model packages."
        },
        "S3Uris": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AIAdapterS3Entry"
          },
          "description": "A list of LoRA adapters identified by their Amazon S3 URIs. Use this when your adapters are stored as raw artifacts in Amazon S3."
        }
      },
      "description": "Exactly one member is set."
    },
    "AICapacityReservationConfig": {
      "type": "object",
      "properties": {
        "CapacityReservationPreference": {
          "type": "string",
          "enum": [
            "capacity-reservations-only"
          ],
          "description": "The capacity reservation preference. The only valid value is capacity-reservations-only."
        },
        "MlReservationArns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of ML reservation ARNs to use."
        }
      }
    },
    "AIMlflowConfig": {
      "type": "object",
      "properties": {
        "MlflowResourceArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the SageMaker managed MLflow resource."
        },
        "MlflowExperimentName": {
          "type": "string",
          "description": "The MLflow experiment name used for tracking."
        },
        "MlflowRunName": {
          "type": "string",
          "description": "The MLflow run name used for tracking."
        }
      },
      "required": [
        "MlflowResourceArn"
      ]
    },
    "AIModelSource": {
      "type": "object",
      "properties": {
        "S3": {
          "$ref": "#/$defs/AIModelSourceS3"
        }
      },
      "description": "Exactly one member is set."
    },
    "AIModelSourceS3": {
      "type": "object",
      "properties": {
        "S3Uri": {
          "type": "string",
          "description": "The Amazon S3 URI of the model artifacts."
        }
      }
    },
    "AIRecommendationComputeSpec": {
      "type": "object",
      "properties": {
        "InstanceTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ml.g5.xlarge",
              "ml.g5.2xlarge",
              "ml.g5.4xlarge",
              "ml.g5.8xlarge",
              "ml.g5.12xlarge",
              "ml.g5.16xlarge",
              "ml.g5.24xlarge",
              "ml.g5.48xlarge",
              "ml.g6.xlarge",
              "ml.g6.2xlarge",
              "ml.g6.4xlarge",
              "ml.g6.8xlarge",
              "ml.g6.12xlarge",
              "ml.g6.16xlarge",
              "ml.g6.24xlarge",
              "ml.g6.48xlarge",
              "ml.g6e.xlarge",
              "ml.g6e.2xlarge",
              "ml.g6e.4xlarge",
              "ml.g6e.8xlarge",
              "ml.g6e.12xlarge",
              "ml.g6e.16xlarge",
              "ml.g6e.24xlarge",
              "ml.g6e.48xlarge",
              "ml.g7.2xlarge",
              "ml.g7.4xlarge",
              "ml.g7.8xlarge",
              "ml.g7.12xlarge",
              "ml.g7.24xlarge",
              "ml.g7.48xlarge",
              "ml.g7e.2xlarge",
              "ml.g7e.4xlarge",
              "ml.g7e.8xlarge",
              "ml.g7e.12xlarge",
              "ml.g7e.24xlarge",
              "ml.g7e.48xlarge",
              "ml.p3.2xlarge",
              "ml.p3.8xlarge",
              "ml.p3.16xlarge",
              "ml.p4d.24xlarge",
              "ml.p4de.24xlarge",
              "ml.p5.4xlarge",
              "ml.p5.48xlarge",
              "ml.p5e.48xlarge",
              "ml.p5en.48xlarge",
              "ml.p6-b200.48xlarge"
            ]
          },
          "description": "The list of instance types to consider for recommendations. You can specify up to 3 instance types."
        },
        "CapacityReservationConfig": {
          "$ref": "#/$defs/AICapacityReservationConfig"
        }
      }
    },
    "AIRecommendationConstraint": {
      "type": "object",
      "properties": {
        "Metric": {
          "type": "string",
          "enum": [
            "ttft-ms",
            "throughput",
            "cost"
          ],
          "description": "The performance metric. Valid values are ttft-ms (time to first token in milliseconds), throughput, and cost."
        }
      },
      "required": [
        "Metric"
      ]
    },
    "AIRecommendationInferenceSpecification": {
      "type": "object",
      "properties": {
        "Framework": {
          "type": "string",
          "enum": [
            "LMI",
            "VLLM"
          ],
          "description": "The inference framework. Valid values are LMI and VLLM."
        }
      }
    },
    "AIRecommendationOutputConfig": {
      "type": "object",
      "properties": {
        "S3OutputLocation": {
          "type": "string",
          "description": "The Amazon S3 URI where recommendation results are stored."
        },
        "ModelPackageGroupIdentifier": {
          "type": "string",
          "description": "The name or Amazon Resource Name (ARN) of the model package group where the optimized model is registered as a new model package version."
        },
        "MlflowConfig": {
          "$ref": "#/$defs/AIMlflowConfig"
        }
      }
    },
    "AIRecommendationPerformanceTarget": {
      "type": "object",
      "properties": {
        "Constraints": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AIRecommendationConstraint"
          },
          "description": "An array of performance constraints that define the optimization objectives."
        }
      },
      "required": [
        "Constraints"
      ]
    },
    "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"
      ]
    }
  }
}