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



725
726
727
# File 'lib/xberg/native.rb', line 725

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object



744
745
746
# File 'lib/xberg/native.rb', line 744

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

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


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

def custom? = false

#llm?Boolean

Returns:

  • (Boolean)


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

def llm? = false

#plugin?Boolean

Returns:

  • (Boolean)


740
741
742
# File 'lib/xberg/native.rb', line 740

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

#preset?Boolean

Returns:

  • (Boolean)


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

def preset? = false