Starlings.Models.EmbeddingGemma2.MLNet 0.3.0

dotnet add package Starlings.Models.EmbeddingGemma2.MLNet --version 0.3.0
                    
NuGet\Install-Package Starlings.Models.EmbeddingGemma2.MLNet -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.EmbeddingGemma2.MLNet" 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.EmbeddingGemma2.MLNet" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Starlings.Models.EmbeddingGemma2.MLNet" />
                    
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.EmbeddingGemma2.MLNet --version 0.3.0
                    
#r "nuget: Starlings.Models.EmbeddingGemma2.MLNet, 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.EmbeddingGemma2.MLNet@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.EmbeddingGemma2.MLNet&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Starlings.Models.EmbeddingGemma2.MLNet&version=0.3.0
                    
Install as a Cake Tool

Starlings.Models.EmbeddingGemma2.MLNet

Text only. An ML.NET estimator and transformer that turn a text column into an EmbeddingGemma 2 embedding column (Vector<Single, 768>, or a Matryoshka size of 512, 256 or 128, L2-normalized) with the embedder in Starlings.Models.EmbeddingGemma2. 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
embeddinggemma-2/onnx-fp32-cpu stable linux-x64 cpu: supported; windows-x64 cpu: experimental
embeddinggemma-2/onnx-fp32-cuda stable linux-x64 cuda: supported; windows-x64 cuda: untested

Install

dotnet add package Starlings.Models.EmbeddingGemma2.MLNet
dotnet add package Microsoft.ML.OnnxRuntime --version 1.30.0          # or Microsoft.ML.OnnxRuntime.Gpu.Linux; exactly one

Use

using Starlings.Models.EmbeddingGemma2;
using Starlings.Models.EmbeddingGemma2.MLNet;
using Microsoft.ML;

var ml = new MLContext();
var files = EmbeddingGemma2ModelAssets.OpenLocal();      // offline, verified
// The pinned graph plus the owned tokenizer (Starlings.Tokenizers, profile gemma-bpe-embeddinggemma2).
using var transformer = ml.Transforms.ApplyEmbeddingGemma2Embedding(files, "Embedding", "Text",
        new EmbeddingGemma2EmbeddingOptions { Prompt = EmbeddingGemma2Prompt.Document, BatchSize = 8 })
    .Fit(data);
IDataView embedded = transformer.Transform(data);
  • One inference per row, on the first output getter call; rows never read are never embedded.
  • TokenCountColumnName (default none) adds an int column with each row's token count (special tokens and prompt included).
  • Prompts are explicit (Prompt, default none). The dimension comes from Encoder.Dimension (768, 512, 256 or 128).
  • BatchSize above 1 batches sequential, unshuffled cursors with a look-ahead cursor; row ids are checked.
  • Saving the transformer throws (mlnet.persistence: unsupported); cursors take no cancellation token.

Status: supported on the Stable embeddinggemma-2/onnx-fp32-cpu profile (Linux x64 CPU; G7 passed; the contract is in the Starlings.Models.EmbeddingGemma2 README); supported over a CUDA session on the Stable embeddinggemma-2/onnx-fp32-cuda profile (Linux x64, RTX 3090; document rows within the CUDA profile's bound, rerun by the per-release GPU regression); Native AOT unsupported (Microsoft.ML).

License and usage policy

The package is MIT OR Apache-2.0. The model weights and Starling's ONNX graph derived from them are Apache-2.0 (Google DeepMind). The model card states:

Deployments must adhere to the Gemma Prohibited Use Policy.

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 89 10/19/2026
0.2.0 90 10/17/2026
0.1.0-preview.6 55 10/14/2026