Module: Legion::Extensions::Llm::Vllm::Runners::FleetWorker
- Includes:
- Helpers::Lex
- Defined in:
- lib/legion/extensions/llm/vllm/runners/fleet_worker.rb
Overview
Runner entrypoint for vLLM fleet request execution. Delegates to the shared ProviderResponder with exact-offering registry support for SSOT v3 execution contracts.
include Legion::Extensions::Helpers::Lex injects module-level
log/handle_exception/settings (the Lex self-extend hook makes
the module's instance methods callable on the module itself),
replacing the fragile module_function + extend double-wiring.
Instance Method Summary collapse
-
#handle_fleet_request(**message) ⇒ Object
The Subscription dispatch path calls
runner_class.send('handle_fleet_request', **message)wheremessageis the delivered envelope (symbol keys) plus AMQP metadata. - #payload_field(payload, key) ⇒ Object
Instance Method Details
#handle_fleet_request(**message) ⇒ Object
The Subscription dispatch path calls
runner_class.send('handle_fleet_request', **message) where
message is the delivered envelope (symbol keys) plus AMQP
metadata. For non-JSON deliveries the raw payload arrives under
:value. delivery/properties are transport handles the
Subscription base already acks/rejects on, forwarded only when
a direct caller supplies them.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/legion/extensions/llm/vllm/runners/fleet_worker.rb', line 30 def handle_fleet_request(**) delivery = [:delivery] properties = [:properties] payload = .key?(:value) ? [:value] : .except(:delivery, :properties) log.debug do "handling vLLM fleet request request_id=#{payload_field(payload, :request_id).inspect} " \ "provider_instance=#{payload_field(payload, :provider_instance).inspect} " \ "operation=#{payload_field(payload, :operation).inspect}" end Legion::Extensions::Llm::Fleet::ProviderResponder.call( payload: payload, provider_family: Vllm::PROVIDER_FAMILY, provider_class: Vllm::Provider, provider_instances: -> { Vllm.discover_instances }, registry: Legion::Extensions::Llm::Inventory::Registry, delivery: delivery, properties: properties ) end |
#payload_field(payload, key) ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/legion/extensions/llm/vllm/runners/fleet_worker.rb', line 51 def payload_field(payload, key) return unless payload.respond_to?(:[]) payload[key] || payload[key.to_s] rescue StandardError => e handle_exception(e, level: :warn, handled: true, operation: 'vllm.fleet_worker.payload_field', field: key) nil end |