Class: LLMExperiment::CLI::StatusCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/llm_experiment/cli/status_command.rb

Constant Summary collapse

NAME =
"status"
SUMMARY =
"grid completion: which cells have results"

Instance Method Summary collapse

Methods inherited from Command

#call, #initialize, summary

Constructor Details

This class inherits a constructor from LLMExperiment::CLI::Command

Instance Method Details

#add_options(parser) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/llm_experiment/cli/status_command.rb', line 9

def add_options(parser)
  parser.banner = <<~BANNER
    Usage: llmx status [options]

    One row per task, one column per agent x condition. A cell reads `done`
    once it has a run that got as far as writing meta.json.

    Trials run one at a time, on purpose: two at once share the machine and
    contaminate wall_seconds. Expect the grid to take as long as the sum of
    its cells, and resume it with `llmx run --all` whenever it is interrupted.

  BANNER
  parser.on("--app KEY", "only this app's tasks") { |v| @app = v }
  parser.on("--task ID", "only this task") { |v| @task = v }
  parser.on("--agent NAME", "only this agent") { |v| @agent = v }
end

#run(_argv) ⇒ Object



26
27
28
29
30
31
# File 'lib/llm_experiment/cli/status_command.rb', line 26

def run(_argv)
  cells = Grid.new(experiment: experiment)
              .status(app: @app, task: @task, agent: @agent)
  print_table(cells)
  print_totals(cells)
end