Starlings.Models.E5.Extensions.AI 0.3.0

dotnet add package Starlings.Models.E5.Extensions.AI --version 0.3.0
                    
NuGet\Install-Package Starlings.Models.E5.Extensions.AI -Version 0.3.0
                    
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="Starlings.Models.E5.Extensions.AI" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Starlings.Models.E5.Extensions.AI" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Starlings.Models.E5.Extensions.AI" />
                    
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 Starlings.Models.E5.Extensions.AI --version 0.3.0
                    
#r "nuget: Starlings.Models.E5.Extensions.AI, 0.3.0"
                    
#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 Starlings.Models.E5.Extensions.AI@0.3.0
                    
#: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=Starlings.Models.E5.Extensions.AI&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Starlings.Models.E5.Extensions.AI&version=0.3.0
                    
Install as a Cake Tool

Starlings.Models.E5.Extensions.AI

Microsoft.Extensions.AI IEmbeddingGenerator<string, Embedding<float>> over the multilingual-e5-small embedder in Starlings.Models.E5: the same tokenizer, encoder and numbers, usable with Microsoft.Extensions.AI middleware and dependency injection. The API may still change.

Maturity

Maturity is per profile, generated from the registry manifests by model-pipeline catalog (do not edit this table by hand). Gates, evidence and capabilities per profile: the model catalog.

Profile Maturity Platforms
multilingual-e5-small/onnx-fp32-cpu stable linux-x64 cpu: supported; windows-x64 cpu: experimental
multilingual-e5-small/onnx-fp32-cuda stable linux-x64 cuda: supported; windows-x64 cuda: untested

Install

dotnet add package Starlings.Models.E5.Extensions.AI
dotnet add package Microsoft.ML.OnnxRuntime --version 1.30.0          # or Microsoft.ML.OnnxRuntime.Gpu.Linux; exactly one

Use

using Starlings.Models.E5;
using Starlings.Models.E5.Extensions.AI;
using Microsoft.Extensions.AI;

await E5ModelAssets.DownloadAsync();                 // explicit acquisition, once
E5ModelFiles files = E5ModelAssets.OpenLocal();      // offline

using IEmbeddingGenerator<string, Embedding<float>> generator = E5EmbeddingGenerator.Create(files,
    new E5EmbeddingGeneratorOptions { InputType = E5InputType.Query });   // adds "query: "; the default adds nothing
var embeddings = await generator.GenerateAsync(["how much protein should a female eat"]);

// Or with DI: services.AddE5EmbeddingGenerator(files);
  • Prefixes are explicit: E5InputType.Query or Passage per generator, or per request with AdditionalProperties["e5_input_type"].
  • GenerateAsync runs synchronously on the calling thread and returns a completed task; failures and cancellation are reported through that task, never thrown synchronously.
  • Unsupported options (Dimensions other than 384, another ModelId, a RawRepresentationFactory, unknown additional properties) fail with NotSupportedException instead of being ignored.

Micro-batching (experimental, opt-in)

var generator = E5EmbeddingGenerator.Create(files, new E5EmbeddingGeneratorOptions
{
    MicroBatching = new() { MaxRows = 8, MaxWait = TimeSpan.FromMilliseconds(2) },   // null (default): off
});

With MicroBatching set, a GenerateAsync call with exactly one value is tokenized and validated on the calling thread (an invalid value fails only its own call), then queued; one dispatcher thread embeds the queued values of concurrent callers in padded batches of at most MaxRows values and MaxTokens padded token cells, dispatched when full or when the oldest has waited MaxWait (default zero: no added latency, a batch holds what queued while the previous one ran). Outputs then depend on the concurrent traffic: equal to a single call within the profile's padded-batch tolerance, not bit for bit reproducible. Calls with several values run as one explicit batch, as without the option. Cancelling a queued call removes it; cancelling a dispatched one cancels only that caller's task (the batch keeps running for the others). A full queue (QueueCapacity) makes callers wait for a slot. Dispose faults queued calls with ObjectDisposedException and waits for a running batch. MicroBatchingStatistics reports batches, items, padding and queue and run time. Status: experimental (capability extensions_ai.micro_batching): weight-free tests and one real-model test within the padded-batch tolerance on Linux x64 CPU; no benchmark adoption decision, no CUDA run and no soak yet.

Status: supported on the Stable e5 onnx-fp32-cpu profile (Linux x64 CPU; G7 passed; the contract is in the Starlings.Models.E5 README); supported over a CUDA session on the Stable onnx-fp32-cuda profile (Linux x64, RTX 3090; 46 protected texts within the CUDA profile's bound, rerun by the per-release GPU regression; the contract is the README's "Stable contract: CUDA"). See the 0.2.0 release notes.

Product Compatible and additional computed target framework versions.
.NET 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
0.3.0 101 10/19/2026
0.2.0 133 10/17/2026
0.1.0-preview.6 93 10/14/2026