lloyal-agents API Reference
    Preparing search index...

    Function createReranker

    • Create a Reranker backed by a dedicated reranking model context

      Loads a separate model (typically a cross-encoder) into its own KV cache and exposes score, tokenizeChunks, and dispose methods. The returned score method yields ScoredResult batches as an async iterable, mapping raw indices back to the original Chunk metadata.

      Parameters

      • modelPath: string

        Absolute path to the reranking model file (GGUF)

      • Optionalopts: { nCtx?: number; nSeqMax?: number }

        Optional context sizing overrides

        • OptionalnCtx?: number

          Context window size for the reranker model (default 4096)

        • OptionalnSeqMax?: number

          Maximum parallel scoring sequences (default 8)

      Returns Promise<Reranker>

      A ready-to-use reranker instance; call dispose() when finished