Yuniko.Software.Qwen3Tokenizer 0.1.2-preview

This is a prerelease version of Yuniko.Software.Qwen3Tokenizer.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Yuniko.Software.Qwen3Tokenizer --version 0.1.2-preview
                    
NuGet\Install-Package Yuniko.Software.Qwen3Tokenizer -Version 0.1.2-preview
                    
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="Yuniko.Software.Qwen3Tokenizer" Version="0.1.2-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yuniko.Software.Qwen3Tokenizer" Version="0.1.2-preview" />
                    
Directory.Packages.props
<PackageReference Include="Yuniko.Software.Qwen3Tokenizer" />
                    
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 Yuniko.Software.Qwen3Tokenizer --version 0.1.2-preview
                    
#r "nuget: Yuniko.Software.Qwen3Tokenizer, 0.1.2-preview"
                    
#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 Yuniko.Software.Qwen3Tokenizer@0.1.2-preview
                    
#: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=Yuniko.Software.Qwen3Tokenizer&version=0.1.2-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Yuniko.Software.Qwen3Tokenizer&version=0.1.2-preview&prerelease
                    
Install as a Cake Tool

Yuniko.Software.Qwen3Tokenizer

⚠️ Preview Release: This package is currently in preview as it depends on Microsoft.ML.Tokenizers (preview). It's ready for production use, but the preview tag will remain until dependencies stabilize.

Native .NET tokenizer implementation for Qwen3 models. Lightweight byte-pair encoding with HuggingFace integration.

Features

  • Byte-Pair Encoding (BPE): Compatible with Qwen3 model tokenization
  • Special Token Support: Handles EOS, PAD, and custom added tokens
  • NFC Normalization: Built-in Unicode normalization
  • HuggingFace Integration: Load tokenizers directly from HuggingFace models
  • Efficient: Optimized for performance with minimal dependencies

Installation

dotnet add package Yuniko.Software.Qwen3Tokenizer

Or via Package Manager:

Install-Package Yuniko.Software.Qwen3Tokenizer

Quick Start

using Yuniko.Software.Qwen3Tokenizer;

// Load from HuggingFace model
var tokenizer = await Qwen3Tokenizer.FromHuggingFaceAsync(
    "Qwen/Qwen3-Embedding-8B");

// Encode text
var result = tokenizer.Encode("Hello, world!");
Console.WriteLine($"Token IDs: {string.Join(", ", result.Ids)}");

// Decode tokens
var text = tokenizer.Decode(result.Ids);
Console.WriteLine($"Decoded: {text}");

Supported Models

Works with all Qwen3 model variants:

  • Qwen3-Embedding models
  • Qwen3 General models
  • Qwen3-Reranker models
  • Qwen3-VL (Vision-Language) models

Requirements

  • .NET 10.0 or later

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please visit the GitHub repository for more information.

Support

For issues, questions, or suggestions, please open an issue on GitHub.

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.2.0 2,528 11/17/2025
1.1.0 373 11/13/2025
1.0.0 376 11/11/2025
0.1.3-preview 230 11/2/2025
0.1.2-preview 175 11/1/2025
0.1.1-preview 155 11/1/2025

## What's Changed
* Restructure repo to root-based .NET layout and add model name validation by @demid-ns in https://github.com/yuniko-software/qwen3-tokenizer-dotnet/pull/9


**Full Changelog**: https://github.com/yuniko-software/qwen3-tokenizer-dotnet/compare/dotnet-0.1.1-preview...0.1.2-preview