net10.0
A lightweight, zero-configuration semantic reranker for .NET. Supports multiple cross-encoder models with automatic download, GPU acceleration, and HuggingFace caching.
Published
Dec 20, 2025
10mo ago
Total Downloads
24.4K
24,402
Install
dotnet add package LMSupply.Reranker --version 0.8.2
| Product | Versions |
|---|---|
| .NET |
README
LMSupply.Reranker
Local semantic reranking for .NET with cross-encoder models.
Features
- Zero-config: Models download automatically from HuggingFace
- GPU Acceleration: CUDA, DirectML (Windows), CoreML (macOS)
- Cross-platform: Windows, Linux, macOS
- RAG Integration: Perfect for improving retrieval quality
Quick Start
using LMSupply.Reranker;
// Load the default model
await using var reranker = await LocalReranker.LoadAsync("default");
// Rerank documents
var results = await reranker.RerankAsync(
query: "What is machine learning?",
documents: ["ML is a branch of AI...", "The weather is nice..."],
topK: 5);
foreach (var result in results)
Console.WriteLine($"{result.Index}: {result.Score:F3}");
Available Models
| Alias | Model | Size | Description |
|---|---|---|---|
default |
MS MARCO MiniLM L6 | ~90MB | Best speed/quality balance |
fast |
MS MARCO TinyBERT | ~18MB | Ultra-fast, latency-critical |
quality |
BGE Reranker Base | ~440MB | Higher accuracy, multilingual |
large |
BGE Reranker Large | ~1.1GB | Highest accuracy |
multilingual |
BGE Reranker v2-m3 | ~1.1GB | 8K context, 100+ languages |
GPU Acceleration
# NVIDIA GPU
dotnet add package Microsoft.ML.OnnxRuntime.Gpu
# Windows (AMD/Intel/NVIDIA)
dotnet add package Microsoft.ML.OnnxRuntime.DirectML
Changes from Previous Version
No structural changes between v0.8.1 and v0.8.2.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.