DiffLibLLM 1.0.1

dotnet add package DiffLibLLM --version 1.0.1
                    
NuGet\Install-Package DiffLibLLM -Version 1.0.1
                    
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="DiffLibLLM" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiffLibLLM" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="DiffLibLLM" />
                    
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 DiffLibLLM --version 1.0.1
                    
#r "nuget: DiffLibLLM, 1.0.1"
                    
#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 DiffLibLLM@1.0.1
                    
#: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=DiffLibLLM&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=DiffLibLLM&version=1.0.1
                    
Install as a Cake Tool

DiffLibLLM

Semantic diff library (using embeddings): Compare texts with their translation.

DiffLibLLM utilizes only the embedding stage characteristic of large language models (LLMs), that is, the vectorization of for example words within a sentence. Vectorization is already part of the semantic aspect of LLMs; it is one of the very first steps in their operation.

Available embedding providers

  • SimpleHashEmbeddingProvider Simple local provider with no external AI dependencies
  • OllamaEmbeddingsProvider local using Ollama server
  • OpenAiEmbeddingsProvider distant using API

Quick start with Ollama

  1. Download an install Ollama.
  2. Download some Ollama embedding models:
ollama pull all-minilm
ollama pull nomic-embed-text
ollama pull mxbai-embed-large
ollama pull embeddinggemma
ollama pull granite-embedding:278m
ollama pull bge-m3
ollama pull qllama/multilingual-e5-base
ollama pull qwen3-embedding:0.6b
ollama pull nomic-embed-text-v2-moe
ollama pull paraphrase-multilingual:278m-mpnet-base-v2-fp16
ollama pull paraphrase-multilingual
ollama pull zylonai/multilingual-e5-large
ollama pull snowflake-arctic-embed2
ollama pull qwen3-embedding
ollama pull ...

Vectorization samples

Vectorization is the step that follows tokenization: words (or word fragments, or even multi-word expressions) are organized within a multidimensional space, which already allows for the calculation of a form of basic semantics. Here is an example: "King - Man + Woman" yields a semantic vector that should be very close to the vector corresponding to the word "Queen".

Here are other samples.

See the samples for some models.

Depending on the model's capabilities, some examples also work in languages ​​other than English—for instance, in French.

The embedding models used in this library are very simple and are not bidirectional: they only allow for the calculation of the vector corresponding to an expression (the final token determined by the tokenization algorithm), without including an index (such as HNSW—Hierarchical Navigable Small World) that aggregates the vectors of all the model's tokens. Such an HNSW index would be useful, for instance, for searching for words with vectors close to another—that is, for finding synonyms. Here, however, one can only calculate the vectors for a set of tokens and rank them by similarity, without being able to discover new synonyms.

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
1.0.1 82 9/4/2026