nemo_gym
nemo_gym
Subpackages
Submodules
nemo_gym.agent_registrynemo_gym.anthropic_converternemo_gym.anthropic_utilsnemo_gym.base_resources_servernemo_gym.base_responses_api_agentnemo_gym.base_responses_api_modelnemo_gym.benchmarksnemo_gym.cli_setup_commandnemo_gym.config_typesnemo_gym.dataset_orchestratornemo_gym.discoverynemo_gym.gitlab_utilsnemo_gym.global_confignemo_gym.hf_utilsnemo_gym.mcp_auto_exposurenemo_gym.model_registrynemo_gym.openai_utilsnemo_gym.package_infonemo_gym.profilingnemo_gym.promptnemo_gym.registrynemo_gym.resources_server_registrynemo_gym.responses_converternemo_gym.responses_streamingnemo_gym.reward_profilenemo_gym.rollout_collectionnemo_gym.server_metadatanemo_gym.server_statusnemo_gym.server_utilsnemo_gym.skillsnemo_gym.train_data_utils
Package Contents
Functions
Data
NEMO_GYM_EXTRA_ROOTS_ENV_VAR_NAME
API
Put the artifact roots on sys.path so plugin modules (e.g. a benchmark’s prepare.py) import.
Extra roots go to the front and cwd/PARENT_DIR (the built-ins) to the end, so import precedence
matches file resolution under :func:component_search_roots (a plugin shadows a same-named Gym module).
Idempotent; reads NEMO_GYM_EXTRA_ROOTS at call time, so it can be re-run after --search-dir folds
roots into the env (see nemo_gym.cli.main).
Resolve a possibly-relative path for reading a built-in or user-supplied file against the ordered
:func:component_search_roots.
Absolute paths are returned unchanged. A relative path is returned rooted at the first root where it
exists (earliest-wins: extra roots > cwd > install root), so a repo-relative path like
benchmarks/<name>/config.yaml or resources_servers/<env>/data/example.jsonl resolves by name
from any cwd or plugin root. validator overrides the default Path.exists check — pass it when a
candidate is valid only if specific markers are present (e.g. a server dir must ship
requirements.txt or pyproject.toml). If nothing matches, the path under the highest-priority
root is returned so error messages point at the user’s own location.
Use this for read paths only — never for write targets (e.g. metrics written next to a dataset), which must stay relative to the user’s writable cwd rather than the install root.
Ordered, de-duplicated roots to look for a Gym component/artifact under: the NEMO_GYM_EXTRA_ROOTS
roots first, then cwd and the install root (PARENT_DIR, the built-ins) last.
Earlier roots win on a name collision, so user components shadow built-ins. De-duplicated by resolved
path, since cwd/install root coincide in an editable checkout. The single source of truth for where Gym
looks for components — used by path resolution (:func:_resolve_under_cwd_or_install), module imports
(:func:_augment_sys_path) and the gym list/gym search discovery functions.
sys_path weaves existing sys.path entries in for import precedence: they slot in after the extra
roots but before cwd/built-ins. Any entry that is itself cwd or the install root is dropped so those two
always stay last — matching the file-lookup order even in a wheel install, where the install root is
already on sys.path as site-packages.