nnsight.schema#

class nnsight.schema.config.ApiConfigModel(*, HOST: str = 'api.ndif.us', SSL: bool = True, ZLIB: bool = True, APIKEY: str | None = None)[source]#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class nnsight.schema.config.AppConfigModel(*, REMOTE_LOGGING: bool = True, DEBUG: bool = True, CACHE_DIR: str = '~/.cache/nnsight/')[source]#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class nnsight.schema.config.ConfigModel(*, API: ApiConfigModel = ApiConfigModel(HOST='api.ndif.us', SSL=True, ZLIB=True, APIKEY=None), APP: AppConfigModel = AppConfigModel(REMOTE_LOGGING=True, DEBUG=True, CACHE_DIR='~/.cache/nnsight/'))[source]#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class nnsight.schema.request.RequestModel(*, interventions: Callable, tracer: Any)[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'protected_namespaces': ()}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class nnsight.schema.response.ResponseModel(*, id: str, status: JobStatus, description: str | None = '', data: Dict[str, Any] | Any | None = None, session_id: str | None = None)[source]#
class JobStatus(value)[source]#
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'protected_namespaces': ()}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pickle() bytes[source]#

Pickles self and returns bytes.

Returns:

Pickled ResponseModel

Return type:

bytes

classmethod unpickle(data: bytes) ResponseModel[source]#

Loads a ResponseModel from pickled bytes.

Parameters:

data (bytes) – Pickled ResponseModel.

Returns:

Response.

Return type:

ResponseModel