caikit

CAIKit is an AI toolkit that enables AI users to consume stable task-specific model APIs while enabling AI developers build algorithms and models in a modular/composable framework.

Subpackages

Submodules

Package Contents

Functions

configure([config_yml_path, config_dict])

Configure caikit for your usage!

get_config(→ aconfig.Config)

Get the caikit configuration

module([id, name, version, task, tasks, backend_type, ...])

Apply this decorator to any class that should be treated as a caikit module

Attributes

extract

get_model_future

load

resolve_and_load

train

__version__

caikit.configure(config_yml_path: str | None = None, config_dict: Dict[str, Any] | None = None)[source]

Configure caikit for your usage! Merges into the internal aconfig.Config object with overrides from multiple sources.

Sources, last takes precedence:
  1. The existing configuration from calls to caikit.configure()

  2. The config from config_yml_path

  3. The config from config_dict

  4. The config files specified in the config_files configuration

    (NB: This may be set by the CONFIG_FILES environment variable)

  5. Environment variables, in ALL_CAPS_SNAKE_FORMAT

Args:
config_yml_path (Optional[str]): The path to the base configuration yaml

with overrides for your usage.

config_dict (Optional[Dict]): Config overrides in dictionary form

Returns: None: This only sets the config object that is returned by

caikit.get_config()

caikit.get_config() aconfig.Config[source]

Get the caikit configuration

caikit.extract
caikit.get_model_future
caikit.load
caikit.module(id=None, name=None, version=None, task: Type[caikit.core.task.TaskBase] = None, tasks: List[Type[caikit.core.task.TaskBase]] | None = None, backend_type='LOCAL', base_module: str | Type[caikit.core.modules.base.ModuleBase] = None, backend_config_override: Dict | None = None)[source]
Apply this decorator to any class that should be treated as a caikit module

(i.e., extends`{caikit.core.ModuleBase}) and registered with caikit.core so that the library “knows” the class is a caikit module and is capable of loading instances of the module.

Args:
id: str

A UUID to use when registering this module with caikit.core Not required if based on another caikit module using base_module

name: str

A human-readable name for the module Not required if based on another caikit module using base_module

version: str

A SemVer for the module Not required if based on another caikit module using base_module

task: Type[TaskBase]

An ML task class that this module is an implementation for Not required if based on another caikit module using base_module, or if multiple tasks are specified using tasks.

tasks: Optional[List[Type[TaskBase]]

List of ML task classes that this module implements.

backend_type: backend_type

Associated backend type for the module. Default: LOCAL

base_module: str | ModuleBase

If this module is based on a different caikit module, provide name of the base module. Default: None

backend_config_override: Dict

Dictionary containing configuration required for the specific backend. Default: None

Returns:

A decorated version of the class to which it was applied, after registering the class as a valid module with caikit.core

caikit.resolve_and_load
caikit.train
caikit.__version__ = 'unknown'