Skip to content

config

config

ApiConfigModel

Bases: BaseModel

HOST class-attribute instance-attribute

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

ZLIB class-attribute instance-attribute

ZLIB: bool = True

APIKEY class-attribute instance-attribute

APIKEY: Optional[str] = None

AppConfigModel

Bases: BaseModel

REMOTE_LOGGING: Whether to enable remote logging updates for remote NDIF. PYMOUNT: Whether to enable pymount. This allows calling .save() on values in a trace. If False, use nnsight.save() instead. Pymounting has some performance cost. DEBUG: Whether to enable debug mode. Errors within a trace will include inner nnsight stack traces. CACHE_DIR: The directory to cache the model. CROSS_INVOKER: Whether to enable cross-invoker. This allows you to refernce variable directly from one invoker to another. This has some performance cost.

REMOTE_LOGGING class-attribute instance-attribute

REMOTE_LOGGING: bool = True

PYMOUNT class-attribute instance-attribute

PYMOUNT: bool = True

DEBUG class-attribute instance-attribute

DEBUG: bool = True

CACHE_DIR class-attribute instance-attribute

CACHE_DIR: str = '~/.cache/nnsight/'

CROSS_INVOKER class-attribute instance-attribute

CROSS_INVOKER: bool = True

TRACE_CACHING class-attribute instance-attribute

TRACE_CACHING: bool = False

ConfigModel

Bases: BaseModel

API class-attribute instance-attribute

APP class-attribute instance-attribute

load classmethod

load(path: str) -> ConfigModel

Load config from YAML file, then apply environment overrides.

from_env

from_env() -> None

Override config values from environment variables or Colab userdata.

set_default_api_key

set_default_api_key(apikey: str)

set_default_app_debug

set_default_app_debug(debug: bool)

save

save()