2026/10/12 - Amazon SageMaker Service - 5 new api methods
Changes Amazon SageMaker Training Session is a managed service for training on shared GPU infrastructure. It provides full lifecycle management of training sessions and exposes low-level primitive APIs for operations like forward-backward passes, optimizer steps, and state management.
Deletes a training session. You must stop a running session before deleting it. Use the StopTrainingSession operation to stop the session first.
The following operations are related to DeleteTrainingSession:
CreateTrainingSession
DescribeTrainingSession
StopTrainingSession
See also: AWS API Documentation
Request Syntax
client.delete_training_session(
TrainingSessionName='string'
)
string
[REQUIRED]
The name of the training session to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Creates a training session in Amazon SageMaker. A training session provisions compute resources for fine-tuning a foundation model using Low-Rank Adaptation (LoRA). After the session is created, you can submit training operations and sample inference requests through the Amazon SageMaker Training Session Runtime API.
The following operations are related to CreateTrainingSession:
DescribeTrainingSession
ListTrainingSessions
StopTrainingSession
DeleteTrainingSession
See also: AWS API Documentation
Request Syntax
client.create_training_session(
TrainingSessionName='string',
ModelPackageGroupArn='string',
LoraConfig={
'Rank': 123,
'Alpha': 123
},
RoleArn='string',
VpcConfig={
'SecurityGroupIds': [
'string',
],
'Subnets': [
'string',
]
},
ModelConfig={
'BaseModelArn': 'string',
'AcceptEula': True|False
},
OutputConfig={
'S3Location': {
'Path': 'string',
'KmsKeyArn': 'string'
}
},
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
string
[REQUIRED]
The name of the training session.
string
The Amazon Resource Name (ARN) of the model package group where checkpoints and fine-tuned model artifacts are published.
dict
[REQUIRED]
The Low-Rank Adaptation (LoRA) configuration for the training session, including the rank and alpha parameters.
Rank (integer) -- [REQUIRED]
The rank of the Low-Rank Adaptation (LoRA) adapter matrices.
Alpha (integer) -- [REQUIRED]
The Low-Rank Adaptation (LoRA) scaling factor.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to access resources on your behalf. The role must have permissions to access the output S3 path and model package group.
dict
The Virtual Private Cloud (VPC) configuration for the training session. Specify subnets and security groups to run the training session in your VPC.
SecurityGroupIds (list) -- [REQUIRED]
The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.
(string) --
Subnets (list) -- [REQUIRED]
The ID of the subnets in the VPC to which you want to connect your training job or model. For information about the availability of specific instance types, see Supported Instance Types and Availability Zones.
(string) --
dict
[REQUIRED]
The configuration for the base model, including the model ARN and end-user license agreement (EULA) acceptance.
BaseModelArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the base foundation model from SageMaker Hub.
AcceptEula (boolean) --
Specifies whether you accept the end-user license agreement (EULA) for gated models.
dict
[REQUIRED]
The output configuration for the training session, including the S3 location and optional encryption settings.
S3Location (dict) -- [REQUIRED]
The Amazon S3 location where training session outputs, including checkpoints and model artifacts, are stored.
Path (string) -- [REQUIRED]
The Amazon S3 path where training session outputs are stored.
KmsKeyArn (string) --
The Amazon Resource Name (ARN) of the KMS key used to encrypt output data. If not specified, the default Amazon S3 encryption is used.
list
An array of key-value pairs to apply to the training session as tags. For more information, see Tagging Amazon Web Services Resources.
(dict) --
A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.
You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.
For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.
Key (string) -- [REQUIRED]
The tag key. Tag keys must be unique per resource.
Value (string) -- [REQUIRED]
The tag value.
dict
Response Syntax
{
'TrainingSessionArn': 'string'
}
Response Structure
(dict) --
TrainingSessionArn (string) --
The Amazon Resource Name (ARN) of the training session.
Lists training sessions in your account. You can filter results by creation time, name, and status. The operation paginates results. To retrieve additional results, use the NextToken parameter.
The following operations are related to ListTrainingSessions:
CreateTrainingSession
DescribeTrainingSession
See also: AWS API Documentation
Request Syntax
client.list_training_sessions(
NextToken='string',
MaxResults=123,
CreationTimeAfter=datetime(2015, 1, 1),
CreationTimeBefore=datetime(2015, 1, 1),
NameContains='string',
StatusEquals='Created'|'Blocked'|'Running'|'Failed'|'Scheduled'|'Stopping'|'Stopped'|'Expired'|'Deleting'|'DeletionFailed'
)
string
If the response was truncated, use the token returned in the previous response to retrieve the next page of results.
integer
The maximum number of training sessions to return in the response.
datetime
A filter that returns only training sessions created after the specified time.
datetime
A filter that returns only training sessions created before the specified time.
string
A string in the training session name to filter results. Only sessions whose name contains the specified string are returned.
string
A filter that returns only training sessions with the specified status.
dict
Response Syntax
{
'NextToken': 'string',
'TrainingSessionSummaries': [
{
'TrainingSessionArn': 'string',
'TrainingSessionStatus': 'Created'|'Blocked'|'Running'|'Failed'|'Scheduled'|'Stopping'|'Stopped'|'Expired'|'Deleting'|'DeletionFailed',
'CreationTime': datetime(2015, 1, 1),
'LastModifiedTime': datetime(2015, 1, 1)
},
]
}
Response Structure
(dict) --
NextToken (string) --
If the response is truncated, this token retrieves the next set of results.
TrainingSessionSummaries (list) --
An array of TrainingSessionSummary objects that provide summary information about the training sessions.
(dict) --
Contains summary information about a training session.
TrainingSessionArn (string) --
The Amazon Resource Name (ARN) of the training session.
TrainingSessionStatus (string) --
The current status of the training session.
CreationTime (datetime) --
The date and time that the training session was created.
LastModifiedTime (datetime) --
The date and time that the training session was last modified.
Stops a running training session and sets the session status to Stopping. After the session stops, the status changes to Stopped. To delete a stopped session, use the DeleteTrainingSession operation.
The following operations are related to StopTrainingSession:
CreateTrainingSession
DescribeTrainingSession
DeleteTrainingSession
See also: AWS API Documentation
Request Syntax
client.stop_training_session(
TrainingSessionName='string'
)
string
[REQUIRED]
The name of the training session to stop.
dict
Response Syntax
{}
Response Structure
(dict) --
Retrieves detailed information about a training session, including its current status, model configuration, Low-Rank Adaptation (LoRA) parameters, and timestamps.
The following operations are related to DescribeTrainingSession:
CreateTrainingSession
ListTrainingSessions
StopTrainingSession
DeleteTrainingSession
See also: AWS API Documentation
Request Syntax
client.describe_training_session(
TrainingSessionName='string'
)
string
[REQUIRED]
The name of the training session to describe.
dict
Response Syntax
{
'TrainingSessionDetail': {
'TrainingSessionArn': 'string',
'TrainingSessionName': 'string',
'TrainingSessionStatus': 'Created'|'Blocked'|'Running'|'Failed'|'Scheduled'|'Stopping'|'Stopped'|'Expired'|'Deleting'|'DeletionFailed',
'ModelPackageGroupArn': 'string',
'CreationTime': datetime(2015, 1, 1),
'LastModifiedTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'ErrorDetails': 'string',
'LastReceivedSequenceNumber': 123,
'BillableTokenUsage': {
'PrefillTokenCount': 123,
'SampleTokenCount': 123,
'TrainingTokenCount': 123
},
'VpcConfig': {
'SecurityGroupIds': [
'string',
],
'Subnets': [
'string',
]
},
'RoleArn': 'string',
'LoraConfig': {
'Rank': 123,
'Alpha': 123
},
'ModelConfig': {
'BaseModelArn': 'string',
'AcceptEula': True|False
},
'OutputConfig': {
'S3Location': {
'Path': 'string',
'KmsKeyArn': 'string'
}
},
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
(dict) --
TrainingSessionDetail (dict) --
The detailed information about the training session.
TrainingSessionArn (string) --
The Amazon Resource Name (ARN) of the training session.
TrainingSessionName (string) --
The name of the training session.
TrainingSessionStatus (string) --
The current status of the training session.
ModelPackageGroupArn (string) --
The Amazon Resource Name (ARN) of the model package group where checkpoints are published.
CreationTime (datetime) --
The date and time that the training session was created.
LastModifiedTime (datetime) --
The date and time that the training session was last modified.
EndTime (datetime) --
The date and time that the training session ended.
ErrorDetails (string) --
If the training session failed or is blocked, detailed error information.
LastReceivedSequenceNumber (integer) --
The sequence number of the last training operation received by the session.
BillableTokenUsage (dict) --
The billable token usage for the training session.
PrefillTokenCount (integer) --
The number of prefill tokens consumed.
SampleTokenCount (integer) --
The number of sample tokens consumed.
TrainingTokenCount (integer) --
The number of training tokens consumed.
VpcConfig (dict) --
The Virtual Private Cloud (VPC) configuration for the training session.
SecurityGroupIds (list) --
The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.
(string) --
Subnets (list) --
The ID of the subnets in the VPC to which you want to connect your training job or model. For information about the availability of specific instance types, see Supported Instance Types and Availability Zones.
(string) --
RoleArn (string) --
The Amazon Resource Name (ARN) of the IAM role associated with the training session.
LoraConfig (dict) --
The Low-Rank Adaptation (LoRA) configuration for the training session.
Rank (integer) --
The rank of the Low-Rank Adaptation (LoRA) adapter matrices.
Alpha (integer) --
The Low-Rank Adaptation (LoRA) scaling factor.
ModelConfig (dict) --
The configuration for the base model.
BaseModelArn (string) --
The Amazon Resource Name (ARN) of the base foundation model from SageMaker Hub.
AcceptEula (boolean) --
Specifies whether you accept the end-user license agreement (EULA) for gated models.
OutputConfig (dict) --
The output configuration for the training session.
S3Location (dict) --
The Amazon S3 location where training session outputs, including checkpoints and model artifacts, are stored.
Path (string) --
The Amazon S3 path where training session outputs are stored.
KmsKeyArn (string) --
The Amazon Resource Name (ARN) of the KMS key used to encrypt output data. If not specified, the default Amazon S3 encryption is used.
Tags (list) --
The tags associated with the training session.
(dict) --
A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.
You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.
For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.
Key (string) --
The tag key. Tag keys must be unique per resource.
Value (string) --
The tag value.