LocalAI.Text.Core 0.7.2

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

LocalAI.Text.Core

Core text processing infrastructure for LocalAI packages.

Overview

This package provides centralized tokenization and text processing utilities used by LocalAI packages that work with text data (Embedder, Reranker, Translator, etc.).

Features

  • Tokenizer Factory: Creates tokenizers from model directories
  • Multiple Tokenizer Types: WordPiece, BPE, SentencePiece support
  • Vocabulary Loading: JSON and TXT format support
  • Batch Encoding: Efficient batch processing with padding

Usage

This is an infrastructure package typically used internally by other LocalAI packages.

using LocalAI.Text;

// Create a tokenizer from model directory
var tokenizer = TokenizerFactory.CreateFromModelDirectory(modelPath);

// Encode text
var encoded = tokenizer.Encode("Hello, world!");
Console.WriteLine($"Tokens: {encoded.InputIds.Length}");

// Decode tokens
var decoded = tokenizer.Decode(encoded.InputIds, skipSpecialTokens: true);

Supported Tokenizers

Type Format Models
WordPiece tokenizer.json, vocab.txt BERT, BGE
BPE tokenizer.json, vocab.json GPT-2, RoBERTa
SentencePiece tokenizer.model XLM-R, mBART
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 (3)

Showing the top 3 NuGet packages that depend on LocalAI.Text.Core:

Package Downloads
LocalAI.Embedder

A simple .NET library for local text embeddings with automatic model downloading from HuggingFace. Supports CUDA, DirectML, and CoreML GPU acceleration.

LocalAI.Reranker

A lightweight, zero-configuration semantic reranker for .NET. Supports multiple cross-encoder models with automatic download, GPU acceleration, and HuggingFace caching.

LocalAI.Translator

A lightweight, zero-configuration neural machine translator for .NET. Supports OPUS-MT models for high-quality bilingual translation. Start small. Download what you need. Run locally.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.2 200 12/15/2025
0.7.1 127 12/15/2025
0.7.0 286 12/14/2025
0.6.0 83 12/14/2025