maxent_grpo.training.cli

Training-specific CLI helpers (TRL argument parsing, etc.).

maxent_grpo.training.cli.parse_grpo_args(recipe_path=None)[source]

Parse GRPO CLI arguments or load them from a YAML recipe.

When recipe_path (or $GRPO_RECIPE) is provided, the YAML is loaded via OmegaConf and converted into config dataclasses so orchestration code remains recipe-agnostic.

Parameters:

recipe_path (str | None) – Optional explicit path to a GRPO recipe YAML file. When omitted the function looks for $GRPO_RECIPE or --config.

Returns:

Tuple of (script_args, training_args, model_args).

Return type:

tuple[GRPOScriptArguments, GRPOConfig, ModelConfig]

Raises:
  • ImportError – If TRL is not installed and no recipe path is provided.

  • ValueError – If a recipe is provided but fails validation.

  • SystemExit – If the underlying CLI parser aborts due to invalid args.

Modules

trl

Copyright 2025 Liv d'Aliberti