nemo_gym.model_registry

View as Markdown

Registry of model servers under responses_api_models/<name>/.

Maps each model dir to the config flavors it ships (configs/<flavor>.yaml), so they can be enumerated by the token passed to --model-type (see :attr:ModelEntry.model_types). Reads the directory tree only; never loads a config.

Module Contents

Classes

NameDescription
ModelEntryA discovered model server: its name, group, and config file.

Functions

NameDescription
_discover_models_in_dirMap model name -> :class:ModelEntry for every config flavor under one responses_api_models/ dir.
discover_modelsMap model name -> :class:ModelEntry for every discoverable model server.

Data

MODELS_DIR

MODELS_SUBDIR

MODEL_CONFIGS_SUBDIR

API

class nemo_gym.model_registry.ModelEntry(
name: str,
model_group: str,
config_path: pathlib.Path
)
Dataclass

A discovered model server: its name, group, and config file.

config_path
Path
model_group
str
name
str
nemo_gym.model_registry._discover_models_in_dir(
models_dir: pathlib.Path
) -> typing.Dict[str, nemo_gym.model_registry.ModelEntry]

Map model name -> :class:ModelEntry for every config flavor under one responses_api_models/ dir.

One entry per configs/<flavor>.yaml: <dir> for the flavor named after the model, <dir>/<flavor> for the rest. A config-less dir contributes nothing. Returns an empty dict if the directory is missing.

nemo_gym.model_registry.discover_models() -> typing.Dict[str, nemo_gym.model_registry.ModelEntry]

Map model name -> :class:ModelEntry for every discoverable model server.

Scans the responses_api_models/ subdir of every :func:~nemo_gym.discovery.component_search_roots root (NEMO_GYM_EXTRA_ROOTS + cwd + built-ins), merged so user models shadow same-named built-ins.

nemo_gym.model_registry.MODELS_DIR = PARENT_DIR / MODELS_SUBDIR
nemo_gym.model_registry.MODELS_SUBDIR = 'responses_api_models'
nemo_gym.model_registry.MODEL_CONFIGS_SUBDIR = 'configs'