Solutions · RAG & Knowledge · Embeddings

Embeddings, the foundation of retrieval.

Turn any text passage, image, or document into a dense vector that captures meaning. Embedder is the unified API used by every search, RAG, classification, and clustering workflow in LM-Kit.NET. Runs entirely on-device with any embedding model in the catalog.

Text + image Batch + async Any vector store
Engine

Embedder

One class, one constructor, one method (with overloads).

Helpers

VectorOperations

Cosine, dot, Euclidean similarity plus normalisation utilities.

Output

float[] & float[][]

Plain arrays. Drop directly into any vector store or do raw vector math.

One API, every embedding workflow.

01 · Unified

Text and image, same surface

embeddinggemma-2 takes strings and images alike; any other catalog embedder loads the same way. Same Embedder constructor, same GetEmbeddings call.

02 · Batched

Single text, batches, tokenized input

Overloads accept a single string, an IEnumerable<string>, pre-tokenised arrays, or ImageBuffer sequences for images. Throughput scales linearly with batch size on GPU.

03 · Async-first

GetEmbeddingsAsync + cancellation

Every overload has an async sibling. Pass a CancellationToken, get back a Task. Wire straight into server pipelines without blocking the request thread.

04 · Cross-modal

Text-to-image and image-to-text

embeddinggemma-2 embeds text and images into one space. A text query retrieves images, an image query retrieves passages. One vector store, two modalities.

05 · Multilingual

100+ languages with bge-m3

bge-m3 embeds across 100+ languages in one model. Index in mixed-language corpora, query in any language, retrieve cross-lingually without per-language pipelines.

06 · Plug-in stores

Any vector store, same API

In-memory, FileSystemVectorStore, Qdrant or pgvector via connector, or a custom IVectorStore implementation. float[] in, similarity hits out. No vendor lock-in.

Three patterns, same Embedder.

Single, batch, and cross-modal. Pick a tab for the pattern you need.

The simplest pattern. One model, one call, one vector. The EmbeddingSize property tells you the dimension ahead of time so you can size your vector store correctly.

SingleText.cs
using LMKit.Model;
using LMKit.Embeddings;

var model    = LM.LoadFromModelID("embeddinggemma-2");
var embedder = new Embedder(model);

float[] vec = embedder.GetEmbeddings("Machine learning is fascinating.");
Console.WriteLine($"dimensions: {vec.Length} (matches embedder.EmbeddingSize = {embedder.EmbeddingSize})");

Embedding models in the catalog.

Default · Text + vision

embeddinggemma-2

Google's embedder on Gemma 4: text, code and images in one 768-d space, 100+ languages, 8K context, Matryoshka truncation.

Text

harrier-oss:0.6b

Microsoft's compact multilingual embedder. 1024-dimensional instruction-aware vectors, 32K context, 90+ languages, in a ~360 MB footprint.

Multilingual

bge-m3

100+ languages in one model. Dense AND sparse output (so it can drive lexical-style retrieval too). The default choice for international corpora.

Text

qwen3-embedding:0.6b / 4b / 8b

Qwen3 embedding family across three sizes. Choose based on accuracy / memory trade-off; same API.

Lightweight vision

nomic-embed-vision + nomic-embed-text

A smaller aligned pair: a 97 MB image encoder beside its matching text embedder, for tight memory budgets.

Bring your own

Load any GGUF embedder

If a model is in GGUF format, LM.LoadFromFile handles it. The Embedder wrapper works the same way.

Seven pillars, one foundation.

The seven pillars of LM-Kit.NET, plus the local runtime they share. Highlighted card is where you are now.

The foundation

Every capability above runs on this runtime.

Foundation

Local Inference

The runtime all seven pillars sit on. The LM-Kit.NET NuGet ships the complete inference system: open-weight LLMs, vision-language models, embeddings, on-device speech-to-text, OCR and classifiers, accelerated on CPU, AVX2, CUDA 12/13, Vulkan or Metal. One package, zero cloud calls, predictable latency, full data and technology sovereignty.

Explore the foundation

Vectors, on your hardware.

Start in 5 minutes RAG & Knowledge hub