Repository: aws/sagemaker-python-sdk

Issue:
Broken instructions in "Local Mode" section
**What did you find confusing? Please describe.**
The instructions in the ["Local Mode section"](https://sagemaker.readthedocs.io/en/stable/overview.html#local-mode) are imprecise and is not working properly.

**Describe how documentation can be improved**
1. "The local mode uses a YAML configuration file located at ~/.sagemaker/config.yaml to define the default values that are automatically passed to the config attribute of LocalSession."

That is not (totally?) true.

```
❯ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sagemaker.local import LocalSession
sagemaker.config INFO - Not applying SDK defaults from location: /etc/xdg/xdg-ubuntu/sagemaker/config.yaml
sagemaker.config INFO - Not applying SDK defaults from location: /home/tapyu/.config/sagemaker/config.yaml
>>> 
```

For user wide, Python looks `config.yaml` on `$XDG_CONFIG_HOME`, which is `~/.config`. `sagemaker` simply ignores `~/.sagemaker/config.yaml`.

---

2.

```yaml
local:
    local_code: true # Using everything locally
    region_name: "us-west-2" # Name of the region
    container_config: # Additional docker container config
        shm_size: "128M
```
The double quote of `128M` is incomplete

---

3.

```py
from sagemaker.local import LocalSession

sagemaker_session = LocalSession()
sagemaker_session.config = {'local': {'local_code': True}}
```

This code is not working, even is I correct the .`yaml` file and put it in `~/.config`:

```
❯ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sagemaker.local import LocalSession
sagemaker.config INFO - Not applying SDK defaults from location: /etc/xdg/xdg-ubuntu/sagemaker/config.yaml
Unable to create default JumpStart SageMaker Session due to the following error: 'SchemaVersion' is a required property

Failed validating 'required' in schema:
    {'$schema': 'https://json-schema.org/draft/2020-12/schema',
     'additionalProperties': False,
     'definitions': {'container': {'additionalProperties': False,
                                   'properties': {'Environment': {'$ref': '#/definitions/environment-Length1024-Properties16'}},
                                   'type': 'object'},
                     'containers': {'items': {'$ref': '#/definitions/container'},
                                    'maxItems': 15,
                                    'minItems': 0,
                                    'type': 'array'},
                     'environment-Length1024-Properties16': {'additionalProperties': False,
                                                             'maxProperties': 16,
                                                             'patternProperties': {'([a-zA-Z_][a-zA-Z0-9_]*){1,1024}': {'maxLength': 1024,
                                                                                                                        'pattern': '[\\S\\s]*',
                                                                                                                        'type': 'string'}},
                                                             'type': 'object'},
                     'environment-Length10240-Properties16': {'additionalProperties': False,
                                                              'maxProperties': 16,
                                                              'patternProperties': {'[a-zA-Z_][a-zA-Z0-9_]{0,1023}': {'maxLength': 10240,
                                                                                                                      'pattern': '[\\S\\s]*',
                                                                                                                      'type': 'string'}},
                                                              'type': 'object'},
                     'environment-Length256-Properties100': {'additionalProperties': False,
                                                             'maxProperties': 100,
                                                             'patternProperties': {'([a-zA-Z_][a-zA-Z0-9_]*){1,256}': {'maxLength': 256,
                                                                                                                       'pattern': '[\\S\\s]*',
                                                                                                                       'type': 'string'}},
                                                             'type': 'object'},
                     'environment-Length256-Properties50': {'additionalProperties': False,
                                                            'maxProperties': 50,
                                                            'patternProperties': {'([a-zA-Z_][a-zA-Z0-9_]*){1,256}': {'maxLength': 256,
                                                                                                                      'pattern': '[\\S\\s]*',
                                                                                                                      'type': 'string'}},
                                                            'type': 'object'},
                     'environment-Length512-Properties48': {'additionalProperties': False,
                                                            'maxProperties': 48,
                                                            'patternProperties': {'([a-zA-Z_][a-zA-Z0-9_]*){1,512}': {'maxLength': 512,
                                                                                                                      'pattern': '[\\S\\s]*',
                                                                                                                      'type': 'string'}},
                                                            'type': 'object'},
                     'environmentVariables': {'additionalProperties': False,
                                              'maxProperties': 48,
                                              'patternProperties': {'([a-zA-Z_][a-zA-Z0-9_]*){1,512}': {'maxLength': 512,
                                                                                                        'pattern': '[\\S\\s]*',
                                                                                                        'type': 'string'}},
                                              'type': 'object'},
                     'kmsKeyId': {'maxLength': 2048, 'type': 'string'},
                     'modelPackageContainers': {'items': {'$ref': '#/definitions/container'},
                                                'maxItems': 15,
                                                'minItems': 1,
                                                'type': 'array'},
                     'preExecutionCommand': {'pattern': '.*',
                                             'type': 'string'},
                     'processingInput': {'additionalProperties': False,
                                         'properties': {'DatasetDefinition': {'additionalProperties': False,
                                                                              'properties': {'AthenaDatasetDefinition': {'additionalProperties': False,
                                                                                                                         'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                         'type': 'object'},
                                                                                             'RedshiftDatasetDefinition': {'additionalProperties': False,
                                                                                                                           'properties': {'ClusterRoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                                                                          'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                           'type': 'object'}},
                                                                              'type': 'object'}},
                                         'type': 'object'},
                     'productionVariant': {'additionalProperties': False,
                                           'properties': {'CoreDumpConfig': {'additionalProperties': False,
                                                                             'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                             'type': 'object'}},
                                           'type': 'object'},
                     'roleArn': {'maxLength': 2048,
                                 'minLength': 20,
                                 'pattern': '^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$',
                                 'type': 'string'},
                     's3Bucket': {'maxLength': 63,
                                  'minLength': 3,
                                  'pattern': '^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$',
                                  'type': 'string'},
                     's3Uri': {'maxLength': 1024,
                               'pattern': '^(https|s3)://([^/]+)/?(.*)$',
                               'type': 'string'},
                     'securityGroupId': {'maxLength': 32,
                                         'pattern': '[-0-9a-zA-Z]+',
                                         'type': 'string'},
                     'subnet': {'maxLength': 32,
                                'pattern': '[-0-9a-zA-Z]+',
                                'type': 'string'},
                     'tags': {'items': {'additionalProperties': False,
                                        'properties': {'Key': {'maxLength': 128,
                                                               'minLength': 1,
                                                               'pattern': '^[\\w\\s\\d_.:/=+\\-@]*$',
                                                               'type': 'string'},
                                                       'Value': {'maxLength': 256,
                                                                 'minLength': 0,
                                                                 'pattern': '^[\\w\\s\\d_.:/=+\\-@]*$',
                                                                 'type': 'string'}},
                                        'required': ['Key', 'Value'],
                                        'type': 'object'},
                              'maxItems': 50,
                              'minItems': 0,
                              'type': 'array'},
                     'validationProfile': {'additionalProperties': False,
                                           'properties': {'TransformJobDefinition': {'additionalProperties': False,
                                                                                     'properties': {'Environment': {'$ref': '#/definitions/environment-Length10240-Properties16'},
                                                                                                    'TransformOutput': {'additionalProperties': False,
                                                                                                                        'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                        'type': 'object'},
                                                                                                    'TransformResources': {'additionalProperties': False,
                                                                                                                           'properties': {'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                           'type': 'object'}},
                                                                                     'type': 'object'}},
                                           'type': 'object'},
                     'vpcConfig': {'additionalProperties': False,
                                   'properties': {'SecurityGroupIds': {'items': {'$ref': '#/definitions/securityGroupId'},
                                                                       'maxItems': 5,
                                                                       'minItems': 1,
                                                                       'type': 'array'},
                                                  'Subnets': {'items': {'$ref': '#/definitions/subnet'},
                                                              'maxItems': 16,
                                                              'minItems': 1,
                                                              'type': 'array'}},
                                   'type': 'object'}},
     'properties': {'CustomParameters': {'additionalProperties': False,
                                         'patternProperties': {'^[\\w\\s\\d_.:/=+\\-@]+$': {'type': 'string'}},
                                         'type': 'object'},
                    'SageMaker': {'additionalProperties': False,
                                  'properties': {'AutoMLJob': {'additionalProperties': False,
                                                               'properties': {'AutoMLJobConfig': {'additionalProperties': False,
                                                                                                  'properties': {'SecurityConfig': {'additionalProperties': False,
                                                                                                                                    'properties': {'EnableInterContainerTrafficEncryption': {'type': 'boolean'},
                                                                                                                                                   'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'},
                                                                                                                                                   'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                                                                                    'type': 'object'}},
                                                                                                  'type': 'object'},
                                                                              'OutputDataConfig': {'additionalProperties': False,
                                                                                                   'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                   'type': 'object'},
                                                                              'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                              'Tags': {'$ref': '#/definitions/tags'}},
                                                               'type': 'object'},
                                                 'CompilationJob': {'additionalProperties': False,
                                                                    'properties': {'OutputConfig': {'additionalProperties': False,
                                                                                                    'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                    'type': 'object'},
                                                                                   'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                   'Tags': {'$ref': '#/definitions/tags'},
                                                                                   'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                    'type': 'object'},
                                                 'EdgePackagingJob': {'additionalProperties': False,
                                                                      'properties': {'OutputConfig': {'additionalProperties': False,
                                                                                                      'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                      'type': 'object'},
                                                                                     'ResourceKey': {'$ref': '#/definitions/kmsKeyId'},
                                                                                     'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                     'Tags': {'$ref': '#/definitions/tags'}},
                                                                      'type': 'object'},
                                                 'Endpoint': {'additionalProperties': False,
                                                              'properties': {'Tags': {'$ref': '#/definitions/tags'}},
                                                              'type': 'object'},
                                                 'EndpointConfig': {'additionalProperties': False,
                                                                    'properties': {'AsyncInferenceConfig': {'additionalProperties': False,
                                                                                                            'properties': {'OutputConfig': {'additionalProperties': False,
                                                                                                                                            'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                                            'type': 'object'}},
                                                                                                            'type': 'object'},
                                                                                   'DataCaptureConfig': {'additionalProperties': False,
                                                                                                         'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                         'type': 'object'},
                                                                                   'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'},
                                                                                   'ProductionVariants': {'items': {'$ref': '#/definitions/productionVariant'},
                                                                                                          'type': 'array'},
                                                                                   'Tags': {'$ref': '#/definitions/tags'}},
                                                                    'type': 'object'},
                                                 'FeatureGroup': {'additionalProperties': False,
                                                                  'properties': {'OfflineStoreConfig': {'additionalProperties': False,
                                                                                                        'properties': {'S3StorageConfig': {'additionalProperties': False,
                                                                                                                                           'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                                           'type': 'object'}},
                                                                                                        'type': 'object'},
                                                                                 'OnlineStoreConfig': {'additionalProperties': False,
                                                                                                       'properties': {'SecurityConfig': {'additionalProperties': False,
                                                                                                                                         'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                                         'type': 'object'}},
                                                                                                       'type': 'object'},
                                                                                 'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                 'Tags': {'$ref': '#/definitions/tags'}},
                                                                  'type': 'object'},
                                                 'Model': {'additionalProperties': False,
                                                           'properties': {'Containers': {'$ref': '#/definitions/containers'},
                                                                          'EnableNetworkIsolation': {'type': 'boolean'},
                                                                          'ExecutionRoleArn': {'$ref': '#/definitions/roleArn'},
                                                                          'PrimaryContainer': {'$ref': '#/definitions/container'},
                                                                          'Tags': {'$ref': '#/definitions/tags'},
                                                                          'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                           'type': 'object'},
                                                 'ModelPackage': {'additionalProperties': False,
                                                                  'properties': {'InferenceSpecification': {'additionalProperties': False,
                                                                                                            'properties': {'Containers': {'$ref': '#/definitions/modelPackageContainers'}},
                                                                                                            'type': 'object'},
                                                                                 'ValidationSpecification': {'additionalProperties': False,
                                                                                                             'properties': {'ValidationProfiles': {'items': {'$ref': '#/definitions/validationProfile'},
                                                                                                                                                   'maxItems': 1,
                                                                                                                                                   'minItems': 1,
                                                                                                                                                   'type': 'array'},
                                                                                                                            'ValidationRole': {'$ref': '#/definitions/roleArn'}},
                                                                                                             'type': 'object'}},
                                                                  'type': 'object'},
                                                 'MonitoringSchedule': {'additionalProperties': False,
                                                                        'properties': {'MonitoringScheduleConfig': {'additionalProperties': False,
                                                                                                                    'properties': {'MonitoringJobDefinition': {'additionalProperties': False,
                                                                                                                                                               'properties': {'Environment': {'$ref': '#/definitions/environment-Length256-Properties50'},
                                                                                                                                                                              'MonitoringOutputConfig': {'additionalProperties': False,
                                                                                                                                                                                                         'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                                                                                                         'type': 'object'},
                                                                                                                                                                              'MonitoringResources': {'additionalProperties': False,
                                                                                                                                                                                                      'properties': {'ClusterConfig': {'additionalProperties': False,
                                                                                                                                                                                                                                       'properties': {'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                                                                                                                                       'type': 'object'}},
                                                                                                                                                                                                      'type': 'object'},
                                                                                                                                                                              'NetworkConfig': {'additionalProperties': False,
                                                                                                                                                                                                'properties': {'EnableInterContainerTrafficEncryption': {'type': 'boolean'},
                                                                                                                                                                                                               'EnableNetworkIsolation': {'type': 'boolean'},
                                                                                                                                                                                                               'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                                                                                                                                                'type': 'object'},
                                                                                                                                                                              'RoleArn': {'$ref': '#/definitions/roleArn'}},
                                                                                                                                                               'type': 'object'}},
                                                                                                                    'type': 'object'},
                                                                                       'Tags': {'$ref': '#/definitions/tags'}},
                                                                        'type': 'object'},
                                                 'Pipeline': {'additionalProperties': False,
                                                              'properties': {'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                             'Tags': {'$ref': '#/definitions/tags'}},
                                                              'type': 'object'},
                                                 'ProcessingJob': {'additionalProperties': False,
                                                                   'properties': {'Environment': {'$ref': '#/definitions/environment-Length256-Properties100'},
                                                                                  'NetworkConfig': {'additionalProperties': False,
                                                                                                    'properties': {'EnableInterContainerTrafficEncryption': {'type': 'boolean'},
                                                                                                                   'EnableNetworkIsolation': {'type': 'boolean'},
                                                                                                                   'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                                                    'type': 'object'},
                                                                                  'ProcessingInputs': {'items': {'$ref': '#/definitions/processingInput'},
                                                                                                       'maxItems': 10,
                                                                                                       'minItems': 0,
                                                                                                       'type': 'array'},
                                                                                  'ProcessingOutputConfig': {'additionalProperties': False,
                                                                                                             'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                             'type': 'object'},
                                                                                  'ProcessingResources': {'additionalProperties': False,
                                                                                                          'properties': {'ClusterConfig': {'additionalProperties': False,
                                                                                                                                           'properties': {'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                                                           'type': 'object'}},
                                                                                                          'type': 'object'},
                                                                                  'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                  'Tags': {'$ref': '#/definitions/tags'}},
                                                                   'type': 'object'},
                                                 'PythonSDK': {'additionalProperties': False,
                                                               'properties': {'Modules': {'additionalProperties': False,
                                                                                          'properties': {'Estimator': {'additionalProperties': False,
                                                                                                                       'properties': {'DebugHookConfig': {'description': 'Sets '
                                                                                                                                                                         'a '
                                                                                                                                                                         'boolean '
                                                                                                                                                                         'for '
                                                                                                                                                                         '`debugger_hook_config` '
                                                                                                                                                                         'ofEstimator '
                                                                                                                                                                         'which '
                                                                                                                                                                         'will '
                                                                                                                                                                         'be '
                                                                                                                                                                         'then '
                                                                                                                                                                         'used '
                                                                                                                                                                         'for '
                                                                                                                                                                         'training '
                                                                                                                                                                         'jobAPI '
                                                                                                                                                                         'call. '
                                                                                                                                                                         'Today, '
                                                                                                                                                                         'the '
                                                                                                                                                                         'config_schema '
                                                                                                                                                                         "doesn't "
                                                                                                                                                                         'supporta '
                                                                                                                                                                         'dictionary '
                                                                                                                                                                         'as '
                                                                                                                                                                         'a '
                                                                                                                                                                         'valid '
                                                                                                                                                                         'value '
                                                                                                                                                                         'to '
                                                                                                                                                                         'be '
                                                                                                                                                                         'provided.In '
                                                                                                                                                                         'the '
                                                                                                                                                                         'future '
                                                                                                                                                                         'to '
                                                                                                                                                                         'add '
                                                                                                                                                                         'support '
                                                                                                                                                                         'for '
                                                                                                                                                                         'DebugHookConfigas '
                                                                                                                                                                         'a '
                                                                                                                                                                         'dictionary, '
                                                                                                                                                                         'schema '
                                                                                                                                                                         'should '
                                                                                                                                                                         'be '
                                                                                                                                                                         'added '
                                                                                                                                                                         'underthe '
                                                                                                                                                                         'config '
                                                                                                                                                                         'path '
                                                                                                                                                                         '`SageMaker.TrainingJob` '
                                                                                                                                                                         'instead '
                                                                                                                                                                         'ofhere, '
                                                                                                                                                                         'since '
                                                                                                                                                                         'the '
                                                                                                                                                                         'TrainingJob '
                                                                                                                                                                         'API '
                                                                                                                                                                         'supportsDebugHookConfig '
                                                                                                                                                                         'as '
                                                                                                                                                                         'a '
                                                                                                                                                                         'dictionary, '
                                                                                                                                                                         'we '
                                                                                                                                                                         'can '
                                                                                                                                                                         'adda '
                                                                                                                                                                         'schema '
                                                                                                                                                                         'for '
                                                                                                                                                                         'it '
                                                                                                                                                                         'at '
                                                                                                                                                                         'API '
                                                                                                                                                                         'level.',
                                                                                                                                                          'type': 'boolean'}},
                                                                                                                       'type': 'object'},
                                                                                                         'NotebookJob': {'additionalProperties': False,
                                                                                                                         'properties': {'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                                                                        'S3KmsKeyId': {'$ref': '#/definitions/kmsKeyId'},
                                                                                                                                        'S3RootUri': {'$ref': '#/definitions/s3Uri'},
                                                                                                                                        'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'},
                                                                                                                                        'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                                                                         'type': 'object'},
                                                                                                         'RemoteFunction': {'additionalProperties': False,
                                                                                                                            'properties': {'CustomFileFilter': {'additionalProperties': False,
                                                                                                                                                                'properties': {'IgnoreNamePatterns': {'items': {'type': 'string'},
                                                                                                                                                                                                      'type': 'array'}},
                                                                                                                                                                'type': 'object'},
                                                                                                                                           'Dependencies': {'type': 'string'},
                                                                                                                                           'EnableInterContainerTrafficEncryption': {'type': 'boolean'},
                                                                                                                                           'EnvironmentVariables': {'$ref': '#/definitions/environmentVariables'},
                                                                                                                                           'ImageUri': {'type': 'string'},
                                                                                                                                           'IncludeLocalWorkDir': {'type': 'boolean'},
                                                                                                                                           'InstanceType': {'type': 'string'},
                                                                                                                                           'JobCondaEnvironment': {'type': 'string'},
                                                                                                                                           'PreExecutionCommands': {'items': {'$ref': '#/definitions/preExecutionCommand'},
                                                                                                                                                                    'type': 'array'},
                                                                                                                                           'PreExecutionScript': {'type': 'string'},
                                                                                                                                           'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                                                                           'S3KmsKeyId': {'$ref': '#/definitions/kmsKeyId'},
                                                                                                                                           'S3RootUri': {'$ref': '#/definitions/s3Uri'},
                                                                                                                                           'Tags': {'$ref': '#/definitions/tags'},
                                                                                                                                           'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'},
                                                                                                                                           'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                                                                            'type': 'object'},
                                                                                                         'Serve': {'additionalProperties': False,
                                                                                                                   'properties': {'EnvironmentVariables': {'$ref': '#/definitions/environmentVariables'},
                                                                                                                                  'InstanceType': {'type': 'string'},
                                                                                                                                  'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                                                                  'S3ModelDataUri': {'$ref': '#/definitions/s3Uri'}},
                                                                                                                   'type': 'object'},
                                                                                                         'Session': {'additionalProperties': False,
                                                                                                                     'properties': {'DefaultS3Bucket': {'$ref': '#/definitions/s3Bucket',
                                                                                                                                                        'description': 'sets '
                                                                                                                                                                       '`default_bucket` '
                                                                                                                                                                       'of '
                                                                                                                                                                       'Session'},
                                                                                                                                    'DefaultS3ObjectKeyPrefix': {'description': 'sets '
                                                                                                                                                                                '`default_bucket_prefix` '
                                                                                                                                                                                'of '
                                                                                                                                                                                'Session',
                                                                                                                                                                 'maxLength': 1024,
                                                                                                                                                                 'minLength': 1,
                                                                                                                                                                 'type': 'string'}},
                                                                                                                     'type': 'object'},
                                                                                                         'TelemetryOptOut': {'type': 'boolean'}},
                                                                                          'type': 'object'}},
                                                               'type': 'object'},
                                                 'TrainingJob': {'additionalProperties': False,
                                                                 'properties': {'EnableInterContainerTrafficEncryption': {'type': 'boolean'},
                                                                                'EnableNetworkIsolation': {'type': 'boolean'},
                                                                                'Environment': {'$ref': '#/definitions/environment-Length512-Properties48'},
                                                                                'OutputDataConfig': {'additionalProperties': False,
                                                                                                     'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                     'type': 'object'},
                                                                                'ProfilerConfig': {'additionalProperties': False,
                                                                                                   'properties': {'DisableProfiler': {'type': 'boolean'}},
                                                                                                   'type': 'object'},
                                                                                'ResourceConfig': {'additionalProperties': False,
                                                                                                   'properties': {'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                   'type': 'object'},
                                                                                'RoleArn': {'$ref': '#/definitions/roleArn'},
                                                                                'Tags': {'$ref': '#/definitions/tags'},
                                                                                'VpcConfig': {'$ref': '#/definitions/vpcConfig'}},
                                                                 'type': 'object'},
                                                 'TransformJob': {'additionalProperties': False,
                                                                  'properties': {'DataCaptureConfig': {'additionalProperties': False,
                                                                                                       'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                       'type': 'object'},
                                                                                 'Environment': {'$ref': '#/definitions/environment-Length10240-Properties16'},
                                                                                 'Tags': {'$ref': '#/definitions/tags'},
                                                                                 'TransformOutput': {'additionalProperties': False,
                                                                                                     'properties': {'KmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                     'type': 'object'},
                                                                                 'TransformResources': {'additionalProperties': False,
                                                                                                        'properties': {'VolumeKmsKeyId': {'$ref': '#/definitions/kmsKeyId'}},
                                                                                                        'type': 'object'}},
                                                                  'type': 'object'}},
                                  'type': 'object'},
                    'SchemaVersion': {'description': 'The schema version '
                                                     'of the document.',
                                      'enum': ['1.0'],
                                      'type': 'string'}},
     'required': ['SchemaVersion'],
     'type': 'object'}

On instance:
    {'local': {'container_config': {'shm_size': '128M'},
               'local_code': True,
               'region_name': 'us-west-2'}}.
```

**Additional context**
1.
```
❯ pip list | rg 'sagemaker'
sagemaker                             2.205.0
```
2.
```
❯ python3 --version
Python 3.10.12
```

Hints from issue comments:
@pintaoz-aws: Fixed by https://github.com/aws/sagemaker-python-sdk/pull/5026

Solution patch:
diff --git a/doc/overview.rst b/doc/overview.rst
index a6267f6f..77e6bd0c 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -1958,7 +1958,7 @@ Make sure to have a Compose Version compatible with your Docker Engine installat
 Local mode configuration
 ========================
 
-The local mode uses a YAML configuration file located at ``~/.sagemaker/config.yaml`` to define the default values that are automatically passed to the ``config`` attribute of ``LocalSession``. This is an example of the configuration, for the full schema, see `sagemaker.config.config_schema.SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA <https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/config/config_schema.py>`_.
+The local mode uses a YAML configuration file located at ``${user_config_directory}/sagemaker/config.yaml`` to define the default values that are automatically passed to the ``config`` attribute of ``LocalSession``. This is an example of the configuration, for the full schema, see `sagemaker.config.config_schema.SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA <https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/config/config_schema.py>`_.
 
 .. code:: yaml
 
@@ -1966,7 +1966,7 @@ The local mode uses a YAML configuration file located at ``~/.sagemaker/config.y
         local_code: true # Using everything locally
         region_name: "us-west-2" # Name of the region
         container_config: # Additional docker container config
-            shm_size: "128M
+            shm_size: "128M"
 
 If you want to keep everything local, and not use Amazon S3 either, you can enable "local code" in one of two ways:
 
diff --git a/src/sagemaker/jumpstart/cache.py b/src/sagemaker/jumpstart/cache.py
index 8ac813a6..bdfc01cb 100644
--- a/src/sagemaker/jumpstart/cache.py
+++ b/src/sagemaker/jumpstart/cache.py
@@ -262,7 +262,7 @@ class JumpStartModelsCache:
             return JumpStartVersionedModelId(model_id, sm_compatible_model_version)
 
         versions_incompatible_with_sagemaker = [
-            Version(header.version)
+            header.version
             for header in manifest.values()  # type: ignore
             if header.model_id == model_id
         ]
@@ -540,9 +540,7 @@ class JumpStartModelsCache:
         """
 
         if version_str == "*":
-            if len(available_versions) == 0:
-                return None
-            return str(max(available_versions))
+            return utils.get_latest_version(available_versions)
 
         if model_type == JumpStartModelType.PROPRIETARY:
             if "*" in version_str:
diff --git a/src/sagemaker/jumpstart/utils.py b/src/sagemaker/jumpstart/utils.py
index 46e5f8a8..23245b24 100644
--- a/src/sagemaker/jumpstart/utils.py
+++ b/src/sagemaker/jumpstart/utils.py
@@ -21,7 +21,7 @@ from typing import Any, Dict, List, Set, Optional, Tuple, Union
 from urllib.parse import urlparse
 import boto3
 from botocore.exceptions import ClientError
-from packaging.version import Version
+from packaging.version import Version, InvalidVersion
 import botocore
 from sagemaker_core.shapes import ModelAccessConfig
 import sagemaker
@@ -1630,3 +1630,11 @@ def get_draft_model_content_bucket(provider: Dict, region: str) -> str:
             return get_jumpstart_gated_content_bucket(region=region)
         return get_jumpstart_content_bucket(region=region)
     return neo_bucket
+
+
+def get_latest_version(versions: List[str]) -> Optional[str]:
+    """Returns the latest version using sem-ver when possible."""
+    try:
+        return None if not versions else max(versions, key=Version)
+    except InvalidVersion:
+        return max(versions)


Test patch:
diff --git a/tests/unit/sagemaker/jumpstart/test_cache.py b/tests/unit/sagemaker/jumpstart/test_cache.py
index da20debc..68169835 100644
--- a/tests/unit/sagemaker/jumpstart/test_cache.py
+++ b/tests/unit/sagemaker/jumpstart/test_cache.py
@@ -22,7 +22,10 @@ import botocore
 from mock.mock import MagicMock
 import pytest
 from mock import patch
+from packaging.version import Version
 
+
+from sagemaker.jumpstart import utils
 from sagemaker.jumpstart.cache import (
     JUMPSTART_DEFAULT_MANIFEST_FILE_S3_KEY,
     JUMPSTART_DEFAULT_PROPRIETARY_MANIFEST_KEY,
@@ -33,6 +36,7 @@ from sagemaker.jumpstart.constants import (
     ENV_VARIABLE_JUMPSTART_SPECS_LOCAL_ROOT_DIR_OVERRIDE,
 )
 from sagemaker.jumpstart.types import (
+    JumpStartCachedContentValue,
     JumpStartModelHeader,
     JumpStartModelSpecs,
     JumpStartVersionedModelId,
@@ -1119,3 +1123,124 @@ def test_jumpstart_local_metadata_override_specs_not_exist_both_directories(
             ),
         ]
     )
+
+
+@patch.object(JumpStartModelsCache, "_retrieval_function")
+def test_jumpstart_cache_handles_versioning_correctly_for_open_source_weights(
+    retrieval_function: Mock,
+):
+    sm_version = Version(utils.get_sagemaker_version())
+    new_sm_version = Version(str(sm_version.major + 1) + ".0.0")
+    print(str(new_sm_version))
+    versions = ["1.0.0", "2.9.1", "2.16.0"]
+    manifest = [
+        {
+            "model_id": "test-model",
+            "version": version,
+            "min_version": "2.49.0",
+            "spec_key": "spec_key",
+        }
+        for version in versions
+    ]
+
+    manifest.append(
+        {
+            "model_id": "test-model",
+            "version": "3.0.0",
+            "min_version": str(new_sm_version),
+            "spec_key": "spec_key",
+        }
+    )
+
+    manifest_dict = {}
+    for header in manifest:
+        header_obj = JumpStartModelHeader(header)
+        manifest_dict[JumpStartVersionedModelId(header_obj.model_id, header_obj.version)] = (
+            header_obj
+        )
+    retrieval_function.return_value = JumpStartCachedContentValue(formatted_content=manifest_dict)
+    key = JumpStartVersionedModelId("test-model", "*")
+
+    cache = JumpStartModelsCache(s3_bucket_name="some_bucket")
+    result = cache._get_open_weight_manifest_key_from_model_id(key=key, value=None)
+
+    assert_key = JumpStartVersionedModelId("test-model", "2.16.0")
+
+    assert result == assert_key
+
+
+@patch.object(JumpStartModelsCache, "_retrieval_function")
+def test_jumpstart_cache_handles_versioning_correctly_for_proprietary_weights(
+    retrieval_function: Mock,
+):
+    sm_version = Version(utils.get_sagemaker_version())
+    new_sm_version = Version(str(sm_version.major + 1) + ".0.0")
+    print(str(new_sm_version))
+    versions = ["1.0.0", "2.9.1", "2.16.0"]
+    manifest = [
+        {
+            "model_id": "test-model",
+            "version": version,
+            "min_version": "2.49.0",
+            "spec_key": "spec_key",
+        }
+        for version in versions
+    ]
+
+    manifest.append(
+        {
+            "model_id": "test-model",
+            "version": "3.0.0",
+            "min_version": str(new_sm_version),
+            "spec_key": "spec_key",
+        }
+    )
+
+    manifest_dict = {}
+    for header in manifest:
+        header_obj = JumpStartModelHeader(header)
+        manifest_dict[JumpStartVersionedModelId(header_obj.model_id, header_obj.version)] = (
+            header_obj
+        )
+    retrieval_function.return_value = JumpStartCachedContentValue(formatted_content=manifest_dict)
+    key = JumpStartVersionedModelId("test-model", "*")
+
+    cache = JumpStartModelsCache(s3_bucket_name="some_bucket")
+    result = cache._get_proprietary_manifest_key_from_model_id(key=key, value=None)
+
+    assert_key = JumpStartVersionedModelId("test-model", "2.16.0")
+
+    assert result == assert_key
+
+
+@patch.object(JumpStartModelsCache, "_retrieval_function")
+def test_jumpstart_cache_handles_versioning_correctly_non_sem_ver(retrieval_function: Mock):
+    sm_version = Version(utils.get_sagemaker_version())
+    new_sm_version = Version(str(sm_version.major + 1) + ".0.0")
+    print(str(new_sm_version))
+    versions = ["abc", "2.9.1", "2.16.0"]
+    manifest = [
+        {
+            "model_id": "test-model",
+            "version": version,
+            "min_version": "2.49.0",
+            "spec_key": "spec_key",
+        }
+        for version in versions
+    ]
+
+    manifest_dict = {}
+    for header in manifest:
+        header_obj = JumpStartModelHeader(header)
+        manifest_dict[JumpStartVersionedModelId(header_obj.model_id, header_obj.version)] = (
+            header_obj
+        )
+    retrieval_function.return_value = JumpStartCachedContentValue(formatted_content=manifest_dict)
+    key = JumpStartVersionedModelId("test-model", "*")
+
+    cache = JumpStartModelsCache(s3_bucket_name="some_bucket")
+    result = cache._get_open_weight_manifest_key_from_model_id(key=key, value=None)
+
+    assert_key = JumpStartVersionedModelId("test-model", "abc")
+
+    assert result == assert_key
diff --git a/tests/unit/sagemaker/jumpstart/test_utils.py b/tests/unit/sagemaker/jumpstart/test_utils.py
index 7cf8fdc9..ea4d64f2 100644
--- a/tests/unit/sagemaker/jumpstart/test_utils.py
+++ b/tests/unit/sagemaker/jumpstart/test_utils.py
@@ -2144,6 +2144,22 @@ def test_has_instance_rate_stat(stats, expected):
     assert utils.has_instance_rate_stat(stats) is expected
 
 
+def test_get_latest_version():
+    assert utils.get_latest_version(["2.9.1", "2.16.0", "1.0.0"]) == "2.16.0"
+
+
+def test_get_latest_version_empty_list_is_none():
+    assert utils.get_latest_version([]) is None
+
+
+def test_get_latest_version_none_is_none():
+    assert utils.get_latest_version(None) is None
+
+
+def test_get_latest_version_with_invalid_sem_ver():
+    assert utils.get_latest_version(["2.9.1", "2.16.0", "1.0.0", "abc"]) == "abc"
+
+
 @pytest.mark.parametrize(
     "data, expected",
     [(None, []), ([], []), (get_base_deployment_configs_metadata(), get_base_deployment_configs())],