Class: Xberg::RerankerModelTypePlugin

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
RerankerModelType
Defined in:
lib/xberg/native.rb

Overview

In-process reranker registered via the plugin system.

The caller registers a RerankerBackend once (e.g. a wrapper around a sentence-transformers cross-encoder or a provider client), then references it by name in config. Xberg calls back into the registered backend — no HuggingFace download, no ONNX Runtime requirement.

When this variant is selected, only max_rerank_duration_secs applies. Model-loading fields (batch_size, cache_dir, show_download_progress, acceleration) are ignored — the host owns the model lifecycle.

See register_reranker_backend.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



670
671
672
# File 'lib/xberg/native.rb', line 670

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object



688
689
690
# File 'lib/xberg/native.rb', line 688

def self.from_hash(hash)
  new(name: hash[:name] || hash["name"])
end

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


680
# File 'lib/xberg/native.rb', line 680

def custom? = false

#llm?Boolean

Returns:

  • (Boolean)


682
# File 'lib/xberg/native.rb', line 682

def llm? = false

#plugin?Boolean

Returns:

  • (Boolean)


684
685
686
# File 'lib/xberg/native.rb', line 684

def plugin? = true
# @param hash [Hash] deserialized from the native extension
# @return [self]

#preset?Boolean

Returns:

  • (Boolean)


678
# File 'lib/xberg/native.rb', line 678

def preset? = false