ChromaDotNet.Embeddings
The default embedding function of Chroma for .NET: all-MiniLM-L6-v2 in ONNX, with the same vectors as the Python client. An IEmbeddingGenerator of Microsoft.Extensions.AI, for ChromaDotNet.Client.
- Latest release 1.0.0-preview.3
- NuGet
- GitHub
- Documentation
- Try it in your browser
Install
dotnet add package ChromaDotNet.Embeddings --prerelease Example
Start Chroma, for example with Docker:
docker run -p 8000:8000 chromadb/chroma:1.5.9 Then add three records by their text and query them with a sentence:
using ChromaDB.Client;
using ChromaDB.Client.Models;
using ChromaDotNet.Embeddings;
using var embeddings = await ChromaDefaultEmbeddingGenerator.CreateAsync();
using var client = new ChromaClient("http://localhost:8000");
var collection = await client.GetOrCreateCollectionAsync(
new ChromaCollectionDefinition("fruits") { EmbeddingGenerator = embeddings });
var fruits = client.GetCollectionClient(collection).WithEmbeddingGenerator(embeddings);
await fruits.AddAsync(["apple", "lemon", "banana"],
documents: ["A crunchy apple", "A sour lemon", "A sweet banana"]);
var results = await fruits.QueryAsync("something sour", nResults: 1,
include: ChromaQueryInclude.Documents | ChromaQueryInclude.Distances);
foreach (var result in results)
Console.WriteLine($"{result.Id}: {result.Document} ({result.Distance})");Tested on 25 October 2026 with ChromaDotNet.Embeddings 1.0.0-preview.3 and ChromaDotNet.Client 2.18.0 on Chroma 1.5.9: the nearest record to “something sour” is the lemon.
The first start downloads the model, 83 MB, into the cache folder of Python, and checks it with its SHA-256.
Platforms
Windows x64 and arm64, Linux x64 and arm64, and macOS arm64 on .NET 8 and later; .NET Framework 4.6.2 and later on Windows, in a 64-bit process. Intel Macs and 32-bit processes are not supported.
On .NET 8 and later it runs through ElBruno.LocalEmbeddings by Bruno Capuano; on .NET Framework, on ONNX Runtime. Tokenizer: Hugging Face, through Tokenizers.DotNet.