Module: Legion::Extensions::Llm::AutoRegistration

Defined in:
lib/legion/extensions/llm/auto_registration.rb

Overview

Mixin that lex-llm-* provider modules extend to expose shared discovery metadata. Registration into Legion::LLM is owned by legion-llm so loaded providers can be rediscovered after reloads.

Prerequisites on the extending module:

- `PROVIDER_FAMILY` constant (Symbol, e.g. :ollama)
- `provider_class` singleton method returning the Provider subclass

DEPRECATED (Phase 4 removal): discover_instances/provider_aliases are kept for old consumers; no new registration side effect is added here. Migrated provider actors use Inventory::Publisher directly.

Instance Method Summary collapse

Instance Method Details

#discover_instancesObject

Override in each provider. Returns { instance_id => config_hash }.



18
19
20
# File 'lib/legion/extensions/llm/auto_registration.rb', line 18

def discover_instances
  {}
end

#provider_aliasesObject

Optional provider-family aliases that legion-llm should register against the same discovered provider instances.



24
25
26
# File 'lib/legion/extensions/llm/auto_registration.rb', line 24

def provider_aliases
  []
end