Module: Legion::Extensions::Llm::Vllm::Runners::DiscoveryRefresh

Includes:
Helpers::Lex, ClaimActivation, HealthDisplay, Http, InstanceLifecycle, OfferingComparison, Probing, WeightPublication
Defined in:
lib/legion/extensions/llm/vllm/runners/discovery_refresh.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/http.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/probing.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/health_display.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/claim_activation.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/instance_lifecycle.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/weight_publication.rb,
lib/legion/extensions/llm/vllm/runners/discovery_refresh/offering_comparison.rb

Overview

SSOT v3 discovery runner for vLLM. Reads the instance catalog from Vllm.discover_instances, discovers models via /v1/models, probes health via /health, and publishes OfferingDraft snapshots through Inventory::Publisher.

include Legion::Extensions::Helpers::Lex injects the module-level settings/log/handle_exception/cache_* helpers — without this the Every actor's klass.send('refresh') tick cannot resolve settings and every claim/activate/probe silently no-ops.

Per-instance runtime state (publisher token, probe coordinator, callable, sequence, offerings) lives in a process-local Concurrent::Map keyed by instance_id — NEVER in Legion::Settings, which must stay a serializable config tree (a token there leaks a secret and breaks on reload). Only the display-only health and capabilities hashes are written back to settings, after each registry commit (see the HealthDisplay helper).

The behavior is split across mixed-in helper modules (matching the provider.rb helper-module pattern) to keep each file small:

InstanceLifecycle — tick entrypoint, catalog reconcile, removal
ClaimActivation   — publisher, claim, readiness commit
Probing           — tick refresh, cadence/reactive probes
HealthDisplay     — D14 settings health/capabilities writes
Http              — model/health HTTP, instance identity

Defined Under Namespace

Modules: ClaimActivation, HealthDisplay, Http, InstanceLifecycle, OfferingComparison, Probing, WeightPublication

Constant Summary

Constants included from OfferingComparison

OfferingComparison::SCALAR_EVIDENCE_FIELDS

Class Method Summary collapse

Methods included from Http

#check_health, #derive_physical_id, #discovery_programming_error?, #extract_host_port, #fetch_models, #fetch_offerings, #normalize_api_base, #readiness_failure

Methods included from HealthDisplay

#clear_settings_health, #union_capabilities, #write_instance_health

Methods included from Probing

#build_probe_enqueue, #handle_reactive_probe, #refresh_instance, #replace_if_changed, #run_cadence_probe

Methods included from ClaimActivation

#claim_and_activate_instance, #perform_readiness, #publisher, #report_probe_result, #report_tracked_readiness, #tracked_unpublished?

Methods included from InstanceLifecycle

#physical_id_changed?, #reconcile_instances, #refresh, #remove_all_instances, #remove_instance_state, #update_instance

Methods included from WeightPublication

#activate_tracked_state, #activate_weight_snapshot, #dormant_weight_tracker, #observe_dormant_weights, #reconcile_weight_snapshot, #replace_weight_snapshot, #state_mutex

Methods included from OfferingComparison

#offerings_equivalent?

Class Method Details

.instance_statesObject



62
63
64
# File 'lib/legion/extensions/llm/vllm/runners/discovery_refresh.rb', line 62

def self.instance_states
  @instance_states
end

.reset_instance_states!Object



66
67
68
69
70
71
# File 'lib/legion/extensions/llm/vllm/runners/discovery_refresh.rb', line 66

def self.reset_instance_states!
  state_mutex.synchronize do
    @instance_states.clear
    dormant_weight_tracker.clear!
  end
end