oumi.cli#

Submodules#

oumi.cli.cli_utils module#

class oumi.cli.cli_utils.LogLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[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.set_log_level(level: LogLevel | None)[source]#

Sets the logging level for the current command.

Parameters:

level (Optional[LogLevel]) – The log level to use.

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 0x7fc3bb636c50>] = 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 0x7fc3bb636c50>] = 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.env.env()[source]#

Prints information about the current environment.

oumi.cli.evaluate module#

oumi.cli.evaluate.evaluate(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb18c790>], level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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.infer module#

oumi.cli.infer.infer(ctx: ~typer.models.Context, config: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb260d90>] = None, interactive: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fc3bb2608d0>] = False, image: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb260550>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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.

  • interactive – Whether to run in an interactive session.

  • image – Path to the input image for image+text VLLMs.

  • 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 0x7fc3bb3cfb10>], input_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cfc10>] = None, output_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cfcd0>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = None)[source]#

Judge a list of conversations.

oumi.cli.judge.dataset(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb3cf790>], dataset_name: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cf850>] = None, dataset_subset: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cf910>] = None, dataset_split: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cf9d0>] = 'train', output_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cfa50>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = None)[source]#

Judge a dataset.

oumi.cli.judge.model(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb3cfd10>], inference_config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb3cfe50>], input_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cff10>] = None, output_file: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb3cff90>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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 0x7fc3bb41b790>], cluster: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb418e90>], id: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb4185d0>], level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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 0x7fc3bb4184d0>], cloud: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb418490>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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 0x7fc3bb4192d0>], cluster: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb4190d0>] = None, detach: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fc3bb42df50>] = False, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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 0x7fc3bb42d610>] = None, cluster: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb42e910>] = None, id: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb42c050>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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 0x7fc3bb666450>], cloud: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb666510>] = None, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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 0x7fc3bb57b110>], cluster: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fc3bb572f90>] = None, detach: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fc3bb167ed0>] = False, level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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.launch.which(level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = None) None[source]#

Prints the available clouds.

oumi.cli.main module#

oumi.cli.main.get_app() Typer[source]#

Create the Typer CLI app.

oumi.cli.main.run()[source]#

The entrypoint for the CLI.

oumi.cli.train module#

oumi.cli.train.train(ctx: ~typer.models.Context, config: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fc3bb21e4d0>], level: ~typing.Annotated[~oumi.cli.cli_utils.LogLevel | None, <typer.models.OptionInfo object at 0x7fc3bb636c50>] = 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.