Class: Legion::CLI::Llm

Inherits:
Thor
  • Object
show all
Defined in:
lib/legion/cli/llm_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/legion/cli/llm_command.rb', line 10

def self.exit_on_failure?
  true
end

Instance Method Details

#modelsObject



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/legion/cli/llm_command.rb', line 47

def models
  out = formatter
  boot_llm_settings

  data = collect_models
  if options[:json]
    out.json(models: data)
  else
    show_models(out, data)
  end
end

#pingObject



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/legion/cli/llm_command.rb', line 61

def ping
  out = formatter
  boot_llm(out)

  results = ping_all_providers(out)
  if options[:json]
    out.json(results: results)
  else
    show_ping_results(out, results)
  end
end

#providersObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/legion/cli/llm_command.rb', line 34

def providers
  out = formatter
  boot_llm_settings

  data = collect_providers
  if options[:json]
    out.json(providers: data)
  else
    show_providers(out, data)
  end
end

#statusObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/legion/cli/llm_command.rb', line 21

def status
  out = formatter
  boot_llm_settings

  data = collect_status
  if options[:json]
    out.json(data)
  else
    show_status(out, data)
  end
end