Environment Variables

Accessors to retrieve environment variables for hosting containers.

sagemaker.environment_variables.retrieve_default(region=None, model_id=None, model_version=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, include_aws_sdk_env_vars=True, sagemaker_session=<sagemaker.session.Session object>, instance_type=None, script=JumpStartScriptScope.INFERENCE)

Retrieves the default container environment variables for the model matching the arguments.

  • region (str) – Optional. The AWS Region for which to retrieve the default environment variables. (Default: None).

  • model_id (str) – Optional. The model ID of the model for which to retrieve the default environment variables. (Default: None).

  • model_version (str) – Optional. The version of the model for which to retrieve the default environment variables. (Default: None).

  • tolerate_vulnerable_model (bool) – True if vulnerable versions of model specifications should be tolerated (exception not raised). If False, raises an exception if the script used by this version of the model has dependencies with known security vulnerabilities. (Default: False).

  • tolerate_deprecated_model (bool) – True if deprecated models should be tolerated (exception not raised). False if these models should raise an exception. (Default: False).

  • include_aws_sdk_env_vars (bool) – True if environment variables for low-level AWS API call should be included. The Model class of the SageMaker Python SDK inserts environment variables that would be required when making the low-level AWS API call. (Default: True).

  • sagemaker_session (sagemaker.session.Session) – A SageMaker Session object, used for SageMaker interactions. If not specified, one is created using the default AWS configuration chain. (Default: sagemaker.jumpstart.constants.DEFAULT_JUMPSTART_SAGEMAKER_SESSION).

  • instance_type (str) – An instance type to optionally supply in order to get environment variables specific for the instance type.

  • script (JumpStartScriptScope) – The JumpStart script for which to retrieve environment variables.


The variables to use for the model.

Return type



ValueError – If the combination of arguments specified is not supported.