create_ai_recommendation_job
async
¶
create_ai_recommendation_job(
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = 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/async_sage_maker.py
2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 | |