oumi.cli#
Submodules#
oumi.cli.cli_utils module#
- class oumi.cli.cli_utils.LogLevel(value)[source]#
Bases:
str
,Enum
The available logging levels.
- CRITICAL = 'CRITICAL'#
- DEBUG = 'DEBUG'#
- ERROR = 'ERROR'#
- INFO = 'INFO'#
- WARNING = 'WARNING'#
- oumi.cli.cli_utils.configure_common_env_vars() None [source]#
Sets common environment variables if needed.
- oumi.cli.cli_utils.parse_extra_cli_args(ctx: Context) list[str] [source]#
Parses extra CLI arguments into a list of strings.
- Parameters:
ctx – The Typer context object.
- Returns:
The extra CLI arguments
- Return type:
List[str]
- oumi.cli.cli_utils.resolve_and_fetch_config(config_path: str, output_dir: Path | None = None, force: bool = True) Path [source]#
Resolve oumi:// prefix and fetch config if needed.
- Parameters:
config_path – Original config path that may contain oumi:// prefix
output_dir – Optional override for output directory
force – Whether to overwrite an existing config
- Returns:
Local path to the config file
- Return type:
Path
oumi.cli.distributed_run module#
- oumi.cli.distributed_run.accelerate(ctx: ~typer.models.Context, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Starts accelerate sub-process w/ automatically configured common params.
- Parameters:
ctx – The Typer context object.
level – The logging level for the specified command.
- oumi.cli.distributed_run.torchrun(ctx: ~typer.models.Context, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Starts torchrun sub-process w/ automatically configured common params.
- Parameters:
ctx – The Typer context object.
level – The logging level for the specified command.
oumi.cli.env module#
oumi.cli.evaluate module#
- oumi.cli.evaluate.evaluate(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f6fc10>], level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Evaluate a model.
- Parameters:
ctx – The Typer context object.
config – Path to the configuration file for evaluation.
level – The logging level for the specified command.
oumi.cli.fetch module#
- oumi.cli.fetch.fetch(config_path: ~typing.Annotated[str, <typer.models.ArgumentInfo object at 0x7f22b9f6bfd0>], output_dir: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7f22ba1a2e90>] = None, force: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f22ba3ee010>] = False) None [source]#
Fetch configuration files from GitHub repository.
oumi.cli.infer module#
- oumi.cli.infer.infer(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f68c50>], interactive: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f22b9f69050>] = False, image: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f69390>] = None, system_prompt: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f69690>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Run inference on a model.
If input_filepath is provided in the configuration file, inference will run on those input examples. Otherwise, inference will run interactively with user-provided inputs.
- Parameters:
ctx – The Typer context object.
config – Path to the configuration file for inference.
output_dir – Directory to save configs
~/.oumi/fetch). ((defaults to OUMI_DIR env var or)
interactive – Whether to run in an interactive session.
image – Path to the input image for image+text VLLMs.
system_prompt – System prompt for task-specific instructions.
level – The logging level for the specified command.
oumi.cli.judge module#
- oumi.cli.judge.conversations(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f3a550>], input_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a190>] = None, output_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a110>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Judge a list of conversations.
- oumi.cli.judge.dataset(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f3a910>], dataset_name: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a890>] = None, dataset_subset: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a790>] = None, dataset_split: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a750>] = 'train', output_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a610>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Judge a dataset.
- oumi.cli.judge.model(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f3a1d0>], inference_config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f3a0d0>], input_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f3a150>] = None, output_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22b9f38050>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Judge the outputs of a model on a dataset.
oumi.cli.launch module#
- oumi.cli.launch.cancel(cloud: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22bcdd4750>], cluster: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22bcdd47d0>], id: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22bcdd45d0>], level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Cancels a job.
- Parameters:
cloud – Filter results by this cloud.
cluster – Filter results by clusters matching this name.
id – Filter results by jobs matching this job ID.
level – The logging level for the specified command.
- oumi.cli.launch.down(cluster: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22bcdd41d0>], cloud: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22bcdd4c90>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Turns down a cluster.
- Parameters:
cluster – The cluster to turn down.
cloud – If specified, only clusters on this cloud will be affected.
level – The logging level for the specified command.
- oumi.cli.launch.run(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22ba487f50>], cluster: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22ba487750>] = None, detach: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f22ba487950>] = False, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Runs a job on the target cluster.
- Parameters:
ctx – The Typer context object.
config – Path to the configuration file for the job.
cluster – The cluster to use for this job. If no such cluster exists, a new cluster will be created. If unspecified, a new cluster will be created with a unique name.
detach – Run the job in the background.
level – The logging level for the specified command.
- oumi.cli.launch.status(cloud: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22ba484c50>] = None, cluster: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22ba485e50>] = None, id: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22ba487dd0>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Prints the status of jobs launched from Oumi.
Optionally, the caller may specify a job id, cluster, or cloud to further filter results.
- Parameters:
cloud – Filter results by this cloud.
cluster – Filter results by clusters matching this name.
id – Filter results by jobs matching this job ID.
level – The logging level for the specified command.
- oumi.cli.launch.stop(cluster: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22ba485810>], cloud: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22ba4876d0>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None) None [source]#
Stops a cluster.
- Parameters:
cluster – The cluster to stop.
cloud – If specified, only clusters on this cloud will be affected.
level – The logging level for the specified command.
- oumi.cli.launch.up(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22ba4b9610>], cluster: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7f22ba4baa50>] = None, detach: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7f22ba4bb990>] = False, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Launches a job.
- Parameters:
ctx – The Typer context object.
config – Path to the configuration file for the job.
cluster – The cluster to use for this job. If no such cluster exists, a new cluster will be created. If unspecified, a new cluster will be created with a unique name.
detach – Run the job in the background.
level – The logging level for the specified command.
oumi.cli.main module#
oumi.cli.train module#
- oumi.cli.train.train(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7f22b9f08c90>], level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7f22ba2b8490>] = None)[source]#
Train a model.
- Parameters:
ctx – The Typer context object.
config – Path to the configuration file for training.
level – The logging level for the specified command.