quickstart.platform_config#

Platform configuration for the nmp-api container.

Module Contents#

Classes#

PlatformConfig

Platform configuration passed to the nmp-api container.

API#

class quickstart.platform_config.PlatformConfig(/, **data: typing.Any)#

Bases: pydantic.BaseModel

Platform configuration passed to the nmp-api container.

This configuration can be passed to the container either via: 1. Environment variables (via to_env_vars()) 2. Mounted YAML file at /etc/nmp/platform-config.yaml

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod get_default() typing_extensions.Self#

Return default platform configuration.

classmethod load(path: pathlib.Path) typing_extensions.Self#

Load platform config from YAML file.

Parameters:

path – Path to the YAML configuration file.

Returns:

PlatformConfig instance.

Raises:
  • FileNotFoundError – If the config file doesn’t exist.

  • ValueError – If the YAML is invalid.

nvidia_api_key: str | None#

‘Field(…)’

save(path: pathlib.Path) None#

Save platform config to YAML file.

Parameters:

path – Path to save the configuration.

to_env_vars() dict[str, str]#

Convert config to environment variables for the container.

Returns:

Dictionary of environment variable name to value.