What Embedding Models Does LM-Kit.NET Support and When Should I Use Them?
TL;DR
LM-Kit.NET supports text embeddings (7 models from 67 MB to 4.7 GB), image embeddings (1 model, 97 MB), and reranking (1 model, 438 MB). Use text embeddings for RAG, semantic search, and classification. Use image embeddings for visual similarity search. Use the reranker to refine initial search results for higher accuracy. For most applications, Gemma Embedding 300M or BGE-M3 offer the best balance of quality and size.
Text Embedding Models
| Model ID | Size | Dimension | Context | Languages | Best For |
|---|---|---|---|---|---|
bge-small |
68 MB | 384 | 512 | English | Lightweight, CPU-friendly, low-latency |
nomic-embed-text |
90 MB | 768 | 2,048 | Multi | Production embeddings with Matryoshka support |
embeddinggemma-300m |
303 MB | 768 | 2,058 | 100+ | Best all-round compact model, Matryoshka support |
bge-m3 |
438 MB | 1024 | 8,192 | 100+ | Multilingual, long context, dense+sparse retrieval |
qwen3-embedding:0.6b |
639 MB | Variable | 32,768 | Multi | Long-context semantic search |
qwen3-embedding:4b |
2.5 GB | Variable | 40,960 | Multi | Mid-size, multilingual, long-context |
qwen3-embedding:8b |
4.7 GB | Variable | 40,960 | Multi | Highest quality, reranking, classification, clustering |
Matryoshka Representation Learning
Models marked with Matryoshka support (Gemma Embedding, Nomic Embed) can truncate their output dimensions (e.g., 768 → 512 → 256 → 128) with minimal quality loss. This lets you trade embedding quality for storage size and search speed.
Image Embedding Model
| Model ID | Size | Dimension | Architecture | Best For |
|---|---|---|---|---|
nomic-embed-vision |
97 MB | 768 | ViT-B/16 | Visual similarity search, multimodal RAG |
Nomic Embed Vision is aligned with Nomic Embed Text, enabling cross-modal search: find images by text description or find text by image similarity.
using LMKit.Model;
using LMKit.Embeddings;
using LM visionModel = LM.LoadFromModelID("nomic-embed-vision");
var embedder = new Embedder(visionModel);
// Get image embedding
float[] imageVector = embedder.GetEmbeddings(new ImageBuffer("product-photo.jpg"));
// Compare with text embedding (using nomic-embed-text)
float[] textVector = textEmbedder.GetEmbeddings("red leather handbag");
float similarity = VectorOperations.CosineSimilarity(imageVector, textVector);
Reranking Model
| Model ID | Size | Context | Languages | Best For |
|---|---|---|---|---|
bge-m3-reranker |
438 MB | 8,192 | 100+ | Refining RAG search results for higher precision |
The reranker scores query-document pairs with a cross-encoder, producing more accurate relevance scores than initial embedding similarity:
using LMKit.Embeddings;
using LM rerankerModel = LM.LoadFromModelID("bge-m3-reranker");
var reranker = new Reranker(rerankerModel);
// Score a single document against a query
float score = reranker.GetScore("What is the return policy?", "Our return policy allows...");
// Rerank a collection with blending (alpha controls mix of original vs reranker scores)
var reranked = reranker.Rerank(query, searchResults, alpha: 0.5f);
Which Model Should I Choose?
| Use Case | Recommended Model | Why |
|---|---|---|
| English-only RAG, limited resources | bge-small |
Smallest, fastest, CPU-friendly |
| General-purpose RAG | embeddinggemma-300m |
Best quality for its size, 100+ languages |
| Multilingual RAG with long documents | bge-m3 |
8K context, 100+ languages, dense+sparse |
| Maximum retrieval quality | qwen3-embedding:8b |
Largest, highest accuracy |
| Image similarity search | nomic-embed-vision |
Only image embedding model |
| Refine search results | bge-m3-reranker |
Cross-encoder reranking |
📚 Related Content
- How do I build a private document Q&A system?: Use embeddings in a RAG pipeline.
- Should I use RAG or fine-tuning for my use case?: When embeddings and RAG are the right approach.
- What vector database options does LM-Kit.NET support?: Where to store your embeddings.
- Build Semantic Search with Embeddings: Step-by-step embedding search guide.