Class: Legion::Extensions::Llm::Vllm::Actor::FleetWorker

Inherits:
Actors::Subscription
  • Object
show all
Includes:
Helpers::Lex
Defined in:
lib/legion/extensions/llm/vllm/actors/fleet_worker.rb

Overview

Subscription actor for vLLM fleet request consumption.

runner_class resolves to the concrete runner MODULE (not a String) because the Subscription dispatch path with use_runner? = false calls runner_class.send(fn, **message) directly — a String cannot be send-ed. The runner's handle_fleet_request(**message) accepts the delivered envelope as keyword arguments.

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


44
45
46
47
48
49
50
51
52
# File 'lib/legion/extensions/llm/vllm/actors/fleet_worker.rb', line 44

def enabled?
  instances = Vllm.discover_instances
  enabled = Legion::Extensions::Llm::Fleet::ProviderResponder.enabled_for?(instances)
  log.debug { "vLLM fleet worker enablement: enabled=#{enabled}, instance_count=#{instances.size}" }
  enabled
rescue StandardError => e
  handle_exception(e, level: :warn, handled: true, operation: 'vllm.fleet_worker.enabled')
  false
end

#runner_classObject



32
33
34
# File 'lib/legion/extensions/llm/vllm/actors/fleet_worker.rb', line 32

def runner_class
  Legion::Extensions::Llm::Vllm::Runners::FleetWorker
end

#runner_functionObject



36
37
38
# File 'lib/legion/extensions/llm/vllm/actors/fleet_worker.rb', line 36

def runner_function
  'handle_fleet_request'
end

#use_runner?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/legion/extensions/llm/vllm/actors/fleet_worker.rb', line 40

def use_runner?
  false
end