Starlings.Models.EmbeddingGemma2.MLNet 0.1.0-preview.6

This is a prerelease version of Starlings.Models.EmbeddingGemma2.MLNet.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Starlings.Models.EmbeddingGemma2.MLNet --version 0.1.0-preview.6
                    
NuGet\Install-Package Starlings.Models.EmbeddingGemma2.MLNet -Version 0.1.0-preview.6
                    
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.1.0-preview.6" />
                    
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.1.0-preview.6" />
                    
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.1.0-preview.6
                    
#r "nuget: Starlings.Models.EmbeddingGemma2.MLNet, 0.1.0-preview.6"
                    
#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.1.0-preview.6
                    
#: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.1.0-preview.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Starlings.Models.EmbeddingGemma2.MLNet&version=0.1.0-preview.6&prerelease
                    
Install as a Cake Tool

Starlings.Models.EmbeddingGemma2.MLNet

Preview. Experimental, 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.

Install

dotnet add package Starlings.Models.EmbeddingGemma2.MLNet --prerelease
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.
  • 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: Linux x64 CPU experimental; over a CUDA session untested.

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.5.0 101 11/3/2026
0.4.0 88 11/3/2026
0.3.0 125 10/19/2026
0.2.0 123 10/17/2026
0.1.0-preview.6 72 10/14/2026