ElBruno.LocalEmbeddings.Harrier 1.4.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package ElBruno.LocalEmbeddings.Harrier --version 1.4.5
                    
NuGet\Install-Package ElBruno.LocalEmbeddings.Harrier -Version 1.4.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ElBruno.LocalEmbeddings.Harrier" Version="1.4.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ElBruno.LocalEmbeddings.Harrier" Version="1.4.5" />
                    
Directory.Packages.props
<PackageReference Include="ElBruno.LocalEmbeddings.Harrier" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ElBruno.LocalEmbeddings.Harrier --version 1.4.5
                    
#r "nuget: ElBruno.LocalEmbeddings.Harrier, 1.4.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ElBruno.LocalEmbeddings.Harrier@1.4.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ElBruno.LocalEmbeddings.Harrier&version=1.4.5
                    
Install as a Cake Addin
#tool nuget:?package=ElBruno.LocalEmbeddings.Harrier&version=1.4.5
                    
Install as a Cake Tool

ElBruno.LocalEmbeddings.Harrier

High-quality multilingual embeddings using Microsoft Harrier-OSS-v1 locally with ONNX Runtime.

Installation

dotnet add package ElBruno.LocalEmbeddings.Harrier

Quick Start

using ElBruno.LocalEmbeddings.Harrier;

// Create with default settings (downloads INT8 quantized model on first run)
await using var generator = await HarrierEmbeddingGenerator.CreateAsync();

// Generate embeddings
var embeddings = await generator.GenerateAsync(["Hello world!", "Hola mundo!"]);
Console.WriteLine($"Dimensions: {embeddings[0].Vector.Length}"); // 640

Model Details

  • Publisher: Microsoft (MIT license)
  • Architecture: Decoder-only (Gemma 3 based)
  • Parameters: 270M
  • Embedding dimensions: 640
  • Context window: 32,768 tokens
  • Languages: 94+
  • MTEB-v2 ranking: #1
  • Default variant: INT8 Quantized (~270 MB)

Features

  • 🦅 Top-ranked embedding model on MTEB-v2 — best semantic quality
  • 🌍 Multilingual support — 94+ languages
  • 📦 Multiple quantization variants — Choose between quality (FP32/FP16) and speed (INT8/Q4)
  • 🎯 Instruction-tuned — Specify task-specific prefixes for better results
  • 📚 Long context — Supports up to 32,768 tokens
  • ONNX Runtime — Runs locally on CPU, zero external API calls
  • 🔒 Private by default — No data sent to external services

Configuration

var options = new HarrierEmbeddingsOptions
{
    // Model variant (FP32, FP16, Quantized, Q4)
    ModelVariant = HarrierModelVariant.Quantized,
    
    // Instruction prefix for task-specific embeddings
    InstructionPrefix = "Instruct: Retrieve semantically similar text\nQuery: ",
    
    // Token limit
    MaxSequenceLength = 8192,
    
    // Cache and download
    EnsureModelDownloaded = true,
    CacheDirectory = null  // Auto-detect per platform
};

await using var generator = await HarrierEmbeddingGenerator.CreateAsync(options);

Dependency Injection

using ElBruno.LocalEmbeddings.Harrier.Extensions;
using Microsoft.Extensions.AI;

services.AddHarrierEmbeddings(options =>
{
    options.ModelVariant = HarrierModelVariant.Q4;
});

// Resolve as IEmbeddingGenerator<string, Embedding<float>>
var generator = serviceProvider.GetRequiredService<IEmbeddingGenerator<string, Embedding<float>>>();

Learn More

📖 Full Harrier Integration Guide — Instruction prefixes, configuration, troubleshooting, and migration from MiniLM.

🎬 HarrierConsoleApp Sample — Complete working example with 6 progressive scenarios.

License

MIT — See LICENSE

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 34 5/23/2026
1.4.6 107 4/28/2026
1.4.5 94 4/28/2026
1.4.3 135 4/7/2026
1.4.2 101 4/7/2026
1.4.1 98 4/7/2026
1.4.0 105 4/7/2026
1.0.1 35 5/20/2026