Expand description
Port of lib/ruby_llm/rerank.rb (RubyLLM.rerank), Protocol#rerank, and
lib/ruby_llm/protocols/chat_completions/rerank.rb, the Jina-style endpoint OpenRouter and
GPUStack serve. Cohere’s and Bedrock’s rerank protocols belong to providers RustLLM does not port.
rerank = RubyLLM.rerank("what is ruby", docs, model: "voyageai/rerank-2.5-lite", provider: :openrouter)
rerank.results.first.document # => "Ruby is a programming language"Structs§
- Rerank
- Documents ordered by relevance to a query (
RubyLLM::Rerank). - Rerank
Options - Options for
rerank, the keyword arguments ofRerank.rerank. - Rerank
Result - One reranked document (
RubyLLM::Rerank::Result).
Functions§
- rerank
RubyLLM.rerank(query, documents, model:, provider:, top_n:, provider_options:, metadata:), inside arerank.rust_llmevent.modelis required: rerank catalogs are provider-specific.