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
<PackageReference Include="Starlings.Models.EmbeddingGemma2.MLNet" Version="0.3.0" />
<PackageVersion Include="Starlings.Models.EmbeddingGemma2.MLNet" Version="0.3.0" />
<PackageReference Include="Starlings.Models.EmbeddingGemma2.MLNet" />
paket add Starlings.Models.EmbeddingGemma2.MLNet --version 0.3.0
#r "nuget: Starlings.Models.EmbeddingGemma2.MLNet, 0.3.0"
#:package Starlings.Models.EmbeddingGemma2.MLNet@0.3.0
#addin nuget:?package=Starlings.Models.EmbeddingGemma2.MLNet&version=0.3.0
#tool nuget:?package=Starlings.Models.EmbeddingGemma2.MLNet&version=0.3.0
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 anintcolumn with each row's token count (special tokens and prompt included).- Prompts are explicit (
Prompt, default none). The dimension comes fromEncoder.Dimension(768, 512, 256 or 128). BatchSizeabove 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 | Versions 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. |
-
net10.0
- Microsoft.ML (>= 5.0.0)
- Starlings.Models.EmbeddingGemma2 (= 0.3.0)
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 |