create_ai_recommendation_job
¶
create_ai_recommendation_job(
*,
config_overrides: Optional[SageMakerClientConfig] = None,
ai_recommendation_job_name: Optional[AIEntityName] = None,
model_source: Optional[AIModelSource] = None,
output_config: Optional[AIRecommendationOutputConfig] = None,
ai_workload_config_identifier: Optional[AIResourceIdentifier] = None,
performance_target: Optional[AIRecommendationPerformanceTarget] = None,
role_arn: Optional[RoleArn] = None,
inference_specification: Optional[AIRecommendationInferenceSpecification] = None,
optimize_model: Optional[AIRecommendationAllowOptimization] = None,
compute_spec: Optional[AIRecommendationComputeSpec] = None,
adapter_source: Optional[AIAdapterSource] = None,
tags: Optional[TagList] = None,
) -> CreateAIRecommendationJobResponse
Creates a recommendation job that generates intelligent optimization recommendations for generative AI inference deployments. The job analyzes your model, workload configuration, and performance targets to recommend optimal instance types, model optimization techniques (such as quantization and speculative decoding), and deployment configurations.
Parameters:
-
ai_recommendation_job_name(Optional[AIEntityName], default:None) –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.
-
model_source(Optional[AIModelSource], default:None) –The source of the model to optimize. Specify the Amazon S3 location of the model artifacts.
-
output_config(Optional[AIRecommendationOutputConfig], default:None) –The output configuration for the recommendation job, including the Amazon S3 location for results and an optional model package group where the optimized model is registered.
-
ai_workload_config_identifier(Optional[AIResourceIdentifier], default:None) –The name or Amazon Resource Name (ARN) of the AI workload configuration to use for this recommendation job.
-
performance_target(Optional[AIRecommendationPerformanceTarget], default:None) –The performance targets for the recommendation job. Specify constraints on metrics such as time to first token (
ttft-ms),throughput, orcost. -
role_arn(Optional[RoleArn], default:None) –The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.
-
inference_specification(Optional[AIRecommendationInferenceSpecification], default:None) –The inference framework configuration. Specify the framework (such as LMI or vLLM) for the recommendation job.
-
optimize_model(Optional[AIRecommendationAllowOptimization], default:None) –Whether to allow model optimization techniques such as quantization, speculative decoding, and kernel tuning. The default is
true. -
compute_spec(Optional[AIRecommendationComputeSpec], default:None) –The compute resource specification for the recommendation job. You can specify up to 3 instance types to consider, and optionally provide capacity reservation configuration.
-
adapter_source(Optional[AIAdapterSource], default:None) –The LoRA adapter source for the recommendation job. Specify either a list of model package ARNs or Amazon S3 URIs for your LoRA adapters. When this parameter is absent, the recommendation job runs without LoRA adapter support.
-
tags(Optional[TagList], default:None) –The metadata that you apply to Amazon Web Services resources to help you categorize and organize them.
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.
-
ResourceNotFound–Resource being access is not found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 | |