Skip to content

config

config

CONFIG module-attribute

CONFIG = Config.load()

ApiConfig

Bases: BaseModel

Settings for talking to the NDIF service (CONFIG.API).

HOST class-attribute instance-attribute

HOST: str = 'https://api.ndif.us'

APIKEY class-attribute instance-attribute

APIKEY: Optional[str] = None

COMPRESS class-attribute instance-attribute

COMPRESS: bool = True

AppConfig

Bases: BaseModel

Client-side behavior settings (CONFIG.APP).

DEBUG class-attribute instance-attribute

DEBUG: bool = False

REMOTE_LOGGING class-attribute instance-attribute

REMOTE_LOGGING: bool = True

PYMOUNT class-attribute instance-attribute

PYMOUNT: bool = True

DISABLE_CPP_BACKTRACE class-attribute instance-attribute

DISABLE_CPP_BACKTRACE: bool = True

Config

Bases: BaseModel

The nnsight config, exposed as the module-level singleton CONFIG.

Loaded once at import with the precedence shipped defaults < user config file < environment. The user file lives at $XDG_CONFIG_HOME/nnsight/config.yaml (or NNSIGHT_CONFIG if set); save writes the current values back to it. Environment overrides: NDIF_HOST, NDIF_API_KEY, NNSIGHT_DEBUG.

API class-attribute instance-attribute

APP class-attribute instance-attribute

load classmethod

load() -> Config

save

save() -> None

Persist the current config to the user config file (created if needed).

set_default_api_key

set_default_api_key(api_key: str) -> None

Set the NDIF API key and persist it to the user config file.